AI-powered documentation generation CLI that automatically creates comprehensive docs, API references, and READMEs from your codebase using OpenAI.
Generate professional documentation in seconds. No manual writing required.
- π€ AI-Powered - Uses OpenAI to intelligently analyze and document your code
- π Multiple Output Formats - Generate READMEs, API docs, changelogs, and more
- π¨ Customizable Templates - Handlebars-based templates for full control
- β‘ Watch Mode - Live documentation updates as you code
- π§ TypeScript Support - First-class TypeScript support with full type inference
- βοΈ Easy Configuration - Simple config file to get started
bun install -g scribblynpm install -g scribblyscribbly initThis creates a .scribblyrc.json config file in your project.
export OPENAI_API_KEY=sk_your_key_herescribbly generateGenerate all documentation based on your configuration.
scribbly generateGenerate API documentation from your codebase.
scribbly api --output docs/api.mdGenerate or update your project README.
scribbly readme --output README.mdWatch for file changes and regenerate documentation in real-time.
scribbly watchInitialize a new scribbly configuration file.
scribbly initCreate a .scribblyrc.json file in your project root:
{
"openai": {
"apiKey": "${OPENAI_API_KEY}",
"model": "gpt-4"
},
"input": {
"include": ["src/**/*.ts", "src/**/*.tsx"],
"exclude": ["**/*.test.ts", "**/*.spec.ts"]
},
"output": {
"readme": "README.md",
"api": "docs/api.md",
"changelog": "CHANGELOG.md"
},
"templates": {
"readme": "templates/readme.hbs",
"api": "templates/api.hbs"
}
}| Option | Type | Description |
|---|---|---|
openai.apiKey |
string | Your OpenAI API key (use env var: ${OPENAI_API_KEY}) |
openai.model |
string | OpenAI model to use (default: gpt-4) |
input.include |
string[] | Glob patterns for files to document |
input.exclude |
string[] | Glob patterns for files to ignore |
output.readme |
string | Output path for README |
output.api |
string | Output path for API documentation |
output.changelog |
string | Output path for changelog |
templates.* |
string | Custom Handlebars template paths |
OPENAI_API_KEY(required) - Your OpenAI API key for documentation generation
scribbly api --output docs/api.md --template templates/custom-api.hbsscribbly watch --config custom.scribblyrc.jsonscribbly readme --include "src/index.ts" --include "src/types.ts"- Scans your codebase based on include/exclude patterns
- Analyzes code structure, exports, and comments using OpenAI
- Generates documentation using Handlebars templates
- Outputs formatted markdown files to your specified locations
Scribbly uses Handlebars for templating. Create custom templates in your project:
{{#each exports}}
{{this.description}}
{{/each}}
See `templates/` directory for built-in template examples.
## Troubleshooting
### "OPENAI_API_KEY not found"
Make sure your OpenAI API key is set:
```bash
export OPENAI_API_KEY=sk_your_key_here
scribbly generate
Check that your file patterns in .scribblyrc.json match your source files:
scribbly generate --verboseIf you hit OpenAI rate limits, scribbly will automatically retry with exponential backoff.
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT Β© 2026
