Documentation Maker Extension
A VS Code extension that automatically generates comprehensive documentation for your codebase using Gemini AI.
Features
- Project Structure Analysis: Creates a summary of your project's file organization
- File Relationship Documentation: Maps dependencies between files, showing how modules connect
- Individual File Documentation: Generates detailed docs for each file including purpose, functions, and examples
- Change-Based Updates: Only updates documentation for files that have changed since last commit
- AI-Powered: Uses Google's Gemini 1.5 Pro to create intelligent, context-aware documentation
Setup Instructions
Installation
Local Development
- Clone the repository
- Run
npm install to install dependencies
- Run
npm run compile to compile TypeScript to JavaScript
- Press F5 to start debugging the extension in a new VS Code window
From VSIX
- Build the VSIX package with
vsce package
- In VS Code, go to Extensions view (Ctrl+Shift+X)
- Click on "..." (More Actions) and select "Install from VSIX..."
- Navigate to and select the generated .vsix file
Initial Configuration
- After installing, you'll be prompted to enter your Gemini API key
- If not prompted, open Command Palette (Ctrl+Shift+P) and run:
Documentation Maker: Initial Setup
- Get a Gemini API key from Google AI Studio
- Enter the API key when prompted
Generate Documentation
- Open a project folder in VS Code
- Use Command Palette to run
Documentation Maker: Initial Setup
- The extension will:
- Analyze your project structure
- Create file relationship diagrams
- Generate documentation for individual files
- All documentation is saved to a
code-docs folder in your project root
Update Documentation
After making changes to your codebase:
- Use Command Palette to run
Documentation Maker: Update Documentation
- Only files changed since the last commit will be updated
Keyboard Shortcuts
- Initial Setup:
Ctrl+Alt+D I (Mac: Cmd+Alt+D I )
- Update Documentation:
Ctrl+Alt+D U (Mac: Cmd+Alt+D U )
Troubleshooting
Commands Not Found
If you can't find the extension commands:
- Make sure you have an active workspace folder open
- Reload VS Code window (Command Palette:
Developer: Reload Window )
- Check the Output panel (View > Output) and select "Documentation Maker"
API Key Issues
- You can manually set your API key in VS Code settings:
- File > Preferences > Settings
- Search for "Documentation Maker"
- Enter your Gemini API key
Compilation Issues
If developing the extension:
- Make sure TypeScript is installed:
npm install -g typescript
- Check for errors with
npm run compile
- Look at the terminal output for any TypeScript errors
Git Integration Issues
The "Update Documentation" feature requires Git:
- Ensure Git is installed and in your PATH
- Make sure your project is a Git repository
- At least one commit must exist in the repository
Requirements
- VS Code 1.60.0 or newer
- Node.js and npm (for development)
- Git (for the update documentation feature)
- Gemini API key
Extension Settings
doc-maker.geminiApiKey : Your Gemini API key for AI-powered documentation generation
Development
This extension is written in TypeScript. To contribute:
- Fork the repository
- Make your changes in the
src directory
- Run
npm run compile to compile TypeScript files
- Test your changes with F5
- Submit a pull request
Project Structure
src/extension.ts : Main extension source code
out/extension.js : Compiled JavaScript (generated, don't edit)
package.json : Extension manifest
.vscodeignore : Files excluded from the extension package
License
MIT
Credits
Developed by Akshay Chame
| |