Documentation

Table of Contents

Installation

Clone the repository from GitHub and install dependencies:

git clone https://github.com/vaibhava17/docs-generator.git
cd docs-generator
npm install

Quick Start

After installation, set up your environment variables and generate documentation for any GitHub repository:

npm run docs:setup
npm run docs:generate https://github.com/vaibhava17/your-repo

CLI Commands

The tool provides several CLI commands for different operations:

Generate Documentation

npm run docs:generate https://github.com/username/repository

Generate documentation for any GitHub repository

Setup Environment

npm run docs:setup

Interactive setup for environment variables

Build CLI Tool

npm run build:cli

Build the standalone CLI executable

Configuration

Configure the tool using environment variables in your .env file:

.env
# Site Configuration
NEXT_PUBLIC_SITE_URL=https://docs-generator-phi.vercel.app

# AI API Keys (Choose one or both)
OPENAI_API_KEY=your_openai_api_key_here
GEMINI_API_KEY=your_gemini_api_key_here

# Preferred AI Provider (openai or gemini)
PREFERRED_AI=openai

# GitHub Token (for private repositories)
GITHUB_TOKEN=your_github_token_here

Environment Variables:

  • OPENAI_API_KEY - Your OpenAI API key
  • GEMINI_API_KEY - Your Google Gemini API key
  • PREFERRED_AI - Preferred AI provider (openai or gemini)
  • GITHUB_TOKEN - GitHub personal access token for private repositories

API Reference

The tool provides a programmatic API for integration with other applications. Refer to the source code for detailed API documentation.

Troubleshooting

Common issues and their solutions:

  • API key not found: Ensure your environment variables are properly configured
  • Permission denied: Check your GitHub token permissions
  • No source files found: Verify the repository contains supported file types