Skip to content

Rishav05112003/code-wizard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Wizard

License Node.js

Description

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.

Key Features

  • Automated Documentation Generation: Quickly create README.md files 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 .env files.
  • CLI-Driven: User-friendly command-line interface for seamless integration into development workflows.

Tech Stack

  • 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 .env files.
    • 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).

Installation

To install Code Wizard, ensure you have Node.js (v18 or higher recommended) and npm installed.

  1. Install the Package:

    npm i -g @rishav_maity/code-wizard

    Make sure to install it globally to run the necessary commands

  2. Set up environment variables: You can manually create a .env file, or use the built-in init command (see Usage below) to set it up automatically.

Usage

After installation, you can run Code Wizard from the project directory.

  1. Initialize Configuration: Run the initialization command to automatically set up your environment variables.

    code-wizard init
    • If no .env file exists, this will create one for you.
    • If a .env file exists but is missing the API key, it will append the GEMINI_API_KEY variable.
    • Action Required: After running this, open the .env file and paste your actual Google Gemini API key.
  2. Generate a README: To generate a README.md for 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.md file in your current working directory.

Documentation generated by Code Wizard

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published