@markdown-code-assist/cli
v0.1.0
Published
Command-line interface for the Markdown Code Assist engine — lint and format fenced code blocks in your Markdown files.
Maintainers
Readme
@markdown-code-assist/cli
Lint and format fenced code blocks inside Markdown files — from the command line.
mca is the command-line interface for the Markdown Code Assist Engine. It scans every fenced code block in your Markdown files, reports syntax errors and style issues, and can reformat them in-place.
Installation
# Global install
npm install -g @markdown-code-assist/cli
# Or run without installing
npx @markdown-code-assist/cli check README.md
pnpm dlx @markdown-code-assist/cli check README.mdCommands
mca check <files>
Lint all fenced code blocks. Exits with a non-zero code when errors are found — CI-friendly.
mca check README.md
mca check "docs/**/*.md"
mca check "**/*.md"mca format <files>
Preview how code blocks would be reformatted (dry run by default).
mca format README.mdApply changes in-place with --write:
mca format README.md --write
mca format "docs/**/*.md" --writemca inspect <files>
Print discovered fenced blocks and their metadata — useful for debugging which blocks are detected and with what language.
mca inspect README.mdOptions
| Flag | Description |
|---|---|
| --write | Apply formatting in-place (format command only) |
| --config <path> | Path to a config file (default: mca.config.json in cwd) |
| --help | Show help |
| --version | Show version |
Configuration
Drop an mca.config.json in your project root — it is loaded automatically:
{
"formatting": {
"tabSize": 2,
"insertFinalNewline": true
},
"languages": {
"python": { "formattingEnabled": true, "diagnosticsEnabled": true },
"json": { "formattingEnabled": true, "diagnosticsEnabled": true },
"yaml": { "formattingEnabled": true, "diagnosticsEnabled": true },
"javascript": { "formattingEnabled": true, "diagnosticsEnabled": true },
"typescript": { "formattingEnabled": true, "diagnosticsEnabled": true }
}
}Or pass an explicit path:
mca --config ./config/mca.config.json check "**/*.md"Use in CI
# .github/workflows/docs.yml
- name: Lint Markdown code blocks
run: npx @markdown-code-assist/cli check "**/*.md"Supported languages
| Language | Diagnostics | Formatting |
|---|---|---|
| JSON | ✅ | ✅ |
| YAML | ✅ | ✅ |
| JavaScript | ✅ syntax + no-undef | ✅ |
| TypeScript | ✅ syntax + no-undef | ✅ |
| Shell / Bash | ✅ | ✅ safe-only |
| Python | ✅ via Tree-sitter | ✅ safe-only |
| HTML | ✅ via Tree-sitter | ✅ safe-only |
| CSS | ✅ via Tree-sitter | ✅ safe-only |
Links
License
MIT © Faouzi Boussad
