Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

CodeGPT

> AI 编程
Open source

A CLI written in Go language that writes git commit messages or do a code review brief for you using ChatGPT AI (gpt-4.1, gpt-4o model) and automatically instal

1.5K stars0 likes1 views
WebsiteGitHub

About

A CLI written in Go language that writes git commit messages or do a code review brief for you using ChatGPT AI (gpt-4.1, gpt-4o model) and automatically instal

CodeGPT

A CLI tool written in Go that generates git commit messages or provides code review summaries using ChatGPT AI (gpt-5, gpt-4o, gpt-4 model). It also automatically installs a git prepare-commit-msg hook.

  • 繁體中文介紹
  • 繁體中文影片

English | 繁體中文 | 简体中文

Table of Contents

  • CodeGPT
    • Table of Contents
    • Features
    • Installation
      • macOS
      • Windows
      • Install via Script or Binary
        • A. Automated Install (Recommended)
        • B. Manual Install (Advanced)
        • Configurable Environment Variables
      • From Source
      • Using VSCode Devcontainer
    • Configuration
      • Using API Key Helper for Dynamic Credentials
        • Setup API Key Helper
        • Configure Refresh Interval
        • Gemini-Specific API Key Helper
        • How It Works
        • Priority Order
      • How to Customize the Default Prompt Folder
      • How to Change to Azure OpenAI Service
      • Support for Gemini API Service
        • Configuration Options
        • Example: Gemini API (default backend)
        • Example: VertexAI Gemini
      • Support for Anthropic API Service
      • How to Change to Groq API Service
      • How to Change to Ollama API Service
      • How to Change to OpenRouter API Service
    • Usage
      • CLI Mode
    • Change Commit Message Template
      • Git Hook
        • Install
        • Uninstall
      • Code Review
    • Testing
    • Star History
    • Reference

Features

  • Supports Azure OpenAI Service, OpenAI API, [Gemini][60], [Anthropic][100], [Ollama][41], [Groq][30], and [OpenRouter][50].
  • Adheres to the conventional commits specification.
  • Integrates with Git prepare-commit-msg Hook, see the Git Hooks documentation.
  • Allows customization of generated diffs by specifying the number of context lines (default: 3).
  • Enables file exclusion patterns for git diff operations.
  • Translates commit messages into other languages (supports en, zh-tw, or zh-cn).
  • Supports SOCKS proxy or custom network HTTP proxy.
  • Generates brief code reviews.
  • Supports streaming output for real-time token display.
  • Allows customization of prompt templates and variables.

Installation

macOS

Install via Homebrew:

bash
brew tap appleboy/tap
brew install codegpt

Windows

Install via Chocolatey:

bash
choco install codegpt

Install via Script or Binary

For most systems, you can use an install script or manually download a pre-compiled binary.

A. Automated Install (Recommended)

Run the install script to automatically download and set up the latest release:

bash
bash < <(curl -sSL https://raw.githubusercontent.com/appleboy/CodeGPT/main/install.sh)

Or download and run manually:

bash
curl -LO https://raw.githubusercontent.com/appleboy/CodeGPT/main/install.sh
chmod +x install.sh
./install.sh

B. Manual Install (Advanced)

  1. Download the latest pre-compiled binary from the release page.

  2. Change permissions:

    bash
    chmod 755 codegpt
  3. Move the binary to your system bin directory:

    bash
    mv codegpt /usr/local/bin/
  4. Confirm installation:

    bash
    codegpt version

Configurable Environment Variables

Variable Name Default Value Description
VERSION latest The CodeGPT version to install (defaults to latest release)
INSTALL_DIR $HOME/.codegpt/bin Installation directory
INSECURE unset (disabled) If set to any value, skips SSL verification. Enabled when variable is present

Example usage:

bash
# Install with insecure mode enabled (ignoring curl SSL verification):
INSECURE=1 ./install.sh

# Install a specific version to a custom directory:
VERSION=1.1.0 INSTALL_DIR=/opt/codegpt ./install.sh

The script will:

  1. Detect your OS and architecture
  2. Download the latest binary
  3. Add the binary to your PATH

From Source

Install from source code:

bash
go install github.com/appleboy/CodeGPT/cmd/codegpt@latest

Using VSCode Devcontainer

Add the feature to your devcontainer.json:

json
"features": {
    "ghcr.io/kvokka/features/codegpt:1": {}
}

Configuration

First, create your OpenAI API Key. The OpenAI Platform allows you to generate a new API Key.

Set the environment variable OPENAI_API_KEY:

bash
export OPENAI_API_KEY=sk-xxxxxxx

Alternatively, store your API key in a custom config file:

bash
codegpt config set openai.api_key sk-xxxxxxx

This will create a .codegpt.yaml file in your home directory ($HOME/.config/codegpt/.codegpt.yaml). The following options are available:

Option Description
openai.base_url Replace the default base URL (https://api.openai.com/v1).
openai.api_key Generate API key from openai platform page.
openai.api_key_helper Shell command to dynamically generate API key (e.g., from password manager or secret service).
openai.api_key_helper_refresh_interval Interval in seconds to refresh credentials from api_key_helper (default: 900 seconds / 15 minutes). Set to 0 to disable caching.
openai.org_id Identifier for this organization sometimes used in API requests. See organization settings. Only for openai service.
openai.model Default model is gpt-4o, you can change to other custom model (Groq or OpenRouter provider).
openai.proxy HTTP/HTTPS client proxy.
openai.socks SOCKS client proxy.
openai.timeout Default HTTP timeout is 10s (ten seconds).
openai.skip_verify Default skip_verify is false, You can change it to true to ignore SSL verification.
openai.max_tokens Default max tokens is 300. See reference max_tokens.
openai.temperature Default temperature is 1. See reference temperature.
git.diff_unified Generate diffs with <n> lines of context, default is 3.
git.exclude_list Exclude file from git diff command.
openai.provider Default service provider is openai, you can change to azure.
output.lang Default language is en and available languages zh-tw, zh-cn, ja.
openai.top_p Default top_p is 1.0. See reference top_p.
openai.frequency_penalty Default frequency_penalty is 0.0. See reference frequency_penalty.
openai.presence_penalty Default presence_penalty is 0.0. See reference presence_penalty.
openai.stream Enable streaming output for real-time token display, default is false.
prompt.folder Default prompt folder is $HOME/.config/codegpt/prompt.

Using API Key Helper for Dynamic Credentials

Instead of storing your API key directly in the config file, you can use a shell command to dynamically retrieve it from a password manager or secret service. This is especially useful for:

  • Fetching keys from password managers (1Password, Bitwarden, etc.)
  • Using cloud secret services (AWS Secrets Manage

Issues· 12 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gochatgptchatgpt-apigitgit-hook

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
CategoryAI 编程
PricingOpen source

> Related tools

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.