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.

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 with uv (recommended):

uv tool install git-copilot-commit

Or with pipx:

pipx install git-copilot-commit

Or run directly with uv:

uvx git-copilot-commit --help

Prerequisites

  • Active GitHub Copilot subscription

Quick Start

  1. Authenticate with GitHub Copilot:
git-copilot-commit authenticate
  1. Make changes in your repository.

  2. Generate and commit:

git-copilot-commit commit

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 Rich 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

Examples:

  • feat(auth): add JWT authentication
  • fix(db): retry connection on failure
  • docs(readme): update install steps
  • refactor(utils): simplify date parsing

Git Configuration

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

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

Now you can run:

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

Show more context in diffs:

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.9.tar.gz (21.9 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.9-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for git_copilot_commit-0.1.9.tar.gz
Algorithm Hash digest
SHA256 4ea8c9be8a0e790188314c94c1d6aeeadc5228b6d3a3eb803c6aab6617995b90
MD5 c60bab1fa0534b04f1fda2b56d5197b4
BLAKE2b-256 8aebc8798d10c624f3d53e912f747950c215bd2dab46c0393441c69ded59ff84

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for git_copilot_commit-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 1e0a43a8fcf73afcca16c836e6b7c894fe73fe4e3d4f0581331b141688fe9608
MD5 7fdbfea0f8d1835372ba341322b345f2
BLAKE2b-256 c52d0848f480c8d25abb02779bb9aa26f54361a2d9471e91bd99155240c07208

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