Automatically generate and commit changes using copilot
Project description
git-copilot-commit
AI-powered Git commit assistant that generates conventional commit messages using GitHub Copilot.
Features
- Generates commit messages based on your staged changes
- Supports multiple AI models: GPT-4, Claude, Gemini, and more
- Allows editing of generated messages before committing
- Follows the Conventional Commits standard
Installation
Install the tool using uv (recommended)
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 install and run the latest version of tool directly every time by invoking this one command:
# Install latest version into temporary environment and run --help
uvx git-copilot-commit --help
Alternatively, you can install into a global isolated environment and run git-copilot-commit:
# Install into global isolated environment
uv tool install git-copilot-commit
# Run --help to see available commands
git-copilot-commit --help
Install with pipx
If you prefer to use pipx:
pipx install git-copilot-commit
Prerequisites
- Active GitHub Copilot subscription
Quick Start
-
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
-
Make changes in your repository.
-
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
Usage
Commit changes
$ uvx git-copilot-commit commit --help
Usage: git-copilot-commit commit [OPTIONS]
Automatically commit changes in the current git repository.
Options:
-a, --all Stage all files before committing
-m, --model TEXT Model to use for generating commit message
-y, --yes Automatically accept the generated commit message
--help Show this message and exit.
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
Commit Message Format
Follows Conventional Commits:
<type>[optional scope]: <description>
Types:
feat: New featurefix: Bug fixdocs: Documentationstyle: Formatting onlyrefactor: Code restructureperf: Performancetest: Testschore: Maintenancerevert: 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
[!TIP]
Show more context in diffs by running the following command:
git config --global diff.context 3
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file git_copilot_commit-0.4.5.tar.gz.
File metadata
- Download URL: git_copilot_commit-0.4.5.tar.gz
- Upload date:
- Size: 24.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10dee55aca18bd4952a23b0105620dbbef2f0e247b01890fc5b200811c65732e
|
|
| MD5 |
b0884a18a7af8343364933f855deea70
|
|
| BLAKE2b-256 |
f4b12bb4d969c7215867f0d5f7b641df4fc9ef96c29a0ff00bd4ecd225baea94
|
File details
Details for the file git_copilot_commit-0.4.5-py3-none-any.whl.
File metadata
- Download URL: git_copilot_commit-0.4.5-py3-none-any.whl
- Upload date:
- Size: 21.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","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}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50eca7f6a8fe78e5dd364b3cb10697dcfc96d91bc849c52c4560cb7a6a06431f
|
|
| MD5 |
c6c0b8e975201fae936d6de39a11426b
|
|
| BLAKE2b-256 |
4596bef3318fe7e19c97c12800a865a9f256556991f92e96501ac7d3238bfb75
|