markdownlint-cli2
$ markdownlint-cli2 Community Low Riskmarkdownlint-cli2 (markdownlint-cli2) is the modern, configuration-driven CLI for markdownlint, validating Markdown structure, heading hierarchy, fenced code blocks, and whitespace across globs. It supports --fix for safe formatting fixes and customizable JSON/SARIF output formatters.
brew install markdownlint-cli2 markdownlint-cli2 lints and auto-fixes local Markdown repositories in milliseconds with zero network access.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Deterministic exit codes, --fix, --config, and JSON/SARIF output formatter plugins configured via .markdownlint-cli2.jsonc.
- Non-interactive glob linting with clean line/rule diagnostics
- Supports
--fixfor safe automated formatting cleanup
Read-only by default (--fix is explicit opt-in) and 100% offline.
- No network or credentials
- In-place edits only happen when
--fixis passed
Available via npm, npx, and Homebrew across macOS, Linux, and Windows.
npm install -g markdownlint-cli2,npx markdownlint-cli2,brew install markdownlint-cli2
Fast, standard Markdown lint gate that aligns directly with the VS Code markdownlint extension.
- Shared rule engine and config compatibility with editor extensions
Maintained by markdownlint author David Anson (DavidAnson/markdownlint-cli2) under MIT.
- Active releases from upstream
markdownlintmaintainer
Detailed README covering configuration precedence, globs, formatters, and --fix.
- GitHub README documentation
Security, Auth & Guardrails
No credentials required; pure offline Node.js linter.
Free open-source software (MIT).
# markdownlint-cli2 Agent Rules - Quote glob arguments (e.g. `"docs/**/*.md"`) so `markdownlint-cli2` handles globbing consistently across shells. - Run read-only lint before `--fix`, and inspect `git diff` after `--fix`. - Respect existing `.markdownlint-cli2.jsonc` / `.markdownlint.json` repository configs instead of overriding rules.
Agent-Ready Command Recipes
Safe Read-Only Queries
markdownlint-cli2 "docs/**/*.md"
Validates Markdown formatting and structural rules across docs/ without modifying files.
Controlled Writes & Previews
markdownlint-cli2 --fix "docs/**/*.md"
Applies safe deterministic fixes (trailing whitespace, list indentation, blank lines) in place.
Strengths for Agents
- + Fast, deterministic Markdown structural linting with
--fixauto-remediation. - + Matches the popular VS Code
markdownlintextension ruleset and config files. - + Zero-install usage via
npx markdownlint-cli2or Homebrew.
Caveats & Pitfalls
- ! JSON or SARIF output requires configuring an output formatter (such as
markdownlint-cli2-formatter-json) rather than a built-in--jsonCLI flag. - ! Unquoted globs can be expanded inconsistently by different shells.