AI-powered CLI tool for generating git commit messages
Project description
GitK
GitK is a CLI tool built with Python 3.11+ that leverages AI to generate meaningful commit messages based on your staged changes. It uses the OpenRouter provider to select AI models, helping you write better commits effortlessly.
Features
- AI-powered commit message generation from staged diffs
- Support for detailed and concise commit messages
- Customizable commit message templates
- Option to commit changes file-by-file for atomic commits (
--split) - Seamless integration with Git workflows
Installation
pip install gitk
Key Dependencies
- click — for building the CLI interface
- requests - for HTTP requests
- pydantic — for data validation and settings management
- questionary — for interactive CLI prompts (Full list of dependencies is available in requirements.txt)
Usage
gitk commit [OPTIONS] [EXTRA_GIT_FLAGS]...
Generate AI-based commit messages from your staged changes.
Options
- [detailed] Generate a more detailed commit message, useful for complex diffs.
- [yes] Skip confirmation prompts and commit automatically with the generated message.
- [split] Generate and commit messages for each staged file separately for atomic commits.
- [template-file] PATH Use a custom commit message template file with placeholders like {{diff}} and {{instruction}}.
- [template] TEXT Inline template string that overrides the default template.
- [instruction] TEXT Provide additional context or instructions to guide AI when generating messages.
- [EXTRA_GIT_FLAGS] ... Pass extra flags directly to git commit (e.g., --signoff, --amend).
Examples
gitk commit --detailed
gitk commit --split --template-file=my_template.txt
gitk commit --template="Change summary: {{diff}}" --yes
gitk commit --instruction="Write in imperative tense"
Configuration
Before using GitK, run:
gitk init
This will guide you through setting up API keys, selecting AI models, and configuring your commit message templates.
Logging
Errors and important events are logged to:
~/.gitk_config/logs/gitk.log
This helps in troubleshooting without cluttering your CLI output.
Project details
Release history Release notifications | RSS feed
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 gitk-0.1.3.tar.gz.
File metadata
- Download URL: gitk-0.1.3.tar.gz
- Upload date:
- Size: 25.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e66f56a96da5e5c8831ead561d6517ff8db7e1e18f85a5caab30d26cd80ea92c
|
|
| MD5 |
5139ca5b01373577724fe829a909912f
|
|
| BLAKE2b-256 |
6df1c943563f39cb82df7213ce9ed9dc1791fb7c64ecbbbb200a80f5931e4d38
|
File details
Details for the file gitk-0.1.3-py3-none-any.whl.
File metadata
- Download URL: gitk-0.1.3-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a340c7e246efa40cad843ef346b152daaa24cba481e3147dd9b0979913d830b4
|
|
| MD5 |
d464018ba4802d6555a973517884072f
|
|
| BLAKE2b-256 |
828ce376be5eae3da6cf4155e0f4a215f814d1728879bf2c0c0873600ed1b000
|