Skip to main content

git-copilot-commit

CI PyPI License

AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot or any OpenAI-compatible LLM.

Screenshot of git-copilot-commit in action

Features

  • Generates commit messages based on your staged changes
  • Supports GitHub Copilot and OpenAI-compatible /v1/chat/completions, /v1/responses, and /v1/models endpoints
  • Supports multiple LLM models: GPT, Claude, Gemini, local models, and more
  • Allows editing of generated messages before committing
  • Follows the Conventional Commits standard

Installation

Install the tool using uv

Install uv:

# On macOS and Linux.
curl -LsSf https://astral.sh/uv/install.sh | sh

# On Windows.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

You can run the latest version of tool directly every time by invoking this one command:

# Every invocation installs latest version into temporary environment and runs --help
uvx git-copilot-commit --help

Alternatively, you can install the tool once into a global isolated environment and run git-copilot-commit to invoke it:

# Install into global isolated environment
uv tool install git-copilot-commit

# Run --help to see available commands
git-copilot-commit --help

Prerequisites

  • Either an active GitHub Copilot subscription or access to an OpenAI-compatible API endpoint

Quick Start

GitHub Copilot

  1. Authenticate with GitHub Copilot:

    uvx git-copilot-commit authenticate
    

    If your cached GitHub token is revoked or expires, refresh it with:

    uvx git-copilot-commit authenticate --force
    
  2. Make changes in your repository.

  3. Generate and commit:

    uvx git-copilot-commit commit
    # Or, if you want to stage all files and accept the generated commit message, use:
    uvx git-copilot-commit commit --all --yes
    

OpenAI-compatible provider

  1. List models by pointing the CLI at your server's /models endpoint.

    uvx git-copilot-commit models \
      --provider openai \
      --base-url http://127.0.0.1:11434/v1/models
    
  2. Generate and commit by pointing the CLI at the generation endpoint you want to use.

    uvx git-copilot-commit commit \
      --provider openai \
      --base-url http://127.0.0.1:11434/v1/chat/completions \
      --model your-model-id
    

    If your server requires an API key, also pass --api-key ... or set OPENAI_API_KEY.

    OpenAI-compatible generation URLs must end with /chat/completions or /responses. Model listing URLs must end with /models.

Usage

Commit changes

$ uvx git-copilot-commit commit --help

 Usage: git-copilot-commit commit [ARGS]

 Generate commit message based on changes in the current git repository and commit them.

╭─ Parameters ─────────────────────────────────────────────────────────────────╮
│ ALL --all -a --no-all     Stage all files before committing [default: False] │
│ SPLIT --split --no-split  Split staged hunks into multiple commits           │
│                           automatically. Pass --split=N to express a         │
│                           preference for N commits. [default: False]         │
│ MODEL --model -m          Model to use for generating commit message         │
│ YES --yes -y --no-yes     Automatically accept the generated commit message  │
│                           [default: False]                                   │
│ CONTEXT --context -c      Optional user-provided context to guide commit     │
│                           message [default: ""]                              │
│ DISABLE-THINKING          Disable or minimize reasoning/thinking tokens for  │
│   --disable-thinking      commit-message requests. [default: True]           │
│   --enable-thinking                                                          │
│ MAX-TOKENS --max-tokens   Maximum output tokens for LLM generation.          │
│                           [default: 1024]                                    │
│ PROVIDER --provider       LLM provider to use: copilot or openai.            │
│ BASE-URL --base-url       Endpoint URL for an OpenAI-compatible provider,    │
│                           for example                                        │
│                           http://127.0.0.1:11434/v1/chat/completions.        │
│ API-KEY --api-key         API key for an OpenAI-compatible provider. Omit    │
│                           when the server does not require one.              │
│ CA-BUNDLE --ca-bundle     Path to a custom CA bundle (PEM)                   │
│ INSECURE --insecure       Disable SSL certificate verification. [default:    │
│   --no-insecure           False]                                             │
│ NATIVE-TLS --native-tls   Use the OS's native certificate store via          │
│   --no-native-tls         'truststore' for httpx instead of the Python       │
│                           bundle. Ignored if --ca-bundle or --insecure is    │
│                           used. [default: True]                              │
╰──────────────────────────────────────────────────────────────────────────────╯

