/git-acm

instant commit messages in the terminal using ai.

Primary LanguageRustMIT LicenseMIT

git-acm

Instant commit messages in the terminal powered by OpenRouter

Docs Crates.io Crates.io Total Downloads

installation

curl -sSL https://raw.githubusercontent.com/shivamhwp/git-acm/main/install.sh | sh

to update : just run the installation command, it checks the system for prev version and then installs a new version if there's one.

how to use

  1. ensure git is initialized in the dir. or run git init.
  2. get OpenRouter API key
  3. add it in your project's .env file (preferred) or export it in terminal.
OPENROUTER_API_KEY="your_api_key_here"
  1. run git-acm get-models to fetch available models (run once, stores locally). you can run git-acm list to see the list of the models.
  2. go to openrouter.ai/models, click copy model id. Model selection screenshot
  3. run git-acm use <copied_model_id> to select the model.
  4. stage your changes with git add . or specific files.
  5. just run git-acm to generate and use the commit message(it already gets copied to the clipboard automatically).

📍 commands available

get-models : Fetch and store models from OpenRouter (run occasionally to update).

use <model> : Choose a model.

list : Lists all available models.

autocommit enable/disable : Enables/disables automatic git commit after generation.

run : Generate a commit message (default behavior).

📍 example

git-acm get-models                        # Fetch models (first time)
git-acm list                              # See available models
git-acm use anthropic/claude-sonnet-4.5   # Select model
git-acm autocommit enable                 # Enable auto-commit
git-acm                                   # Generate commit message
git-acm autocommit disable                # Disable auto-commit

Contributing

local development setup

ensure rust is installed on your system . go to https://doc.rust-lang.org/book/ch01-01-installation.html for details.

  1. git clone https://github.com/shivamhwp/git-acm.git
  2. get OpenRouter API key. see .env.example
  3. create .env file at root > set OPENROUTER_API_KEY="your_key".
  4.  cargo build
  5. cargo run -- to get the commit msg in the terminal.
  6. start with main.rs and break stuff.

report 🐞bugs here

bhai(s) : sargam (idea) and smr (suggestions).


config storage ----------------
git-acm-prefs.json (model + autocommit prefs.) and models.json (list of models available) are stored in your OS config directory.

  • macOS: ~/Library/Application Support/git-acm
  • Linux: $XDG_CONFIG_HOME/git-acm
  • Windows: %APPDATA%/git-acm

note ---------------------
This tool sends the staged git diff to OpenRouter to generate a commit message. Review staged changes and avoid including sensitive content.