Registry / testing / doccmd

doccmd

JSON →
library2026.3.26.2pypypiunverified

doccmd is a command-line tool (CLI) designed to run external commands, such as linters and formatters, against code blocks embedded within reStructuredText and Markdown documentation files. It helps ensure the code examples in documentation remain correct and up-to-date. The library follows a rapid release cadence, with frequent updates, often on a daily basis.

testingdevops
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

This quickstart demonstrates how to use `doccmd` from the command line to execute code blocks in a Markdown file. `doccmd` will find the code blocks, create temporary files, run them, and report any errors. By default, it runs all supported languages. You can specify a language with `--language`.

# Create a sample markdown file cat << EOF > example.md # My Project This is an example document. ```python import os print("Hello from Python!") ``` ```shell echo "Hello from Shell!" ``` EOF # Run doccmd to execute Python and shell code blocks doccmd example.md
doccmd --version
Debug
Known footguns
gotchadoccmd creates temporary files for each code block (e.g., `doccmd_*.py`). These files can interfere with linters or other tools if not explicitly ignored in their configurations.
breakingWhen grouping code blocks (using `group doccmd[all]: start`/`end`), tools which modify the code block content will not write changes back to the original documentation file for grouped blocks. By default, this will cause `doccmd` to error.
gotchaThe library has a very rapid release cadence with frequent updates, sometimes daily. While this means quick bug fixes and new features, it may also introduce minor behavioral changes or regressions between closely spaced versions.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
14 hits · last 30 days
ahrefsbot
4
gptbot
3
amazonbot
3
bytedance
2
script
1
Resources