Skip to content

CLI

The contextlint command, provided by the @contextlint/cli package, runs the same way in local development and in CI. A single binary covers config auto-detection, watch mode, and machine-readable JSON output.

For installation, see Get Started → Installation. This page is the entry point for what to do once it’s installed.

Subcommand Purpose
contextlint (default) Lint Markdown documents
contextlint init Generate contextlint.config.json interactively
contextlint compile Compile documents and rules into a Claude Code SKILL.md
contextlint impact <file> Analyze which documents are affected by changing a file
contextlint slice <query> Extract the minimal set of documents related to a query
contextlint graph Print the document dependency graph

For arguments and options of each subcommand, see Commands.

  • Commands — behavior and usage of lint / init / compile
  • Flags reference--config / --format / --watch / --cwd and friends
  • Watch mode — re-lint automatically when files change
  • JSON output — the shape of --format json and how to use it in CI

After installation, you can confirm the version with:

Terminal window
npx contextlint --version

--version and --help work without a config file, but actually linting requires contextlint.config.json. For how to write one, see Configuration.