@craftpipe/docgen-cli
v1.0.0
Published
<p align="center"> <img src=".github/assets/banner.svg" alt="docgen-cli" width="800" /> </p>
Maintainers
Readme
docgen-cli
Documentation generation CLI -- analyze, generate, and maintain docs for any JavaScript/TypeScript project.
Same analysis engine as DocForge MCP, now as a standalone CLI with commander.js.
Install
npm install -g docgen-cliArchitecture
graph TD
CLI["docgen CLI"] --> Scanner["project-scanner"]
CLI --> Routes["route-detector"]
CLI --> Env["env-scanner"]
CLI --> Types["type-extractor"]
CLI --> Git["git-analyzer"]
CLI --> JSDoc["jsdoc-parser"]
CLI --> Fmt["formatters"]
CLI --> Gate["premium/gate"]
Scanner --> |"project metadata"| Scan["scan"]
Scanner --> Readme["readme"]
Routes --> API["api"]
Routes --> OpenAPI["openapi (Pro)"]
Git --> Changelog["changelog"]
Git --> Migration["migration (Pro)"]
Git --> Release["release-notes (Pro)"]
Env --> EnvCmd["env"]
Types --> TypesCmd["types"]
JSDoc --> Coverage["coverage"]
Scanner --> Sync["sync (Pro)"]
Scanner --> Arch["architecture (Pro)"]
Scanner --> Multi["multi-repo (Pro)"]Commands
Free Commands
| Command | Description |
|:--------|:------------|
| docgen scan [path] | Documentation readiness score (0-100) |
| docgen readme [path] | Generate README.md |
| docgen api [path] | Extract API endpoints, generate docs |
| docgen changelog [path] | CHANGELOG from git history |
| docgen env [path] | Document environment variables |
| docgen types [path] | Document TypeScript types/interfaces/Zod |
| docgen coverage [path] | JSDoc/TSDoc coverage percentage |
Pro Commands
Requires PRO_LICENSE environment variable.
| Command | Description |
|:--------|:------------|
| docgen openapi [path] | OpenAPI 3.1 spec (--format yaml\|json) |
| docgen sync [path] | Documentation drift detection |
| docgen migration <from> <to> | Migration guide between git refs |
| docgen architecture [path] | Architecture doc with Mermaid diagrams |
| docgen multi-repo <repos...> | Unified docs across multiple repos |
| docgen release-notes <from> <to> | Release notes between tags |
Usage
# Score your project's documentation readiness
docgen scan
# Generate a README
docgen readme > README.md
# Extract API endpoints
docgen api --json
# Generate changelog from git history
docgen changelog --format keepachangelog
# Document environment variables
docgen env
# Document TypeScript types
docgen types
# Check JSDoc coverage with threshold
docgen coverage --threshold 80JSON Output
All commands support --json for machine-readable output:
docgen scan --json | jq '.score'
docgen api --json | jq '.endpoints'Changelog Options
docgen changelog --from v1.0.0 --to v2.0.0 --format conventional
docgen changelog --format keepachangelogPro Commands
export PRO_LICENSE=your-license-key
# Generate OpenAPI spec
docgen openapi --format yaml > openapi.yaml
# Detect documentation drift
docgen sync
# Migration guide
docgen migration v1.0.0 v2.0.0
# Architecture documentation
docgen architecture
# Multi-repo documentation
docgen multi-repo ./frontend ./backend ./shared
# Release notes
docgen release-notes v1.0.0 v1.1.0Framework Detection
docgen-cli automatically detects your project's framework:
- Next.js -- App Router API routes (
export function GET) - Express --
app.get(),router.post(), etc. - Fastify -- Fastify route handlers
- Hono -- Hono route handlers
- Generic -- Any JavaScript/TypeScript project
License
MIT
