docscheck¶
Stop your documentation telling people to run commands that do not exist. Take the command tree from your running program, read the fenced examples in your docs, and fail the build when one names a command the tool cannot run.
Split a command into a group and every page still using the old form tells readers to run something that errors. Nothing notices, because no test compares the docs with the CLI.
What it flags¶
One shape, and only one: inside a fenced code block, a command group followed by a concrete token that is not one of its subcommands.
| Example | Verdict |
|---|---|
krites reset IMG_2043.CR2 |
finding: reset is a group; IMG_2043.CR2 is not a subcommand |
krites reset frame IMG_2043.CR2 |
fine: resolves to a leaf |
krites reset |
fine: a bare group is a synopsis |
krites xmp <subcommand> |
fine: a placeholder is a synopsis |
krites config --help |
fine: a flag is not a subcommand |
krites --ci reset IMG_2043.CR2 |
finding: a global flag before the first subcommand is skipped |
Why it is so narrow is explained in Why only fenced blocks.
Where to go next¶
- Guard your docs: the whole thing, in one test.
- Supply a Cobra command tree: the short function that bridges your CLI framework to this module.
- Run it in CI: including the trap that makes a docs check silently never run.