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
-
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.
Authenticate
$ uvx git-copilot-commit authenticate --help
Usage: git-copilot-commit authenticate [OPTIONS]
Autheticate with GitHub Copilot.
Options:
--help Show this message and exit.
List models
$ uvx git-copilot-commit models --help
Usage: git-copilot-commit models [OPTIONS]
List models available for chat in a table.
Options:
--help Show this message and exit.
Configure
$ uvx git-copilot-commit config --help
Usage: git-copilot-commit config [OPTIONS]
Manage application configuration.
Options:
--set-default-model TEXT Set default model for commit messages
--show Show current configuration
--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
Set and use a default model:
uvx git-copilot-commit config --set-default-model gpt-4o
uvx git-copilot-commit commit
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:
git ai-commit
git ai-commit --all --yes --model claude-3.5-sonnet
Additionally, 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.2.2.tar.gz.
File metadata
- Download URL: git_copilot_commit-0.2.2.tar.gz
- Upload date:
- Size: 21.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
990818b5579391d2491eb812ad7236fe5eb15a1618a2f9c08a300bb66e46703f
|
|
| MD5 |
14027cc262bb3b2782fb82b6a3633a99
|
|
| BLAKE2b-256 |
8e8bd0caecd115c36c20877e1e32c7d651246c69e4bf38fcc468a0c2e2b35bb7
|
File details
Details for the file git_copilot_commit-0.2.2-py3-none-any.whl.
File metadata
- Download URL: git_copilot_commit-0.2.2-py3-none-any.whl
- Upload date:
- Size: 13.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51bc10614ea470d04f7c18d127d34d8c092e0b6a5fb12882854eb0f539b7d8dc
|
|
| MD5 |
2e56c3c9de86f8f29d154df47dee55e3
|
|
| BLAKE2b-256 |
c0e6c7a633a2b4051e09f299ad3cb0e620159f0df76b384a8b8590369d00d58b
|