markdownlint-obsidian-cli

raw JSON →
1.0.4 verified Fri May 01 auth: no javascript

Command-line interface for linting Obsidian Flavored Markdown (OFM) using markdownlint-obsidian rules. Version 1.0.4 wraps the markdownlint-obsidian library with a commander-based CLI. Released under MIT license, with recent fixes disabling the MD028 rule by default to avoid false positives on multi-paragraph callouts. Supports --fix, --fix-check, multiple output formatters (SARIF, JUnit), and custom config. Requires Node >=20 or Bun >=1.1.30. Key differentiator: provides CLI access to OFM-specific rules not available in generic markdownlint.

error Error: Cannot find module 'markdownlint-obsidian-cli'
cause Package not installed or not in PATH when using global install without -g flag.
fix
Ensure you run 'npm install -g markdownlint-obsidian-cli' or use 'npx markdownlint-obsidian-cli'.
error Error: Unknown rule 'MD028'
cause You have enabled MD028 in config, but it is disabled by default in this CLI version.
fix
Add 'MD028': false to your config or remove it; the rule is not needed for OFM.
error Error: Requires Node.js >=20.0.0
cause You are using an older version of Node.js.
fix
Upgrade Node.js to version 20 or later, or switch to Bun >=1.1.30.
error Error: No files matched the pattern
cause Glob pattern is not quoted or does not match any files.
fix
Use quotes around the glob pattern, e.g., "**/*.md".
breaking MD028 rule disabled by default since v1.0.2 for markdownlint-obsidian and v1.0.8 for CLI. Blank > lines are required in OFM callouts; enabling MD028 causes false positives.
fix If you need MD028, enable it in your config file explicitly.
gotcha The CLI exits with code 0 even if warnings are present. Only errors cause exit code 1.
fix Use --output-formatter to capture all issues, or rely on exit code only for errors.
deprecated v0.x releases were smoke tests and are not real releases. They may have missing dependencies or broken Docker builds.
fix Use v1.0.4 or later.
gotcha Node.js >=20.0.0 or Bun >=1.1.30 is required. Older runtimes will fail with a syntax error.
fix Upgrade Node.js to 20+ or use Bun 1.1.30+.
gotcha The CLI does not load .markdownlint.json or .markdownlint.yaml automatically. Use --config to specify a config file.
fix Pass --config path/to/.markdownlint.json explicitly.
npm install markdownlint-obsidian-cli
yarn add markdownlint-obsidian-cli
pnpm add markdownlint-obsidian-cli

Lint all markdown files in 'src' directory with auto-fix enabled.

npx markdownlint-obsidian --fix "src/**/*.md"
# Exit code 0 = clean, 1 = errors, 2 = tool failure