💡 Summary
A CLI tool that generates git commit messages and code review summaries using ChatGPT AI.
🎯 Target Audience
🤖 AI Roast: “Powerful, but the setup might scare off the impatient.”
Risk: High. Review: shell/CLI command execution; outbound network access (SSRF, data egress); API keys/tokens handling and storage; filesystem read/write scope and path traversal. Run with least privilege and audit before enabling in production.
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.

Table of Contents
- CodeGPT
- Table of Contents
- Features
- Installation
- Configuration
- Using API Key Helper for Dynamic Credentials
- How to Customize the Default Prompt Folder
- How to Change to Azure OpenAI Service
- Support for Gemini API Service
- 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
- Change Commit Message Template
- 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, orzh-cn). - Supports SOCKS proxy or custom network HTTP proxy.
- Generates brief code reviews.
- Allows customization of prompt templates and variables.

Installation
macOS
Install via Homebrew:
brew tap appleboy/tap brew install codegpt
Windows
Install via Chocolatey:
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 < <(curl -sSL https://raw.githubusercontent.com/appleboy/CodeGPT/main/install.sh)
Or download and run manually:
curl -LO https://raw.githubusercontent.com/appleboy/CodeGPT/main/install.sh chmod +x install.sh ./install.sh
B. Manual Install (Advanced)
-
Download the latest pre-compiled binary from the release page.
-
Change permissions:
chmod 755 codegpt -
Move the binary to your system bin directory:
mv codegpt /usr/local/bin/ -
Confirm installation:
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:
# 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:
- Detect your OS and architecture
- Download the latest binary
- Add the binary to your PATH
From Source
Install from source code:
go install github.com/appleboy/CodeGPT/cmd/codegpt@latest
Using VSCode Devcontainer
Add the feature to your devcontainer.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:
export OPENAI_API_KEY=sk-xxxxxxx
Alternatively, store your API key in a custom config file:
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](https://platform.o
Pros
- Automates commit message generation.
- Supports multiple AI services.
- Customizable templates and settings.
Cons
- Requires API key setup.
- May need additional configuration for advanced features.
- Dependency on external AI services.
Related Skills
claude-mods
A“Powerful, but the setup might scare off the impatient.”
Disclaimer: This content is sourced from GitHub open source projects for display and rating purposes only.
Copyright belongs to the original author appleboy.
