A Claude Code plugin that analyzes your backend codebase and generates API documentation automatically.
- OpenAPI 3.0 (
openapi.yaml) — Industry-standard API specification - Postman Collection (
postman-collection.json) — Import directly into Postman - Swagger UI (
swagger-ui.html) — Interactive API docs in your browser
| Language | Frameworks |
|---|---|
| Node.js | Express, NestJS, Fastify, Koa, Hapi |
| Python | FastAPI, Django REST Framework, Flask |
| Go | Gin, Echo, Chi, Gorilla Mux, Fiber |
| Java/Kotlin | Spring Boot |
| Ruby | Rails |
claude --plugin-dir /path/to/api-docs-genclaude plugin install api-docs-genInside Claude Code, run:
/api-docs-gen:generate
/api-docs-gen:generate --format openapi --output ./api-spec --base-url https://api.example.com
| Flag | Values | Default | Description |
|---|---|---|---|
--format |
openapi, postman, swagger, all |
all |
Which format(s) to generate |
--output |
directory path | ./docs/ |
Where to write the generated files |
--base-url |
URL | http://localhost:3000 |
Base server URL for the API |
Create .api-docs.json in your project root for persistent settings:
{
"format": "all",
"output": "./docs",
"baseUrl": "https://api.example.com",
"title": "My API",
"version": "1.0.0",
"auth": {
"type": "bearer",
"description": "JWT token from /auth/login"
},
"ignore": [
"**/test/**",
"**/spec/**",
"internal/**"
],
"tags": {
"users": "User management endpoints",
"orders": "Order processing"
}
}All fields are optional. CLI arguments override config file values.
| Field | Type | Description |
|---|---|---|
format |
string | Output format: openapi, postman, swagger, or all |
output |
string | Output directory path |
baseUrl |
string | Base URL for the API server |
title |
string | API title (falls back to package name) |
version |
string | API version (falls back to package version) |
auth |
object | Default auth scheme (type + description) |
ignore |
string[] | Glob patterns for files/dirs to skip |
tags |
object | Tag name → description mapping for grouping endpoints |
- Detects your framework — reads
package.json,requirements.txt,go.mod, etc. - Discovers routes — uses framework-specific patterns to find all API endpoints
- Extracts schemas — reads validation libraries (Zod, Joi, Pydantic, class-validator), DTOs, type annotations, and docstrings
- Generates docs — produces valid OpenAPI 3.0 YAML, Postman Collection JSON, and Swagger UI HTML
# Validate the OpenAPI spec
npx @redocly/cli lint docs/openapi.yaml
# Preview Swagger UI (needs local server for YAML loading)
npx serve docs
# Import Postman collection
# Open Postman → Import → Upload docs/postman-collection.jsonMIT