Stage all changes and generate a conventional commit message with OpenAI
gpt-5.6-terra in one command.
git add -A && git diff --staged | english | git commit -F -The implementation is a native Rust binary. It preserves the original CLI, terminal output, Git synchronization behavior, hooks, token estimate, fireworks, and Star Wars stream.
- Generates a concise, single-line conventional commit message
- Preserves an existing partial staged patch across pull/rebase synchronization
- Resolves upstream, push remote, and first-push branches
- Runs Husky pre-commit hooks unless
--no-verifyis set - Excludes lock files and environment files from the prompt
- Counts input tokens and estimates cost locally
- Embeds the original
firew0rksanimation frames in the binary
Requirements: a current Rust toolchain, Git, and Node.js only for the npm development commands.
git clone https://github.com/preynal/git-ai
cd git-ai
npm install
npm run buildExport the OpenAI API key:
export OPENAI_API_KEY="your-api-key"For compatibility with the previous setup, the binary also reads .env from
the project directory. GIT_AI_ENV_FILE can point to another dotenv file.
Point the alias directly to the release binary built inside the clone:
[alias]
ai = "!/absolute/path/to/git-ai/target/release/git-ai"Then run this from any Git repository:
git aiThis path starts the Rust executable directly; Node.js is not involved at
runtime. The previous !node /path/to/git-ai/git-ai.js alias remains supported
as a compatibility fallback.
To update the tool later:
git pull --rebase
npm run buildThe alias does not need to change because Cargo replaces the release binary at the same path.
-s, --staged Use already staged files without modifying the staged area
-p, --push Accept immediately and push
-n, --no-verify Skip manual, commit, and push hooks
-f, --fireworks Play fireworks after completion
--star-wars Stream Star Wars after completion (-sw)
Without --push, press Enter to accept the generated message or any other key
to cancel.
cargo build
cargo fmt -- --check
cargo clippy --all-targets -- -D warnings
npm testnpm test keeps the historical end-to-end harness and routes it through the
Rust binary using the small git-ai.js compatibility launcher. The native
binary itself has no Node.js runtime dependency.
Core configuration lives in rust/config.rs.
MIT. See THIRD_PARTY_NOTICES.md for the embedded terminal animation.