Skip to main content

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
uvx git-copilot-commit

Or with pip:

pipx install git-copilot-commit

Prerequisites

GitHub Copilot Access: You need an active GitHub Copilot subscription

Quick Start

  1. Authenticate with GitHub Copilot:

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

  3. 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
  1. The tool analyzes your changes
  2. Prompts you to stage files (if needed)
  3. Generates an AI-powered commit message
  4. 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 feature
  • fix: A bug fix
  • docs: Documentation changes
  • style: Code formatting (no logic changes)
  • refactor: Code restructuring (no behavior changes)
  • perf: Performance improvements
  • test: Adding or updating tests
  • chore: Maintenance tasks (tooling, dependencies, etc.)
  • revert: Reverting previous changes

Example Messages:

  • feat(auth): add user authentication with JWT
  • fix(database): handle connection retries properly
  • docs(readme): update installation instructions
  • refactor(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


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.3.tar.gz (22.8 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.3-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for git_copilot_commit-0.1.3.tar.gz
Algorithm Hash digest
SHA256 f9cfa5a344bb40ab6fbdb635328d2e51ed3212e714c88bf125d931e2d1faf0e2
MD5 4823ac7a28a13d916104160e67e19670
BLAKE2b-256 54641fa6a605ccf06eabba857557b6c4dfb9eadbb35599a3ab6f1d0fb6c1c97d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for git_copilot_commit-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0aa457b830ab6536f36afe95a9aa0e1ebcdf02fd777ddfed1586d20944a0a8b0
MD5 14c4e35a4799b6e1065f57e0eaec9cb7
BLAKE2b-256 0a6ed5521b938dc819366fd37d7646d6024497c81ccd1766dd79d9c6887f6b68

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