docforge-gen
v1.0.1
Published
Zero-config documentation for any repo. One command. Always fresh.
Maintainers
Readme
Most doc tools require you to write the docs yourself. Docforge scans your codebase and generates them for you — overview, architecture diagrams, API reference, and a health score that keeps your team honest.
npx docforge-genThat's it.
Before → After
Before: your repo has no docs.
After: Docforge generates a complete docs-gen/ folder:
docs-gen/
├── overview.md ← Project summary, quick start, tech stack
├── architecture.md ← Mermaid diagrams, module breakdown, dependencies
├── api.md ← Auto-detected endpoints with curl examples
├── structure.md ← Annotated directory tree, file stats, comment coverage
└── health.md ← Documentation health score (0-100%)Zero config. Zero manual writing.
Quick Start
CLI (fastest)
# Run instantly — no install needed
npx docforge-gen
# Or install globally
npm install -g docforge-gen
# Just the health check
docforge health
# Explain a specific folder
docforge explain src/services
# Custom output directory
docforge generate --output documentationGitHub Action (set and forget)
Add to .github/workflows/docforge.yml:
name: Documentation
on:
push:
branches: [main]
permissions:
contents: write
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: martinanatale93/docforge@v1Docs are generated and committed on every push. Done.
Health Score
The feature that makes teams adopt Docforge. Every run scores your documentation:
📊 Documentation Score: 72% 🟡
✅ README — 15/15 pts
✅ README quality — 10/10 pts
✅ Project description — 5/5 pts
❌ Code comments — 6/15 pts
✅ API documentation — 10/10 pts
✅ Tests — 10/10 pts
✅ CI/CD — 5/5 pts
❌ License — 0/5 pts
❌ Contributing guide — 0/5 pts
❌ Changelog — 0/5 pts
✅ Env template — 5/5 pts
✅ Setup scripts — 10/10 pts
Missing:
- License
- Contributing guide
- ChangelogUse it in CI to block merges when docs score drops below a threshold. Teams improve documentation organically because nobody wants to be the one who broke the score.
What It Detects
| Category | Technologies | |----------|-------------| | Languages | TypeScript, JavaScript, Python, C#, Java, Go, Ruby, Rust, Swift, Kotlin, PHP | | Frameworks | React, Next.js, Vue, Nuxt, Angular, Svelte, Express, Fastify, NestJS, Django, Flask, FastAPI | | Databases | PostgreSQL, MySQL, MongoDB, Redis, Prisma, TypeORM, Sequelize | | Infrastructure | Docker, Terraform, GitHub Actions, GitLab CI, Serverless, AWS CDK, Vercel, Netlify | | API Styles | REST (Express / Fastify / NestJS / .NET / Flask / FastAPI routes) |
Reference
| Input | Default | Description |
|-------|---------|-------------|
| output-dir | docs-gen | Where to write generated docs |
| include-health-score | true | Include health score in output |
| commit-changes | true | Auto-commit docs back to repo |
| commit-message | docs: auto-update documentation [skip ci] | Commit message |
| sections | overview,architecture,api,structure | Which sections to generate |
| Output | Description |
|--------|-------------|
| health-score | Documentation health score (0–100) |
| docs-path | Path to generated docs directory |
| files-generated | Number of files generated |
| Command | Description |
|---------|-------------|
| docforge generate | Generate all documentation (default) |
| docforge health | Run health check only |
| docforge explain <path> | Explain a specific folder |
| Option | Default | Description |
|--------|---------|-------------|
| -d, --dir <path> | . | Project root directory |
| -o, --output <path> | docs-gen | Output directory |
| --no-health | — | Skip health score |
| -s, --sections <list> | overview,architecture,api,structure | Sections to generate |
Examples
See the examples/ directory for ready-to-use workflow templates:
- Auto-generate on push — generate + commit docs on every push to main
- PR health check — comment the health score on every pull request
Roadmap
- [ ] OpenAPI/Swagger spec generation
- [ ] Mermaid sequence diagrams from code
- [ ] Multi-language README (i18n)
- [ ] Custom templates / themes
- [ ] Badge generation (embed health score in your README)
- [ ] Search across generated docs
- [ ] AI-powered explanations (optional)
License
MIT
