@mp-lb/cli-docs
v0.0.1
Published
Generate a Markdown command reference from a [commander](https://github.com/tj/commander.js) program. The command tree is the single source of truth, so `--help` and the published docs can't drift.
Readme
@mp-lb/cli-docs
Generate a Markdown command reference from a
commander program. The command tree is the
single source of truth, so --help and the published docs can't drift.
Part of our CLI standard — see standards/clis.md.
Install
pnpm add -D @mp-lb/cli-docs
# commander is a peer dependency (your CLI already has it)Usage
import { generateCliReference } from "@mp-lb/cli-docs";
import { program } from "./cli"; // your commander root Command
const markdown = generateCliReference(program, {
// optional: fold top-level alias commands into a "Shortcuts" table
aliasOf: { gco: "git checkout" },
});generateCliReference returns the per-command reference (signatures, arguments,
aliases, descriptions, option tables). Each CLI wraps it with its own
hand-written header/footer and a docs:gen / docs:check script — see
standards/clis.md.