Examples

Commit all changes:

uvx git-copilot-commit commit --all

Accept the generated commit message without editing:

uvx git-copilot-commit commit --yes

Use a specific model:

uvx git-copilot-commit commit --model claude-3.5-sonnet

Use a local OpenAI-compatible server:

uvx git-copilot-commit commit \
  --provider openai \
  --base-url http://127.0.0.1:11434/v1/chat/completions \
  --model your-model-id

Example with openai/gpt-oss-120b and Qwen/Qwen3.6-35B-A3B:

uvx git-copilot-commit commit \
  --provider openai \
  --base-url http://example.com:8001/v1/chat/completions \
  --model openai/gpt-oss-120b

uvx git-copilot-commit commit \
  --provider openai \
  --base-url http://example.com:8002/v1/chat/completions \
  --model Qwen/Qwen3.6-35B-A3B

Use the Responses API endpoint:

uvx git-copilot-commit commit \
  --provider openai \
  --base-url http://example.com:8002/v1/responses \
  --model your-model-id

Increase the output token budget:

uvx git-copilot-commit commit --max-tokens 4096

Thinking/reasoning is disabled or minimized by default for commit-message requests. To let the selected model use its default thinking behavior, pass:

uvx git-copilot-commit commit --enable-thinking

TLS uses the operating system's native certificate store by default. To use Python's default certificate bundle instead, pass:

uvx git-copilot-commit commit --no-native-tls

Split staged hunks into separate commits:

uvx git-copilot-commit commit --split

Prefer two commits:

uvx git-copilot-commit commit --split 2

Commit Message Format

Follows Conventional Commits:

<type>[optional scope]: <description>

Types:

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation
  • style: Formatting only
  • refactor: Code restructure
  • perf: Performance
  • test: Tests
  • chore: Maintenance
  • revert: Revert changes

Git Configuration

Add a git alias by adding the following to your ~/.gitconfig:

[alias]
    ai-commit = "!f() { uvx git-copilot-commit commit $@; }; f"

Now you can run to review the message before committing:

git ai-commit

Alternatively, you can stage all files and auto accept the commit message and specify which model should be used to generate the commit in one CLI invocation.

git ai-commit --all --yes --model claude-3.5-sonnet

You can also set provider defaults with environment variables:

export GIT_COPILOT_COMMIT_PROVIDER=openai
export GIT_COPILOT_COMMIT_BASE_URL=http://127.0.0.1:11434/v1/chat/completions
export GIT_COPILOT_COMMIT_API_KEY=...
export OPENAI_API_KEY=...
git ai-commit --provider openai --model your-model-id

For example:

export GIT_COPILOT_COMMIT_PROVIDER=openai
export GIT_COPILOT_COMMIT_BASE_URL=http://example.com:8001/v1/chat/completions
git ai-commit --model openai/gpt-oss-120b

Metadata

Release files for git-copilot-commit 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-copilot-commit 0.8.0
File Size Uploaded
git_copilot_commit-0.8.0.tar.gz 68.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for git-copilot-commit 0.8.0
File Interpreter ABI Platform
git_copilot_commit-0.8.0-py3-none-any.whl Python 3 none any Details

Total release size: 113.5 kB

Release files / git_copilot_commit-0.8.0.tar.gz

Download URL git_copilot_commit-0.8.0.tar.gz
Size 68.3 kB
Tags Source
SHA-256 checksum
How to use checksums
789cb62718ff96d6d04b647b2925f0ecd4f51e30c982381b0091ea383cad908b
BLAKE2b-256 checksum
How to use checksums
324faf577164391d2ee6b98e8184a19b98e7d06bb2adbcb611f131e784165420
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / git_copilot_commit-0.8.0-py3-none-any.whl

Download URL git_copilot_commit-0.8.0-py3-none-any.whl
Size 45.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
06e1ba117751d8571a40e3a22f9ced246ca53383b04c089dd025b1473250eaa5
BLAKE2b-256 checksum
How to use checksums
c45fa3bf32be4d3cca15471e46eebbc11316948fdb3a690b8cb144842431f543
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.8.0 This release

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.7

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.20

2 release files

0.1.19

2 release files

0.1.18

2 release files

0.1.17

2 release files

0.1.16

2 release files

0.1.15

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page