Skip to content
项目

关于

把杂乱的代码仓库打造成求职作品集。生成清晰易读、招聘人员愿意看的 README,以及专业的 Conventional Commits,让 Git 提交历史更显资深。

开发工具

这些数字如何统计

可以做什么

  • Compressed Uploads: Efficiently packages codebases with 70–90% upload size compression to support analyzing larger projects without hitting API size limits.
  • Safe Environment Template Inspection: Securely reads .env.example to extract accurate environment variable requirements and defaults for your documentation, while strictly ignoring .env* secret files.
  • AI CHANGELOG Generator: Analyzes your Git commit history and automatically generates or updates a clean CHANGELOG.md adhering to Keep a Changelog standards out-of-the-box.

实测星标增长

24小时
0
7天
0
15天
0
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

Dokugen: The Smart README Generator

Demo GIF

Overview

Dokugen helps developers automate their documentation workflow by analyzing your codebase and generating exactly what you need. It takes a look at your codebase, figures out what your project does, and then writes a clear, detailed README so you don't have to spend time doing it yourself. It's built to make sure your project always has professional and accurate documentation. No complicated setup is required, just straightforward functionality that keeps your documentation in sync with your actual code.

System Architecture / Design

Dokugen uses a client-server architecture. CLI clients (Python, TypeScript) interact with a backend API server, which then communicates with Gemini AI for README generation and Git commit message creation. User profile data is stored securely in a Supabase database.

flowchart LR
  subgraph Clients["Dokugen Clients"]
    TSCLI["TypeScript CLI"]
    PythonCLI["Python CLI"]
  end

  API["API Server (Node.js Express)"]
  AI["AI Model (Gemini)"]
  DB[("Supabase Database")]

  TSCLI --> API
  PythonCLI --> API
  API --> AI
  API --> DB

  style TSCLI fill:#1f3a60,stroke:#3b82f6,stroke-width:2px,color:#fff
  style PythonCLI fill:#1f3a60,stroke:#3b82f6,stroke-width:2px,color:#fff
  style API fill:#4a1525,stroke:#ec4899,stroke-width:2px,color:#fff
  style AI fill:#5c1d24,stroke:#ef4444,stroke-width:2px,color:#fff
  style DB fill:#022c22,stroke:#10b981,stroke-width:2px,color:#fff

Features

  • Interactive Menu: Run dokugen with no arguments to navigate all tool actions through a console prompt, making it easy to use for new and experienced developers.

    sequenceDiagram
      actor User
      participant CLI as "Dokugen CLI"
      User->>CLI: Run "dokugen"
      CLI->>CLI: Display interactive options
      CLI->>User: Select action (Generate, Update, Commit)
      User->>CLI: Choose an action
      CLI->>CLI: Execute selected command
    
  • Smart Updates: Re-run the generation process without losing your manual modifications. Only auto-generated blocks get updated, ensuring your personalized content remains.

    sequenceDiagram
      actor User
      participant CLI as "Dokugen CLI"
      participant API as "API Server"
      participant AI as "AI Model"
      User->>CLI: Run "dokugen update"
      CLI->>API: Send project data + existing README
      API->>AI: Analyze code and README
      AI->>API: Return updated README sections
      API->>CLI: Send updated content
      CLI->>User: Write merged README.md
    
  • AI-Powered Commits: Automatically stages changes and generates conventional commit messages using AI, based on your staged files. This helps maintain a consistent and clear commit history.

    sequenceDiagram
      actor User
      participant CLI as "Dokugen CLI"
      participant Git as "Local Git"
      participant API as "API Server"
      participant AI as "AI Model"
      User->>CLI: Run "dokugen aic"
      CLI->>Git: Get staged changes (diff)
      CLI->>API: Send diff for analysis
      API->>AI: Request commit message
      AI->>API: Return generated message
      API->>CLI: Send commit message
      CLI->>User: Confirm / Edit message
      User->>CLI: Accept message
      CLI->>Git: Commit changes
    
  • Compressed Uploads: Efficiently packages codebases with 70–90% upload size compression to support analyzing larger projects without hitting API size limits.

  • Safe Environment Template Inspection: Securely reads .env.example to extract accurate environment variable requirements and defaults for your documentation, while strictly ignoring .env* secret files.

  • AI CHANGELOG Generator: Analyzes your Git commit history and automatically generates or updates a clean CHANGELOG.md adhering to Keep a Changelog standards out-of-the-box.

  • Language & Framework Agnostic: Works out of the box with any programming language or framework (JavaScript, TypeScript, Python, Rust, Go, Java, PHP, C++, Django, React, etc.). You don't need Node.js or Python to be the main language of your codebase; simply install the Dokugen CLI globally using Node (npm/pnpm/yarn) or Python (pip/uv) on your system, and run it in any project folder.

Installation

This project is a monorepo. Here's how to get it running:

