Illuminate Your API Documentation Generate, manage, and deploy beautiful API docs from OpenAPI specs using AI magic!
To use Lumen Docs, simply run the following command in your terminal:
npx lumen-docs -hUsage: lumen-docs [options] [command]
Generate API documentation from OpenAPI spec
Options:
-V, --version output the version number
-h, --help display help for command
Commands:
init Initialize a new Lumen Docs project
generate Generate API documentation
deploy Deploy API documentation to GitBook
config Update Lumen Docs configuration
enable <service> Enable GitBook deployment
help [command] display help for command
Start your documentation journey with:
npx lumen-docs initThis command sets up a new Lumen Docs project in your current directory. It creates necessary configuration files and folder structure for your API documentation.
Convert your OpenAPI specs into readable Markdown docs with:
npx lumen-docs generateShare your docs using:
npx lumen-docs deploy To run the project in development mode:
-
Clone the repository:
git clone https://github.com/emmanuel39hanks/lumen-docs.git
-
Navigate to the project directory:
cd lumen-docs -
Install dependencies:
npm install
-
Build the project:
npm run build
- The OpenAI API key can be set as an environment variable
OPENAI_API_KEYin a.envfile. - The default location for the OpenAPI spec file is
./spec.json, but you can specify a different location when prompted.
You can customize the output of the generated documentation by modifying the src/services/markdown.ts file. The generateMarkdownFiles function determines the structure and content of the generated Markdown files.
The tool includes error handling for common issues such as:
- Invalid API keys
- File not found errors
- Parsing errors for the OpenAPI spec
Error messages will be displayed in the console with helpful information for troubleshooting.
lumen-docs/
├── src/
│ ├── cli/
│ │ ├── prompts.ts
│ │ ├── spinner.ts
│ │ └── welcome.ts
│ ├── config/
│ │ └── constants.ts
│ ├── services/
│ │ ├── markdown.ts
│ │ └── openai.ts
│ ├── types/
│ │ ├── index.ts
│ │ └── openapi.ts
│ ├── utils/
│ │ ├── error-handler.ts
│ │ ├── file.ts
│ │ └── openapi-parser.ts
│ └── index.ts
├── .env
├── .gitignore
├── package.json
├── README.md
└── tsconfig.json
Contributions are welcome! Please feel free to submit a Pull Request.
Lumen Docs leverages OpenAI's GPT model to generate intelligent and context-aware documentation.