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.
Subcommands
Section titled “Subcommands”| 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.
What’s in this section
Section titled “What’s in this section”- Commands — behavior and usage of
lint/init/compile - Flags reference —
--config/--format/--watch/--cwdand friends - Watch mode — re-lint automatically when files change
- JSON output — the shape of
--format jsonand how to use it in CI
Sanity check
Section titled “Sanity check”After installation, you can confirm the version with:
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.