A terminal UI that automatically generates git commit messages using local language models via Ollama.
Project description
Comet CLI
Comet is a terminal user interface application that automatically generates descriptive git commit messages using local language models (Ollama, LMStudio) or the cloud (OpenRouter). It analyzes your staged git diffs and provides a clean interface to review, edit, regenerate, and commit your changes instantly.
AI commit messages are silently burning through your API limits.
An unoptimized
git diffcan easily consume 15,000+ tokens per request. If an average developer makes 3 commits per hour, a standard 4-hour coding session would blast through over 180,000 tokens!Comet uses only 500 tokens! Saving you roughly 174,000 tokens of unnecessary API costs in the same 4 hours!
Features
- Instant Boot: The UI renders instantly with zero latency, utilizing background threading for network auto-detection and initialization.
- Headless Automation: Run
comet --auto(or-a) to skip the UI entirely and automatically generate, commit, and push in one command. - Terminal User Interface: Built with Textual. It provides a dedicated text area to edit the generated message.
- Git Integration: Commit your changes and immediately push them to your remote repository with a second press of the commit button.
- Model Auto-Selection: Automatically detects the smallest model that can run on your system to minimize token usage and response latency.
- Hotswap Models: Press
tabto quickly cycle through available models directly from the interface. - Local & Cloud Generation: Connects to your local AI servers or the OpenRouter API to generate commit messages.
- Context Aware: Automatically pulls in the last 5 commits to understand your codebase.
- Token Optimization: Actively strips massive metadata from the diff payload, drastically reducing API costs and Time-To-First-Token.
Requirements
- Python 3.10 or higher
- Git installed and accessible in your system path
- Ollama or LMStudio running locally, or an OpenRouter API key
Installation
You can install Comet using standard pip:
pip install cli-comet
However, the recommended way to install Comet is globally using pipx to avoid dependency conflicts with other python packages:
pipx install cli-comet
Installation from Source
Clone the repository and install the required dependencies:
git clone https://github.com/razoring/CometCLI.git
cd CometCLI
python -m venv .venv
# On Windows
.venv\Scripts\activate
# On Unix/macOS
source .venv/bin/activate
pip install -e .
Usage
Ensure you have staged your changes using git add and that Ollama or LMStudio is running in the background.
Run the Comet application:
comet
To bypass the UI and automatically generate, commit, and push your changes in one step:
comet --auto
# or
comet -a
Keyboard Shortcuts
enter: Commit the current text. If pressed again, it will push the commit to the remote repository.tab: Swap the active language model.ctrl+r: Regenerate the commit message with the current model.ctrl+z: Undo the most recent local commit.ctrl+t: Terminate the application.down arrow: Add a new line when at the bottom of the text area.up arrow: Remove the previous empty line.
Architecture
Comet uses the subprocess module to run git commands and capture diffs. It reads the local comet/system.md file for system instructions and sends the diff to the selected provider's API. The interface is built using Textual, providing responsive keyboard bindings and a resilient terminal layout. All blocking network logic runs in an asynchronous @work thread to ensure 0ms UI start latency.
License
This project is licensed under the GNU General Public License v3.0 (GPL-3.0). See the LICENSE file for details.
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 cli_comet-1.2.4.tar.gz.
File metadata
- Download URL: cli_comet-1.2.4.tar.gz
- Upload date:
- Size: 24.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a34db62b8139671569dc5367d582452fc5bce07b189957e924e58d40f9f4c882
|
|
| MD5 |
a207be759893df7965d1a595b36c08e2
|
|
| BLAKE2b-256 |
b809358fe8f7144aa643c8b6d636c61eafa808910af0bdd0eeabc2f6bac05078
|
Provenance
The following attestation bundles were made for cli_comet-1.2.4.tar.gz:
Publisher:
publish.yml on razoring/CometCLI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cli_comet-1.2.4.tar.gz -
Subject digest:
a34db62b8139671569dc5367d582452fc5bce07b189957e924e58d40f9f4c882 - Sigstore transparency entry: 1626903791
- Sigstore integration time:
-
Permalink:
razoring/CometCLI@2401aecc6efaf10f360f3c422669efab6270efc5 -
Branch / Tag:
refs/tags/1.2.4-pre - Owner: https://github.com/razoring
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2401aecc6efaf10f360f3c422669efab6270efc5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file cli_comet-1.2.4-py3-none-any.whl.
File metadata
- Download URL: cli_comet-1.2.4-py3-none-any.whl
- Upload date:
- Size: 24.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b5562494c819f1c3cfb5430397571f0a7672550f38780f843f84d469947bad5
|
|
| MD5 |
c9c349db2cc345af38f5f37bd9e7a102
|
|
| BLAKE2b-256 |
4cd48323577a32608c4c7420694619327fa3ded7953c15e196183b0e015a4506
|
Provenance
The following attestation bundles were made for cli_comet-1.2.4-py3-none-any.whl:
Publisher:
publish.yml on razoring/CometCLI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cli_comet-1.2.4-py3-none-any.whl -
Subject digest:
4b5562494c819f1c3cfb5430397571f0a7672550f38780f843f84d469947bad5 - Sigstore transparency entry: 1626903895
- Sigstore integration time:
-
Permalink:
razoring/CometCLI@2401aecc6efaf10f360f3c422669efab6270efc5 -
Branch / Tag:
refs/tags/1.2.4-pre - Owner: https://github.com/razoring
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2401aecc6efaf10f360f3c422669efab6270efc5 -
Trigger Event:
release
-
Statement type: