arpxspace/smartcommit: Enforce the habit of self-documenting code through better commit messages.

smartcommit is an intelligent, AI-powered CLI tool that helps you write semantic, convention commit messages intuitively. It analyzes your commit changes, asks clarifying questions to understand the “why” behind your code, and generates a structured commit message for you.

In the future you will thank you for deciding to use smartcommit,

smartcommit demo

  • AI-powered analysis:Automatically analyzes your step git diff To understand what has changed.
  • interactive question and answer: Asks you specific, relevant questions to gather context that isn’t obvious from the code alone (“why” and “intent”).
  • multi-provider support,
    • OpenAI (GPT-4o):For top-tier accuracy and performance.
    • Olama (Lama 3.1): Run locally and privately for free.
  • traditional commitments: Strictly enforces the conventional commits specification (feat, fix, choreetc.).
  • beautiful tui: A responsive, easy-to-use terminal user interface built with Bubble Tea.
  • Go (1.21 or later)
  • git Installed and available in your PATH.
  • (optional) Olama Install locally if you plan to use a local model.
go install github.com/arpxspace/smartcommit@latest
  1. Clone the repository:

    git clone https://github.com/arpxspace/smartcommit.git
    cd smartcommit
  2. Create binary:

  3. Go to your path (optional):

    mv smartcommit /usr/local/bin/

use instead of git commit

to use smartcommit as your default git commit Run the command:

git config --global alias.ci '!smartcommit'

Or only for this repository:

git config alias.ci '!smartcommit'

Use:

  • To commit with SmartCommit: git ci
  1. Stage your changes,

  2. run smartcommit,

  3. follow tui,

    • first run: You will be asked to select your AI provider (OpenAI or Olama) and configure it.
    • Analysis: AI will analyze your changes.
    • Question: Answer some questions to provide context.
    • Review:AI generates a commit message. You can edit it or confirm to commit it immediately.

If you already know what you want to write, you can select “I already know what to write” From the main menu to open your default Git editor.

SmartCommit stores its configuration in a local file (usually ~/.smartcommit/config.json,

  • OPENAI_API_KEY:If set, SmartCommit can detect this during setup and ask if you want to use it, saving you from having to manually paste it in.

Contributions welcome! Please feel free to submit a pull request.

  1. fork the project
  2. Create your feature branch (git checkout -b feature/AmazingFeature,
  3. Commit your changes (git commit -m 'feat: Add some AmazingFeature',
  4. push the branch (git push origin feature/AmazingFeature,
  5. open a pull request

Distributed under the MIT License. Look LICENSE For more information.



Leave a Comment