Skip to content

txperl/easycommit

Repository files navigation

English | 中文

EasyCommit CLI

A TUI tool for generating AI-powered git commit messages.

Quick Start

Install EasyCommit first:

brew install txperl/tap/easycommit
# or
go install github.com/txperl/easycommit@latest

Then, stage your changes and let EasyCommit generate commit messages:

git add .
easycommit

EasyCommit will auto-detect an available AI backend (Claude Code, Codex, or Cursor Agent) and launch an interactive TUI for composing and selecting commit messages.

Usage

# easycommit -h
Usage: easycommit [flags]

Flags:
  -b, --backend string    AI backend: claude, codex, cursor-agent (default: auto-detect)
  -n, --candidates int    Number of candidates to generate
      --commit            Run git commit with the selected message
      --global            Use global config (~/.config/easycommit/config.yaml)
  -h, --help              Print help
  -l, --language string   Language for commit messages
      --model string      Override AI model
      --no-body           Generate subject only, no body
      --print             Print one AI-generated commit message to stdout and exit (no TUI)
      --trust-config      Trust the config file loaded this run (persist its hash and continue without prompting)
  -v, --version           Print version

Keybindings

Key Action
Tab Next field
Enter / Ctrl+S Submit
Ctrl+G Generate candidates
Ctrl+H Generate with draft as hint
/ k Move up
/ j Move down
Enter Use selected candidate
r Regenerate current candidate
Esc Close candidates drawer
? Toggle help
q / Ctrl+C Quit

Configuration

EasyCommit reads config from YAML files. Config file priority (first found wins):

  1. $XDG_CONFIG_HOME/easycommit/config.yaml
  2. <repo-root>/.easycommit/config.yaml (project-level)
  3. ~/.config/easycommit/config.yaml (global)

All config keys can be overridden via environment variables with the EASYCOMMIT_ prefix (e.g. EASYCOMMIT_BACKEND=claude).

AI Backends

EasyCommit delegates commit message generation to local AI CLI tools. It does not call cloud APIs directly — it invokes the CLI installed on your machine.

Backend CLI Command Config Name Install
Claude Code claude claude docs.anthropic.com
OpenAI Codex codex codex github.com/openai/codex
Cursor Agent cursor-agent cursor-agent cursor.com/docs/cli

When backend is not specified, EasyCommit auto-detects in the order listed above and uses the first available one.

Override the model per backend in config or globally via the --model flag:

easycommit --model sonnet

Security

EasyCommit uses a Trust-on-first-use (TOFU) mechanism for config files. Since a config file can influence the AI prompt and model selection, EasyCommit will prompt you before using an untrusted config:

Option Description
Trust Remember forever (until the file changes)
Once Allow this run only
Review Show file contents before deciding
Reject Abort

Bypass with --trust-config to trust the loaded config this run, or --global to skip project-level configs entirely.

Integrations

Lazygit

Add a custom command to your Lazygit config (config.yml):

customCommands:
  - key: "E"
    context: "files"
    description: "AI commit (easycommit TUI)"
    command: "easycommit --commit"
    output: terminal

Then press E in the Files panel to launch EasyCommit directly within Lazygit.

Build from Source

git clone https://github.com/txperl/easycommit.git
cd easycommit
go build -o easycommit .

License

About

A TUI tool for generating AI-powered git commit messages.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages