English | 中文
A TUI tool for generating AI-powered git commit messages.
Install EasyCommit first:
brew install txperl/tap/easycommit
# or
go install github.com/txperl/easycommit@latestThen, stage your changes and let EasyCommit generate commit messages:
git add .
easycommitEasyCommit will auto-detect an available AI backend (Claude Code, Codex, or Cursor Agent) and launch an interactive TUI for composing and selecting commit messages.
# 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
| 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 |
EasyCommit reads config from YAML files. Config file priority (first found wins):
$XDG_CONFIG_HOME/easycommit/config.yaml<repo-root>/.easycommit/config.yaml(project-level)~/.config/easycommit/config.yaml(global)
All config keys can be overridden via environment variables with the EASYCOMMIT_ prefix (e.g. EASYCOMMIT_BACKEND=claude).
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 sonnetEasyCommit 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.
Add a custom command to your Lazygit config (config.yml):
customCommands:
- key: "E"
context: "files"
description: "AI commit (easycommit TUI)"
command: "easycommit --commit"
output: terminalThen press E in the Files panel to launch EasyCommit directly within Lazygit.
git clone https://github.com/txperl/easycommit.git
cd easycommit
go build -o easycommit .