AI Git Commit CLI

Turn messy Git diffs into clean atomic commits.

Smartcommit is an AI Git commit CLI that groups related changes, splits diffs into logical commits, and helps you generate clearer commit messages from the terminal.

npm install -g @jccm6/smartcommit-cli
See how it works

Free to use. Bring your own API key. Works across macOS, Windows, and Linux.

bash

100% Free • Bring Your Own Key

No subscriptions, no hidden fees. You use your own API keys, meaning you only pay the provider directly for what you use.

Local and Secure by Default

Stores preferences in .smartcommitrc and keeps your API credentials safely managed in your OS keychain.

Multiple AI Providers

Seamless support for OpenAI, Anthropic, xAI, and Codex CLI (Local ChatGPT sessions).

How it works

From messy diff to logical commit plan in three steps

Smartcommit is built for developers who want atomic commits without wasting time in manual staging. It keeps your workflow in the terminal and adds an AI commit planning layer on top of Git.

01

Analyze the current diff

Run smartcommit plan and let the CLI inspect the changes currently in your working tree.

02

Group changes by intent

The AI provider proposes logical commit boundaries so refactors, fixes, and features do not end up mixed together.

03

Preview and accept

Review the plan, accept the grouped commits, and keep a cleaner, more understandable Git history.

Security

Secure and flexible configuration for real developer workflows

smartcommit init stores local preferences in .smartcommitrc, but keeps your API keys secure. Credentials are automatically managed in your OS keychain (Apple Keychain, Windows Credential Manager, or Linux Secret Service).

Supported Providers

  • OpenAI
  • Anthropic
  • xAI
  • Codex CLI
  • More coming soon...
Terminal
$ smartcommit providers
Available providers:
  openai (active)
  anthropic
  codex-cli
$ _

Commit planning

Use AI to split Git diffs into meaningful atomic commits

Run smartcommit plan to read the current Git diff. It asks the configured AI provider for structured atomic commit suggestions and renders an interactive preview.

It can intelligently split different hunks from the same file into separate logical commits, helping you avoid noisy history and manual `git add -p` sessions.

smartcommit plan
$ smartcommit plan
Analyzing current Git diff...
Generating atomic commits via AI...
feat add anthropic provider support
2 files changed (+45, -2)
fix fallback to auth.json if keychain fails
1 file changed (+12, -4)
[Enter] Accept & Commit [Esc] Cancel

Use cases

Made for developers who need cleaner history with less staging friction

Split mixed changes before review

Separate fixes, refactors, and feature work into logical commits before opening a pull request.

Generate better commit messages

Keep commit history consistent with clearer summaries and conventional commit-friendly suggestions.

Avoid manual hunk management

Reduce time spent in interactive staging when a diff contains several unrelated logical changes.

Keep local workflows intact

Stay in the CLI, bring your own AI provider, and use Smartcommit without changing the way your team already works with Git.

Safety

A safety net for the last Smartcommit run

Made a mistake? smartcommit undo removes only the commits created by the latest accepted plan and restores their changes to the working tree safely.

Undo metadata is stored locally and never added to your repository history.

smartcommit undo

$ smartcommit undo
Locating latest smartcommit run...
Undoing 2 commits:
  - feat: add anthropic provider support
  - fix: fallback to auth.json

✔ Success: Changes restored.
$ _

FAQ

Common questions about Smartcommit

What is Smartcommit?

Smartcommit is an AI Git commit CLI that turns a messy diff into a preview of logical atomic commits before you create them.

How is it different from manual staging?

Instead of manually picking hunks one by one, Smartcommit proposes commit boundaries based on the intent of the changes in your diff.

Does it support conventional commits?

Yes. Smartcommit is well suited for conventional commit workflows because it helps separate changes into clearer units with stronger commit summaries.

Is Smartcommit free?

Yes. Smartcommit is free to use. You bring your own provider API key and pay the provider directly when applicable.

Ready to stop fighting with Git staging?

Install the free AI Git commit CLI globally and start building cleaner commit history faster.

npm install -g @jccm6/smartcommit-cli