Prerequisites

  • Node.js: Version 18 or higher
  • pnpm: Recommended package manager (you can also use npm or yarn)
  • Python 3.8+: For the Python CLI client
  • Go 1.24+: For the Go CLI client

Global Setup

  1. Clone the Repository:

    git clone https://github.com/samueltuoyo15/Dokugen.git
    
  2. Navigate to the Project Root:

    cd Dokugen
    
  3. Install All Dependencies: We use a workspace structure with pnpm, so installing at the root handles dependencies for all apps (CLI, Server) at once.

    pnpm install
    # or
    npm install
    # or
    yarn install
    

Or Download Standalone Binary (No Node.js/Python Required)

Experimental: Standalone binaries are currently experimental and unstable. If you run into issues, please use the Node.js or Python packages instead.


Setting up the Server

The server requires environment variables to run.

  1. Navigate to the Server Directory:

    cd apps/server
    
  2. Create a .env file: Create a .env file in the apps/server/ directory and add the following variables. Replace placeholders with your actual keys and URLs.

    PORT=3000
    NODE_ENV=development
    BACKEND_DOMAIN=http://localhost:3000
    OPENAI_API_KEY=your_api_key_here
    OPENAI_BASE_URL=https://api.openai.com/v1 # Or any compatible provider like OpenRouter, DeepSeek
    README_MODEL_NAME=gpt-4o
    COMMIT_MODEL_NAME=gpt-4o-mini
    SUPABASE_CLIENT_URL=your_supabase_url
    SUPABASE_PUBLISHABLE_KEY=your_supabase_publishable_key
    SUPABASE_SECRET_KEY=your_supabase_secret_key
    
  3. Build and Run the Server:

    pnpm run build
    pnpm start
    

    For development, you can use pnpm run dev.

Setting up the Python CLI Client

  1. Navigate to the Python CLI Directory:

    cd apps/cli/clients/python
    
  2. Set Up a Virtual Environment: It's recommended to use a Python virtual environment to manage dependencies.

    python -m venv .venv
    # Activate virtual environment
    # On Windows:
    .venv\Scripts\activate
    # On macOS/Linux:
    source .venv/bin/activate
    
  3. Install in Editable Mode: Install the package and its development dependencies.

    pip install -e .
    

Setting up the TypeScript CLI Client

  1. Navigate to the TypeScript CLI Directory:

    cd apps/cli/clients/typescript
    
  2. Build the Project: Compile the TypeScript code.

    pnpm run build
    
  3. Install Globally:

    pnpm install -g .
    # or link it for development
    pnpm link --global
    

Usage

Dokugen offers an interactive assistant and standalone commands to manage your README files and Git commits.

Interactive Assistant

Simply run dokugen in your project folder to open the interactive setup assistant. From here, you can generate a README, update files, revert backups, or run AI-assisted Git commits.

dokugen

Standalone Commands

Generate README

Scan your project files and create a new README.md.

dokugen generate

To generate a README using a custom template from a public GitHub repository, like this:

dokugen generate --template https://raw.githubusercontent.com/username/repo/main/README.md

Smart Update README

Intelligently rebuilds auto-generated sections (like the tech stack, API details, and file layout) while keeping your custom text, notes, and badges intact.

dokugen update

AI Git Commit (aic)

Analyze your staged files, automatically generate a Conventional Commit message, commit, and optionally push.

dokugen aic

You can also push immediately after committing:

dokugen aic --push

Safety Backup Revert (revert)

Accidentally generated something you didn't like? Restore your previous README instantly from our automatic backup.

dokugen revert

AI CHANGELOG Generator (changelog)

Analyze your Git commit history and automatically generate or update a structured CHANGELOG.md adhering to Keep a Changelog standards.

Note: dokugen changelog works out-of-the-box using Dokugen's server key! Optionally, if you wish to use your own custom OpenRouter key, set OPENROUTER_API_KEY in your environment:

# Windows (PowerShell):
$env:OPENROUTER_API_KEY="your_custom_api_key"

# macOS / Linux / Termux:
export OPENROUTER_API_KEY=your_custom_api_key
dokugen changelog

You can also specify custom version tags or limit the commit search:

dokugen changelog --version-tag v1.2.0 --limit 30

Technologies Used

Category Technology
Monorepo Turborepo
Backend TypeScript, Node.js, Express.js, Supabase
AI Gemini
Client TypeScript, Python, Go
Frontend React, Next.js (likely in future plans or for a web dashboard)
Dev Tools pnpm

Contributing

We welcome contributions to Dokugen! Before contributing, please make sure to read our Contribution Guide (CONTRIBUTION.md).

It covers our basic rules (like no emojis, cleaning up debug logs) and simple setup steps for each app in the repository.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author Info


Badges

License: MIT Open Source Love Maintenance TypeScript Node.js Express.js React Next.js Python Go Supabase Gemini Turborepo pnpm Made in Nigeria

Readme was generated by Dokugen

探索相关项目

加载中…