
Security News
The Nightmare Before Deployment
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.
docuai
Advanced tools
AI-Powered Code Documentation & Analysis
Generate comprehensive documentation and analyze code quality for Python, JavaScript, TypeScript, and React projects using GPT-5.
.md filespip install docuai
DocuAI requires an OpenAI API key. Set it using one of these methods:
export OPENAI_API_KEY='your-api-key-here'
Add to your shell profile for persistence:
echo "export OPENAI_API_KEY='your-key'" >> ~/.bashrc # or ~/.zshrc
Create a .env file in your project directory:
OPENAI_API_KEY=your-api-key-here
OPENAI_API_KEY='your-key' docuai generate script.py
# Single file (saves to filename_docs.md)
docuai generate app.py
# Entire project (saves to dirname_documentation.md)
docuai generate .
# GitHub repository
docuai generate https://github.com/username/repo --output docs.md
# Single file (saves to filename_analysis.md)
docuai analyze app.py
# Entire project (saves to dirname_analysis.md)
docuai analyze .
# Custom output
docuai analyze . --output analysis.md
docuai generate my_project/
Output: Comprehensive documentation including:
docuai analyze src/
Output: Code quality report with:
# Analyze entire codebase
docuai generate . --output PROJECT_DOCS.md
generateGenerate comprehensive documentation for code files, directories, or repositories.
Syntax:
docuai generate <input_path> [--output OUTPUT]
Arguments:
input_path - File path, directory path, or GitHub URL--output - Optional custom output filenameExamples:
docuai generate app.py # Single file
docuai generate . # Current directory
docuai generate /path/to/project # Specific directory
docuai generate https://github.com/user/repo # GitHub repo
analyzeAnalyze code for quality issues, smells, and improvements.
Syntax:
docuai analyze <input_path> [--output OUTPUT]
Examples:
docuai analyze app.py # Single file
docuai analyze . # Current directory
docuai analyze https://github.com/user/repo --output report.md
| Language | File Extensions | Parser |
|---|---|---|
| Python | .py | AST |
| JavaScript | .js, .jsx | Esprima |
| TypeScript | .ts, .tsx | Esprima |
DocuAI recursively processes all supported files in directories and subdirectories.
Automatically Ignored:
.git, .venv, venvnode_modules__pycache__, dist, build.idea, .vscodeAnalyze any public GitHub repository:
docuai generate https://github.com/username/repo
How it works:
For private repositories:
git clone https://github.com/username/private-repo
cd private-repo
docuai generate .
All commands automatically save results to .md files:
| Command | Default Output |
|---|---|
docuai generate file.py | file_docs.md |
docuai analyze file.py | file_analysis.md |
docuai generate . | dirname_documentation.md |
docuai analyze . | dirname_analysis.md |
Use --output to specify custom filenames.
ValueError: OpenAI API key not found
Solution: Set your API key using one of the methods in Configuration
ValueError: Unsupported file type
Solution: DocuAI only supports .py, .js, .jsx, .ts, .tsx files
No supported files found
Solution: Ensure your directory contains supported file types and isn't in the ignore list
--output to save results to a specific fileContributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by Ayush Jaiswal
If you find DocuAI useful, please consider giving it a ⭐ on GitHub!
FAQs
AI-powered code documentation generator
We found that docuai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Season’s greetings from Socket, and here’s to a calm end of year: clean dependencies, boring pipelines, no surprises.

Research
/Security News
Impostor NuGet package Tracer.Fody.NLog typosquats Tracer.Fody and its author, using homoglyph tricks, and exfiltrates Stratis wallet JSON/passwords to a Russian IP address.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.