Code Wizard is a powerful Command-Line Interface (CLI) tool designed to automate the generation of professional README.md documentation for your software projects. By leveraging advanced AI models like Google Gemini, it intelligently scans your codebase, analyzes its technical details, and synthesizes this information into a comprehensive and structured README.md file, streamlining your documentation workflow.
- Automated Documentation Generation: Quickly create
README.mdfiles for any project. - AI-Powered Code Analysis: Utilizes Google Gemini to understand codebase structure and functionality.
- Intelligent File Scanning: Asynchronously scans specified directories, intelligently ignoring common development and build files/folders.
- Two-Phase AI Interaction: Employs a sophisticated two-step process involving initial technical analysis of code batches followed by synthesis of the final documentation.
- Robust API Handling: Incorporates retry mechanisms for AI API calls to handle rate limits and temporary failures gracefully.
- Environment Variable Management: Easily configure AI API keys and other settings via
.envfiles. - CLI-Driven: User-friendly command-line interface for seamless integration into development workflows.
- Languages: Typescript
- Libraries:
commander: For building robust command-line interfaces.@google/generative-ai: Official SDK for interacting with Google's Gemini AI models.dotenv: To load environment variables from.envfiles.fast-glob: For efficient and powerful file system scanning.
- Node.js Built-ins:
path: For resolving and manipulating file paths.fs: For performing file system operations (reading and writing files).
To install Code Wizard, ensure you have Node.js (v18 or higher recommended) and npm installed.
-
Install the Package:
npm i -g @rishav_maity/code-wizard
Make sure to install it globally to run the necessary commands
-
Set up environment variables: You can manually create a
.envfile, or use the built-ininitcommand (see Usage below) to set it up automatically.
After installation, you can run Code Wizard from the project directory.
-
Initialize Configuration: Run the initialization command to automatically set up your environment variables.
code-wizard init
- If no
.envfile exists, this will create one for you. - If a
.envfile exists but is missing the API key, it will append theGEMINI_API_KEYvariable. - Action Required: After running this, open the
.envfile and paste your actual Google Gemini API key.
- If no
-
Generate a README: To generate a
README.mdfor your current project, navigate to the project's root directory and run:code-wizard generate
This command will scan your code, send it for AI analysis, and then write the generated
README.mdfile in your current working directory.
Documentation generated by Code Wizard