Skip to content

Quick Start — Manual

Use these steps if you don’t have an AI host, or you want to manage the configuration entirely yourself. Three commands and you’re running lint.

The shortest install command is:

Terminal window
npm install -D @contextlint/cli

For bun / pnpm / yarn, see Installation.

Running contextlint init walks you through an interactive prompt and produces a contextlint.config.json tailored to your project.

Terminal window
npx contextlint init

After answering the questions, a config file similar to the following is written to the repository root.

{
"$schema": "https://raw.githubusercontent.com/nozomi-koborinai/contextlint/main/schema.json",
"include": ["docs/**/*.md"],
"rules": [
{ "rule": "ref001" },
{ "rule": "sec001", "options": { "sections": ["Context", "Decision", "Consequences"] } },
{ "rule": "grp002" }
]
}

Each field is described in detail under Configuration. You’re free to edit the file by hand afterwards.

Terminal window
npx contextlint

contextlint walks up from the current directory looking for contextlint.config.json, and once found, validates Markdown according to its include patterns. Passing target files as CLI arguments overrides the config’s include.

Terminal window
npx contextlint "specs/**/*.md"