Code2Docs is an AI-powered CLI tool that helps you generate high-quality documentation for your codebase — including inline docstrings, API documentation, database schema descriptions, and project READMEs.
⚠️ This project is still under active development. Expect new features and improvements regularly.
📚 Base Repo: https://github.com/xKarinSan/Code2Docs
💬 Community Discord: https://discord.gg/qugCeYBYud
🌐 Landing Page: https://code2docs-open-source.netlify.app/
🔗 LinkedIn: https://www.linkedin.com/company/code2docs
- 📄 Inline documentation (docstrings + inline comments) (beta)
- 📡 API endpoint documentation (coming soon)
- 🧩 Database schema documentation (coming soon)
- 📘 README.md generation (coming soon)
- 🗂️ Architecture diagram generation (beta)
- Python 3.8 or newer
- An OpenAI API key
- A Git-initialized codebase
-
Install the CLI:
pip install code2docs-cli -
Run the CLI to verify the installation:
c2d
To begin using Code2Docs:
- Make sure your project is inside a Git repository.
- Get your OpenAI API key from platform.openai.com.
- Save your API key locally using:
c2d save-key sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
- You’re ready to generate documentation!
Lists ALL the commands for Code2Docs CLI
Generates inline documentation (docstrings and comments) for your codebase.
c2d code-doc
Generates documentation for your API endpoints.
c2d api-doc
Generates documentation for your database schema.
c2d db-doc
Generates a project-level README.md based on your codebase.
c2d readme-doc
Generates an architecture diagram based on the structure of your codebase.
c2d archi-doc
Saves your OpenAI API key locally for authentication.
c2d save-key sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Displays the currently saved OpenAI API key.
c2d load-key
Displays all available commands and usage.
c2d --help