Skip to main content

A terminal UI that automatically generates git commit messages using local language models via Ollama.

Project description

Comet CLI

Comet helps you save tokens! Comet is a terminal user interface application that automatically generates descriptive git commit messages using local language models via Ollama or LMStudio. It analyzes your staged git diffs and provides a clean interface to review, edit, regenerate, and commit your changes instantly.

Features

  • Instant Boot: The UI renders instantly with zero latency, utilizing background threading for network auto-detection and initialization.
  • Provider Auto-Detection: Automatically detects whether you are running Ollama or LMStudio locally without requiring configuration, while allowing overrides via the --provider flag.
  • Persistent Settings: Comet remembers your last successfully used provider and model in a settings.json file inside the installation directory, skipping auto-detection on future boot-ups.
  • Local Model Generation: Connects to your local AI servers to generate commit messages entirely privately.
  • Model Swapping: Press tab to cycle through available local models directly from the interface.
  • Context Aware: Automatically pulls in the last 5 commits to understand the tone and style of your project.
  • Terminal User Interface: Built with Textual. It provides a dedicated text area to edit the generated message.
  • Dynamic Newlines: Use the down arrow key on the last line to seamlessly add new lines to your commit message, and the up arrow key to remove them.
  • Quick Undo: Press ctrl+z to instantly undo the last local commit if you need to make changes.
  • Direct Syncing: Commit your changes and immediately push them to your remote repository with a second press of the commit button.
  • Customizable Prompts: The instructions provided to the language model are stored in comet/system.md and can be edited to fit your specific workflow.

Requirements

  • Python 3.10 or higher
  • Git installed and accessible in your system path
  • Ollama or LMStudio installed and running locally

Installation

The recommended way to install Comet is globally using pipx:

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

You can optionally force a specific provider:

comet --provider ollama
comet --provider lmstudio

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

cli_comet-1.2.3.tar.gz (22.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cli_comet-1.2.3-py3-none-any.whl (22.2 kB view details)

Uploaded Python 3

File details

Details for the file cli_comet-1.2.3.tar.gz.

File metadata

  • Download URL: cli_comet-1.2.3.tar.gz
  • Upload date:
  • Size: 22.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cli_comet-1.2.3.tar.gz
Algorithm Hash digest
SHA256 ae4cadb2c1a521c3ec7c9f245824d3399275d48d3df5233d367cae9999591436
MD5 519f71efbc852de558c13a9a19a50130
BLAKE2b-256 fc3a3737fb7d52e04746e264772163d838591013e35959b023bde342e94ac46b

See more details on using hashes here.

Provenance

The following attestation bundles were made for cli_comet-1.2.3.tar.gz:

Publisher: publish.yml on razoring/CometCLI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cli_comet-1.2.3-py3-none-any.whl.

File metadata

  • Download URL: cli_comet-1.2.3-py3-none-any.whl
  • Upload date:
  • Size: 22.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cli_comet-1.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 59e15e7957d78959c7c96c68babed6d36d9a5fef5356267d86e435faf584e20a
MD5 5e3f5fcfc41517ac1e11b3b1e9587df9
BLAKE2b-256 d790f327e288c83ce7d6026b21455458623ee20b7b93c37cdbf6a2175c8fd0e4

See more details on using hashes here.

Provenance

The following attestation bundles were made for cli_comet-1.2.3-py3-none-any.whl:

Publisher: publish.yml on razoring/CometCLI

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page