A CLI tool to generate commit messages and pull requests using LLM.
Project description
git-scribe
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.
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 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.
Installation
Prerequisites
1. Install git-scribe
You can install the tool directly from this GitHub repository:
pip install git+https://github.com/popyson1648/git-llm.git
(Note: Once published to PyPI, this will become pip install git-scribe)
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
reposcope.
Usage
Creating a Commit
- Stage your files as you normally would (
git add .). - Run the
commitcommand.git-scribewill 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
- Push your feature branch to the remote repository.
- Run the
prcommand.
# 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
- Clone the repository.
- Create a virtual environment and activate it.
- Install the package in editable mode with development dependencies:
pip install -e .[dev]
- Run tests:
pytest
License
This project is licensed under the MIT License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file popyson_git_scribe-0.2.2.tar.gz.
File metadata
- Download URL: popyson_git_scribe-0.2.2.tar.gz
- Upload date:
- Size: 13.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa15d041e94bd0fac1761058a685aa647811ca03bcff2e3b5ddec9817dbbcbee
|
|
| MD5 |
4b07f7c9bcc82ba97d8ef2e4bf33495e
|
|
| BLAKE2b-256 |
cf425247a4782d89957108fca62d29a848b075580e6c117312413bc461733c41
|
File details
Details for the file popyson_git_scribe-0.2.2-py3-none-any.whl.
File metadata
- Download URL: popyson_git_scribe-0.2.2-py3-none-any.whl
- Upload date:
- Size: 15.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a80a7df0d334ac88c38c45291a657a15619ed57496f0b9263504056dd8d3ad52
|
|
| MD5 |
f0429b441bdd73f46267997c11e8f992
|
|
| BLAKE2b-256 |
f4b6bba12bfdf411742e0e8cedae9051cfa2b509bb48a4d0bb52fd0bb606a8d4
|