{"id":27483466,"url":"https://github.com/thiagobarbosa/documentry","last_synced_at":"2025-08-25T08:17:13.757Z","repository":{"id":287787916,"uuid":"965788875","full_name":"thiagobarbosa/documentry","owner":"thiagobarbosa","description":"AI-powered OpenAPI documentation generator for Next.js applications.","archived":false,"fork":false,"pushed_at":"2025-06-23T20:39:42.000Z","size":642,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-09T04:46:23.568Z","etag":null,"topics":["ai","api","docs","documentation","llm","nextjs","openapi"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thiagobarbosa.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-04-13T22:42:18.000Z","updated_at":"2025-06-23T20:39:45.000Z","dependencies_parsed_at":"2025-06-21T01:30:19.510Z","dependency_job_id":"736415b2-b8d1-413a-9689-8847543b60c7","html_url":"https://github.com/thiagobarbosa/documentry","commit_stats":null,"previous_names":["thiagobarbosa/documentry"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/thiagobarbosa/documentry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagobarbosa%2Fdocumentry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagobarbosa%2Fdocumentry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagobarbosa%2Fdocumentry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagobarbosa%2Fdocumentry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thiagobarbosa","download_url":"https://codeload.github.com/thiagobarbosa/documentry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thiagobarbosa%2Fdocumentry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272031419,"owners_count":24861687,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","api","docs","documentation","llm","nextjs","openapi"],"created_at":"2025-04-16T15:48:50.107Z","updated_at":"2025-08-25T08:17:13.749Z","avatar_url":"https://github.com/thiagobarbosa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Documentry\n\n[![npm version](https://img.shields.io/npm/v/documentry.svg)](https://www.npmjs.com/package/documentry)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nDocumentry is a AI-powered Typescript library that uses LLM models to understand your Next.js API routes and\nautomatically generate detailed OpenAPI documentation in multiple formats: `json`, `yaml`, and interactive `html`.\n\nWith a single terminal command, `Documentry` scans every API route in your Next.js project,\nunderstand the actual code of your `route.ts` files, and generates a valid `OpenAPI Specification (OAS)` file that\ndescribes your endpoints.\n\n## Key Features\n\n- 🚀 Automatically scams your project and detects your Next.js API routes\n- 🧠 Uses AI to understand the actual code of your routes\n- 📝 Creates `OpenAPI 3.0` specifications in `json`, `yaml`, or interactive `html` format\n- 🔄 Currently supports OpenAI and Anthropic models\n\n## Installation\n\n```bash\nnpm install documentry --save-dev\n```\n\n## Usage\n\n### Command line\n\n```bash\nnpx documentry \n```\n\n### Programmatic API\n\n```typescript\nimport { Documentry } from 'documentry'\n\n// Create a new Documentry instance\nconst documentry = new Documentry()\n\n// Generate OpenAPI specs\nawait documentry.generate()\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eFull usage example\u003c/summary\u003e\n\n```typescript\nconst documentry = new Documentry({\n  provider: 'anthropic',\n  model: 'claude-3-5-sonnet-latest',\n  apiKey: process.env.ANTHROPIC_API_KEY,\n  dir: './app/api',\n  routes: ['/user', '/products/*'],\n  outputFile: './docs/openapi',\n  format: 'html', // 'yaml', 'json', or 'html'\n  info: {\n    title: 'My API',\n    version: '1.0.0',\n    description: 'My API description'\n  },\n  servers: [\n    {\n      url: 'http://localhost:3000/api',\n      description: 'Local server'\n    },\n    {\n      url: 'https://api.example.com',\n      description: 'Production server'\n    }\n  ]\n})\n\nawait documentry.generate()\n```\n\nAn example of the generated OpenAPI documentation in HTML format:\n\n![openapi.png](openapi.png)\n\n\n\u003c/details\u003e\n\n\nMore examples can be found in the [examples](src/examples) directory.\n\n## Environment Variables\n\nYou can configure the LLM settings with an `.env` file:\n\n```bash\nLLM_PROVIDER=your-llm-provider # openai or anthropic; defaults to anthropic\nLLM_MODEL=your-llm-model # defaults to claude-3-5-sonnet-latest\nANTHROPIC_API_KEY=your-anthropic-key\nOPENAI_API_KEY=your-openai-key\n```\n\n## Configuration Options\n\nThe CLI usage supports the following options:\n\n| Flag                              | Description                                                                   | Default                                                                         |\n|-----------------------------------|-------------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| `--dir \u003cdirectory\u003e`               | Root directory for your Nextjs API routes (`./app/api`, `./src/app/api`, etc) | `./app/api`                                                                     |\n| `--routes \u003croutes\u003e`               | List of routes to process (e.g., \"/user,/products/*\")                         | All routes are considered                                                       |\n| `--servers \u003cservers\u003e`             | List of server URLs (e.g. \"url1\\|description1, url2...\")                      | URL: `http://localhost:3000/api`                                                |\n| `-o, --output-file \u003cfile\u003e`        | Output folder/file for the generated OpenAPI specs                            | `./docs/openapi`                                                                |\n| `-f, --format`                    | The format for the generated OpenAPI file (`yaml`, `json`, or `html`)         | `yaml`                                                                          |\n| `-t, --title \u003ctitle\u003e`             | Title for the OpenAPI spec                                                    | `Next.js API`                                                                   |\n| `-d, --description \u003cdescription\u003e` | Description for the OpenAPI spec                                              | `API documentation for Next.js routes`                                          |\n| `-v, --version \u003cversion\u003e`         | Version for the OpenAPI spec                                                  | `1.0.0`                                                                         |\n| `-p, --provider \u003cprovider\u003e`       | LLM provider (`anthropic` or `openai`)                                        | Env variable `LLM_PROVIDER`                                                     |\n| `-m, --model \u003cmodel\u003e`             | LLM model to use                                                              | Env variable `LLM_MODEL`                                                        |\n| `-k, --api-key \u003ckey\u003e`             | LLM provider API key                                                          | Env variable `ANTHROPIC_API_KEY` or `OPENAI_API_KEY`, according to the provider |\n\n## Development\n\n### Prerequisites\n\n- Node.js \u003e= 14.0.0\n- npm \u003e= 6.0.0\n\n### Setting up the Development Environment\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/thiagobarbosa/documentry\n   cd documentry\n   ```\n\n2. Install dependencies:\n   ```bash\n   npm install\n   ```\n\n3. Build the project:\n   ```bash\n   npm run build\n   ```\n\n4. Run in development mode:\n   ```bash\n   npm run dev\n   ```\n\n## License\n\nThis project is licensed under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagobarbosa%2Fdocumentry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthiagobarbosa%2Fdocumentry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthiagobarbosa%2Fdocumentry/lists"}