Co-Pilot
Updated 24 days ago

codegpt

Aappleboy
1.5k
appleboy/codegpt
80
Agent Score

💡 Summary

A CLI tool that generates git commit messages and code review summaries using ChatGPT AI.

🎯 Target Audience

Software developersDevOps engineersProject managersOpen source contributorsTechnical writers

🤖 AI Roast:Powerful, but the setup might scare off the impatient.

Security AnalysisHigh Risk

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

Lint and Testing Security Scanning codecov Go Report Card

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 | 繁體中文 | 简体中文

cover

Table of Contents

flow

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.
  • Allows customization of prompt templates and variables.

code review

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)

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

  2. Change permissions:

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

    mv codegpt /usr/local/bin/
  4. 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:

  1. Detect your OS and architecture
  2. Download the latest binary
  3. 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.

register

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

5-Dim Analysis
Clarity8/10
Novelty8/10
Utility9/10
Completeness8/10
Maintainability7/10
Pros & Cons

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

ccmp

A
toolCo-Pilot
86/ 100

“Powerful, but the setup might scare off the impatient.”

claude-mods

A
toolCo-Pilot
86/ 100

“Powerful, but the setup might scare off the impatient.”

agentic-qe

A
toolCo-Pilot
86/ 100

“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.