innovation-doc-gen-cli
v1.2.1
Published
AI-powered documentation generator for JavaScript/TypeScript projects
Maintainers
Readme
innovation-doc-generator
AI-powered documentation generator for JavaScript/TypeScript projects. Automatically generates and updates API documentation and README files using AI.
Features
- Auto-generate API docs - Extracts functions, classes, and React components from your codebase
- README generation - Creates comprehensive project documentation
- Incremental updates - Only processes changed files for faster updates
- TypeScript support - Full support for TS/TSX and JS/JSX files
- Multiple AI providers - Choose from Claude, OpenAI, or Ollama (free, local)
Installation
npm install -g innovation-doc-gen-cliOr use with npx:
npx innovation-doc-gen-cli initQuick Start
- Initialize in your project directory:
innovation-doc initThis creates a .aidocrc.json configuration file with default settings.
- Choose your AI provider (edit
.aidocrc.json):
Option A: Ollama (Free, Local)
{
"provider": "ollama",
"model": "llama3.2"
}Requires Ollama running locally. No API key needed.
Option B: OpenAI
{
"provider": "openai",
"model": "gpt-4o"
}export OPENAI_API_KEY=your-api-keyOption C: Claude (Default)
{
"provider": "claude",
"model": "claude-sonnet-4-20250514"
}export CLAUDE_API_KEY=your-api-key- Generate documentation:
innovation-doc generate- Update documentation after code changes:
innovation-doc updateCommands
| Command | Description |
|---------|-------------|
| innovation-doc init | Initialize configuration file |
| innovation-doc generate | Generate full documentation |
| innovation-doc update | Update docs for changed files only |
Configuration
The .aidocrc.json file supports these options:
{
"include": ["src/**/*.{js,ts,jsx,tsx}"],
"exclude": ["**/*.test.ts", "**/*.spec.ts", "node_modules/**"],
"output": "./docs",
"provider": "claude",
"model": "claude-sonnet-4-20250514",
"generateReadme": true,
"generateApiDocs": true
}| Option | Description | Default |
|--------|-------------|---------|
| include | Glob patterns for files to document | ["src/**/*.{js,ts,jsx,tsx}"] |
| exclude | Glob patterns to exclude | ["**/*.test.ts", "node_modules/**"] |
| output | Output directory for docs | "./docs" |
| provider | AI provider: claude, openai, or ollama | "claude" |
| model | Model name (varies by provider) | "claude-sonnet-4-20250514" |
| apiKey | API key (not needed for ollama) | from env var |
| baseUrl | Ollama server URL | "http://localhost:11434" |
| generateReadme | Generate README.md | true |
| generateApiDocs | Generate API.md | true |
Default Models by Provider
| Provider | Default Model |
|----------|---------------|
| claude | claude-sonnet-4-20250514 |
| openai | gpt-4o |
| ollama | llama3.2 |
Output
The tool generates documentation in the output directory:
API.md- Detailed API documentation for all exported functions, classes, and components
README.md- Project overview and usage guide
Programmatic Usage
You can also use the package programmatically:
import {
loadConfig,
analyzeProject,
generate
} from 'innovation-doc-gen-cli';
const config = loadConfig();
const docs = await generate(config);
console.log('Generated:', docs.map(d => d.filePath));Requirements
- Node.js >= 18.0.0
- One of the following:
License
MIT
