Installation
contextlint offers two installation paths. If you already use an AI host (Claude Code / Cursor / Codex, etc.), the Skill route is the fastest. Otherwise, set things up manually via the CLI.
Skill route (recommended)
Section titled “Skill route (recommended)”If you use an AI host that supports agentskills.io, a single gh skill install command is all it takes.
gh skill install nozomi-koborinai/contextlint contextlint-initAfter that, just ask the AI:
Set up contextlint.
The AI analyzes your repository, reads its document layout and style (ADR format / spec format / table-heavy / and so on), and generates a contextlint.config.json tailored to the project. You don’t need to pick rules by hand from the catalog of 21.
Supported AI hosts:
- Claude Code
- Cursor Agent
- Cline
- Codex
- Gemini CLI
- GitHub Copilot
- Other hosts that follow the agentskills.io spec
Prerequisite: GitHub CLI (gh) must be installed. If you don’t have it yet, see the GitHub CLI website.
CLI route (manual)
Section titled “CLI route (manual)”If you don’t use an AI host, or you want to manage configuration entirely by hand, install the @contextlint/cli package directly.
By package manager
Section titled “By package manager”contextlint is published on the npm registry. Run whichever command matches your project’s package manager.
# bunbun add -D @contextlint/cli
# pnpmpnpm add -D @contextlint/cli
# yarnyarn add -D @contextlint/cli
# npmnpm install -D @contextlint/cliWe recommend adding it as a dev dependency (-D or --save-dev), since it isn’t needed in production builds.
Global install (optional)
Section titled “Global install (optional)”If you use contextlint frequently across multiple projects, a global install is also fine.
# bunbun add -g @contextlint/cli
# npmnpm install -g @contextlint/cliThat said, if you want to pin the dependency version per project, a project-local install (-D) is safer. It guarantees the same behavior in CI as well.
Verify
Section titled “Verify”If the version prints, the install worked.
npx contextlint --versionNext steps
Section titled “Next steps”- Quick Start — AI-assisted — run
initfrom a Skill and finish setup in the shortest path - Quick Start — Manual — generate the config interactively with
contextlint init