CLI for managing Fumadocs documentation projects with NestJS OpenAPI integration
npm install dmakerA powerful CLI tool for managing Fumadocs documentation projects with NestJS OpenAPI integration.
- 🚀 Quick Setup: Initialize documentation projects with a single command
- 📝 OpenAPI Integration: Generate OpenAPI specs from NestJS applications
- 🔄 Hot Reload: Development server with automatic file watching
- 📦 Static Export: Build optimized static documentation sites
- 🎨 Fumadocs Powered: Beautiful documentation UI out of the box
``bash`
npm install -g dmakeror
yarn global add dmakeror
pnpm add -g dmaker
`bash`
dmaker init
This will create a new documentation project with:
- Basic content structure
- Configuration file
- Example MDX files
`bash`
dmaker openapi
Generate OpenAPI JSON from your NestJS application with enhanced response schemas.
Requirements:
- Configure nestjs section in dmaker.config.json@nestjs/swagger
- NestJS application with setup
`bash`
dmaker generate
Build the documentation site from your content and OpenAPI spec.
`bash`
dmaker dev
Start a development server with automatic file watching and hot reload.
Create a dmaker.config.json file in your project root:
`json`
{
"name": "my-docs",
"title": "My Documentation",
"description": "API Documentation",
"openapiFile": "./openapi.json",
"contentDir": "./content",
"outDir": "./out",
"nestjs": {
"appDir": "./src",
"rootDir": "./",
"envFile": ".env",
"tsconfigPath": "tsconfig.json",
"apiPrefix": "api",
"apiPrefixExcludeRoutes": ["/health", "/metrics"],
"versioning": {
"enabled": true,
"type": "URI",
"prefix": "v"
},
"dtoFileNameSuffix": [".dto.ts", ".presenter.ts"],
"controllerFileNameSuffix": ".controller.ts"
}
}
Initialize a new documentation project.
Options:
- -n, --name - Project name-d, --dir
- - Target directory (default: ".")
Generate OpenAPI specification from NestJS application.
Options:
- -c, --config - Path to config file (default: "dmaker.config.json")--keep-scripts
- - Keep temporary scripts for debugging
Generate documentation from your content.
Options:
- -c, --config - Path to config file (default: "dmaker.config.json")--clean
- - Remove temp directory after build
Start development server with hot reload.
Options:
- -c, --config - Path to config file (default: "dmaker.config.json")-p, --port
- - Port to run the dev server on (default: "3000")
dmaker provides seamless integration with NestJS applications:
1. Automatic OpenAPI Generation: Extracts metadata from your NestJS controllers
2. Enhanced Response Schemas: Adds success response schemas from TypeScript return types
3. Versioning Support: Handles API versioning (URI, Header, etc.)
4. Global Prefix Handling: Respects your API prefix configuration
5. Route Exclusions: Skip routes like health checks from global prefix
`bash1. Initialize project
dmaker init -n my-api-docs
Requirements
- Node.js >= 18
- For NestJS integration:
@nestjs/swagger and @nestjs/cli` installed in your projectMIT © Alexandre Retamero
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please file an issue on the GitHub repository.