Skip to main content

git-scribe

git-scribe logo

PyPI version Python Versions License: MIT

Build Status Code Coverage Powered by Gemini Code style: black

Your AI-powered git assistant for crafting perfect commits and pull requests.

Features • Installation • Usage • Customization • Contributing


git-scribe is a command-line tool that leverages Large Language Models (LLMs) to automatically generate high-quality, conventional commit messages and pull request descriptions. It acts as a smart wrapper around your daily git commands, streamlining your workflow and improving your commit history.

Demo

Demo of git-scribe in action

Features

  • AI-Generated Commit Messages: Automatically generates well-formatted commit messages from your staged changes.
  • AI-Generated Pull Requests: Creates detailed pull request titles and bodies from your branch diffs.
  • Full git commit Compatibility: Supports passthrough of common git commit options like --all and --amend.
  • Full gh pr create Compatibility: Supports common gh pr create options like --reviewer, --label, --milestone, and --draft.
  • Interactive Review & Edit: Always prompts you to review and edit the AI-generated content before any action is taken.
  • Customizable Prompts: Easily customize the AI's behavior by editing simple markdown files.

Installation

Prerequisites

1. Install git-scribe

You can install the tool from PyPI:

pip install popyson-git-scribe

Alternatively, you can install it directly from the GitHub repository for the latest development version:

pip install git+https://github.com/popyson1648/git-scribe.git

2. Initial Setup

After installation, run the init command to create the necessary configuration files:

git-scribe init

This will create a new directory at ~/.config/git-scribe/.

3. Configure API Keys

Open the newly created configuration file at ~/.config/git-scribe/config.toml and add your API keys:

[api_keys]
gemini = "YOUR_GEMINI_API_KEY"
github = "YOUR_GITHUB_PERSONAL_ACCESS_TOKEN"
  • Gemini API Key: Get yours from Google AI Studio.
  • GitHub Personal Access Token: Create one here with repo scope.

Usage

Creating a Commit

  1. Stage your files as you normally would (git add .).
  2. Run the commit command. git-scribe will generate a message for you to review.
git-scribe commit

You can also pass through git commit arguments:

# Commit all tracked files, not just staged ones
git-scribe commit --all

# Amend the previous commit
git-scribe commit --amend

Creating a Pull Request

  1. Push your feature branch to the remote repository.
  2. Run the pr command.
# Create a PR against the 'main' branch
git-scribe pr --base main

Add reviewers, labels, and other attributes just like you would with gh pr create:

git-scribe pr --base main --reviewer <user> --label "bug,enhancement" --draft

Command Reference

git-scribe commit [OPTIONS]

Accepts most standard git commit options, including but not limited to:

  • --all, -a
  • --amend
  • --author=<author>
  • --date=<date>
  • --no-verify

git-scribe pr [OPTIONS]

Accepts the following options, compatible with gh pr create:

  • --base <branch>, -B <branch>
  • --head <branch>, -H <branch>
  • --reviewer <handle>, -r <handle> (can be specified multiple times)
  • --assignee <login>, -a <login> (can be specified multiple times)
  • --label <name>, -l <name> (can be specified multiple times)
  • --milestone <name>, -m <name>
  • --draft, -d

Customization

You can fully customize the AI's tone, language, and output format by editing the prompt files located in ~/.config/git-scribe/.

  • System Prompts (system_*.md): These files instruct the AI on its role and the strict output format it must follow.
  • User Prompts (user_*.md): These files are for you. You can add your own project-specific guidelines, examples, or context to further guide the AI. They are empty by default and can be safely left that way.

Contributing

Contributions are welcome! Please feel free to open an issue or submit a pull request.

Development Setup

We use uv for managing our development environment.

  1. Clone the repository.
  2. Install uv (see official instructions).
  3. Create and activate a virtual environment:
    uv venv
    source .venv/bin/activate
    
  4. Install pre-commit hooks:
    pre-commit install
    
  5. Install the package in editable mode with development dependencies:
    uv pip install -e .[dev]
    
  6. Run tests:
    pytest
    

License

This project is licensed under the MIT License.

Metadata

Release files for popyson-git-scribe 0.2.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for popyson-git-scribe 0.2.6
File Size Uploaded
popyson_git_scribe-0.2.6.tar.gz 14.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for popyson-git-scribe 0.2.6
File Interpreter ABI Platform
popyson_git_scribe-0.2.6-py3-none-any.whl Python 3 none any Details

Total release size: 30.2 kB

Release files / popyson_git_scribe-0.2.6.tar.gz

Download URL popyson_git_scribe-0.2.6.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cbc15d94281c83ca91e5fca266d3cac24e6e48f88205027afffe34311d25d7b7
BLAKE2b-256 checksum
How to use checksums
263e8dfd7483c682ef1b31922ed9af30adadf9958b22db4ee1685f2f7973106a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release files / popyson_git_scribe-0.2.6-py3-none-any.whl

Download URL popyson_git_scribe-0.2.6-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dac37a1a38ebf22b3ee33e5fc1ce8b6ebc4149e2c1fe65f642af6bb2a353c1fb
BLAKE2b-256 checksum
How to use checksums
ec4f9d56efbe512bef411b436003a16bb44ad61d139b6571c0921b3e95c67ecb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.2.6 This release

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page