Automatically generate and commit changes using copilot
Project description
git-copilot-commit
🤖 AI-powered Git commit assistant that automatically generates conventional commit messages using GitHub Copilot.
Features
- AI-Generated Commit Messages: Uses GitHub Copilot to analyze your staged changes and generate conventional commit messages
- Multiple AI Models: Choose from GPT-4, Claude, Gemini, and other available models
- Configurable Defaults: Set a default model to use across all commits
- Message Editing: Edit generated messages using your git-configured editor or commit directly
- Conventional Commits: Follows the Conventional Commits specification
- Rich Output: Beautiful terminal output with syntax highlighting and tables
Installation
Install using uv (recommended):
uv tool install git-copilot-commit
Or with pip:
pipx install git-copilot-commit
Or without installing:
uvx git-copilot-commit --help
Prerequisites
GitHub Copilot Access: You need an active GitHub Copilot subscription
Quick Start
-
Authenticate with GitHub Copilot:
git-copilot-commit authenticate -
Make some changes in your git repository
-
Generate and commit:
git-copilot-commit commit
Usage
commit
Automatically commit changes in the current git repository:
git-copilot-commit commit
Options:
--all, -a: Stage all files before committing--verbose, -v: Show verbose output with file details--model, -m: Specify which AI model to use for generating the commit message
- The tool analyzes your changes
- Prompts you to stage files (if needed)
- Generates an AI-powered commit message
- Offers three choices:
(c)ommit: Commit with the generated message(e)dit: Edit the message in your git-configured editor(q)uit: Cancel the commit
authenticate
Set up authentication with GitHub Copilot:
git-copilot-commit authenticate
models
List available AI models:
git-copilot-commit models
config
Manage application configuration:
# Show current configuration
git-copilot-commit config --show
# Set a default model for all commits
git-copilot-commit config --set-default-model gpt-4o
Examples
Commit all changes with staging prompts:
git-copilot-commit commit --all
Commit with verbose output:
git-copilot-commit commit --verbose
Use a specific AI model:
git-copilot-commit commit --model claude-3.5-sonnet
Set up a default model and use it:
# Set default model once
git-copilot-commit config --set-default-model gpt-4o
# Now all commits will use gpt-4o by default
git-copilot-commit commit
# Override with a different model when needed
git-copilot-commit commit --model claude-3.5-sonnet
Generated Commit Message Format
The tool follows the Conventional Commits specification:
<type>[optional scope]: <description>
Supported Types:
feat: A new featurefix: A bug fixdocs: Documentation changesstyle: Code formatting (no logic changes)refactor: Code restructuring (no behavior changes)perf: Performance improvementstest: Adding or updating testschore: Maintenance tasks (tooling, dependencies, etc.)revert: Reverting previous changes
Example Messages:
feat(auth): add user authentication with JWTfix(database): handle connection retries properlydocs(readme): update installation instructionsrefactor(utils): simplify date parsing logic
Git Configuration
For the best experience with git-copilot-commit, consider adding this alias for the commit command:
# Add a git alias for quick access
git config --global alias.ai-commit "!git-copilot-commit commit"
# Now you can use:
git ai-commit
git ai-commit --model claude-3.5-sonnet
git ai-commit --all --verbose
You can also configure git to show more context in diffs, which can help when reviewing changes:
# Show more context in diffs
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.1.7.tar.gz.
File metadata
- Download URL: git_copilot_commit-0.1.7.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a614b6b99befaf9ef60f14d9b54353d1e2c4442e2938b19f42034fb035d8e051
|
|
| MD5 |
6e2410b2222160544094f2455fbe431d
|
|
| BLAKE2b-256 |
6476871b337e041ea7f0c5489e2d5f074efee582f8086522ec38fa3a1d2cce8b
|
File details
Details for the file git_copilot_commit-0.1.7-py3-none-any.whl.
File metadata
- Download URL: git_copilot_commit-0.1.7-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b1394097027b6bba588fe8725658015cba0f9db9dafb6399e2b15c7b29d8d9d6
|
|
| MD5 |
f16b694e6623e9e4d6f5523091e6a09a
|
|
| BLAKE2b-256 |
87d32649686c78965ade7ea13bfc6c31b0ae726dc97655ff5a5dfcdc0ad56828
|