Skip to main content

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.

Screenshot of git-copilot-commit in action

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"

Then install git-copilot-commit:

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

Run the tool using:

git-copilot-commit --help

Alternatively, you can always install and run the latest version of tool directly in one command by using:

# Install latest version into temporary environment and run
uvx 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

  1. Authenticate with GitHub Copilot:

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

  3. Generate and commit:

    git-copilot-commit commit
    
  4. Or, if you want to stage all files before committing use:

    git-copilot-commit commit --all
    

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
  -v, --verbose     Show verbose output
  -m, --model TEXT  Model to use for generating 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:

git-copilot-commit commit --all

Verbose output:

git-copilot-commit commit --verbose

Use a specific model:

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

Set and use a default model:

git-copilot-commit config --set-default-model gpt-4o
git-copilot-commit commit
git-copilot-commit commit --model claude-3.5-sonnet

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:

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

Additionally, show more context in diffs by running the following command:

git config --global diff.context 3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

git_copilot_commit-0.1.13.tar.gz (21.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

git_copilot_commit-0.1.13-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file git_copilot_commit-0.1.13.tar.gz.

File metadata

  • Download URL: git_copilot_commit-0.1.13.tar.gz
  • Upload date:
  • Size: 21.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.0

File hashes

Hashes for git_copilot_commit-0.1.13.tar.gz
Algorithm Hash digest
SHA256 816ad36eccd7304815c3ee78a13e57f4a73b2bb82f3ee5ca2456b5cc9a122d39
MD5 697c327334e6a165eb384cc477bd093b
BLAKE2b-256 7fd22f8ff85350bfe6ae33eea5a3db1bf49d1d1d3326a35050e3864e814dcf56

See more details on using hashes here.

File details

Details for the file git_copilot_commit-0.1.13-py3-none-any.whl.

File metadata

File hashes

Hashes for git_copilot_commit-0.1.13-py3-none-any.whl
Algorithm Hash digest
SHA256 c0c146bc7eea80090b91ed4272b92cf881e2cd9ed87d6c4a7a303cf390e17831
MD5 8f5b25fdd4241c7fe86d12868c75949e
BLAKE2b-256 d35d8bf834626fc4e13847ea1380b8fc36b724bc84baa345a8dedbd5d2fa31e0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page