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.
- 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 commitCompatibility: Supports passthrough of commongit commitoptions like--alland--amend. - Full
gh pr createCompatibility: Supports commongh pr createoptions 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.
You can install the tool from PyPI:
pip install popyson-git-scribeAlternatively, you can install it directly from the GitHub repository for the latest development version:
pip install git+https://github.com/popyson1648/git-scribe.gitAfter installation, run the init command to create the necessary configuration files:
git-scribe initThis will create a new directory at ~/.config/git-scribe/.
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
reposcope.
- Stage your files as you normally would (
git add .). - Run the
commitcommand.git-scribewill generate a message for you to review.
git-scribe commitYou 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- Push your feature branch to the remote repository.
- Run the
prcommand.
# Create a PR against the 'main' branch
git-scribe pr --base mainAdd reviewers, labels, and other attributes just like you would with gh pr create:
git-scribe pr --base main --reviewer <user> --label "bug,enhancement" --draftAccepts most standard git commit options, including but not limited to:
--all,-a--amend--author=<author>--date=<date>--no-verify
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
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.
Contributions are welcome! Please feel free to open an issue or submit a pull request.
We use uv for managing our development environment.
- Clone the repository.
- Install
uv(see official instructions). - Create and activate a virtual environment:
uv venv source .venv/bin/activate - Install pre-commit hooks:
pre-commit install
- Install the package in editable mode with development dependencies:
uv pip install -e .[dev]
- Run tests:
pytest
This project is licensed under the MIT License.

