AI-powered code documentation generator
Project description
DocuAI
DocuAI is an autonomous AI agent and CLI tool that analyzes codebases and generates comprehensive documentation automatically. It supports Python and JavaScript/TypeScript projects.
Features
- Multi-Language Support: Parses Python (using
ast) and JavaScript (usingesprima). - AI-Powered Documentation: Uses OpenAI's GPT models to generate detailed documentation for classes, functions, and modules.
- Code Analysis: Identifies code smells, security vulnerabilities, and architectural issues.
- GitHub Support: Clone and analyze entire repositories directly from a URL.
- Directory Support: Analyze local projects with smart file traversal (ignores
.venv,node_modules, etc.). - Repo-level Insights: Generates a single comprehensive report for the entire project.
Installation
-
Clone the repository:
git clone https://github.com/AyushJaiswal18/DocuAI.git cd DocuAI
-
Install dependencies:
pip install -e .
Configuration
DocuAI requires an OpenAI API key to function. You can set it in multiple ways:
Option 1: Environment Variable (Recommended for global install)
export OPENAI_API_KEY='your-api-key-here'
Add this to your shell profile (~/.bashrc, ~/.zshrc, etc.) to make it permanent.
Option 2: .env File (For development)
Create a .env file in your project directory:
OPENAI_API_KEY=your-api-key-here
LANGCHAIN_TRACING_V2=true # Optional: for LangSmith tracing
LANGCHAIN_API_KEY=your-langchain-api-key # Optional
Option 3: Per-command
OPENAI_API_KEY='your-key' docuai generate script.py
Global Installation
To install DocuAI globally on your system so you can use it from any directory:
Option 1: Using pipx (Recommended)
pipx installs the tool in an isolated environment but makes the command available globally.
pipx install .
Option 2: Using pip
pip install .
Publishing to PyPI
To share this tool with the world, you can publish it to PyPI:
-
Build the package:
python -m build
This creates
dist/docuai-0.1.0.tar.gzanddist/docuai-0.1.0-py3-none-any.whl -
Test locally (optional but recommended):
pip install dist/docuai-0.1.0-py3-none-any.whl
-
Upload to PyPI:
twine upload dist/*
-
Users can then install via:
pip install docuai
Usage
Generate Documentation
Single File:
docuai generate ./path/to/file.py
Local Directory (Project-level):
docuai generate . --output project_docs.md
GitHub Repository:
docuai generate https://github.com/username/repo --output repo_docs.md
Analyze Code
Single File:
docuai analyze ./path/to/file.py
Local Directory (Project-level):
docuai analyze .
GitHub Repository:
docuai analyze https://github.com/username/repo
Contributing
Contributions are welcome! Please open an issue or submit a pull request.
License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docuai-0.1.0.tar.gz.
File metadata
- Download URL: docuai-0.1.0.tar.gz
- Upload date:
- Size: 9.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7ce684b7be8364c0f318c624778701a8d8b6c058be6472768635d62bdfaef898
|
|
| MD5 |
9ea8bd8812abbe77b89b8512e866ce72
|
|
| BLAKE2b-256 |
f0f5f937fe5f756c48f8d5ff89c8c5b49cbca65b85732d0c2bd55e39b5168bf4
|
File details
Details for the file docuai-0.1.0-py3-none-any.whl.
File metadata
- Download URL: docuai-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f79e1194f8205035f658384cf97549df1f04b14a9e9ba4e5f08fd759abc934a
|
|
| MD5 |
b8eb9004ce9c918090b64ba356764f72
|
|
| BLAKE2b-256 |
fce3e8257c74fb3ea3d1b743c7c552ed4714ef728e83b8ad6a121adff11bd34f
|