Skip to content
/ gitt Public

gitt is a CLI tool that simplifies writing commit messages in Git by allowing users to select commit types, choose files, and automatically format messages, promoting clarity and consistency.

License

Notifications You must be signed in to change notification settings

usermp/gitt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

gitt - A CLI for Better Commit Messages with AI Support

gitt is a command-line interface (CLI) tool that helps you write better commit messages by providing a structured workflow, integrating AI for message generation, and offering a user-friendly interactive experience.

Features

  • Interactive file selection with fzf
  • Choose commit types from a predefined list
  • Automatically format commit messages based on selected type
  • Generate commit messages using Cloudflare AI
  • Edit AI-generated messages before finalizing
  • Confirm commit before execution
  • Optional GUI support (via Streamlit, coming soon)

Prerequisites

Make sure you have the following dependencies installed:

  • Git
  • fzf
  • jq – required for AI message generation
  • curl – used to call Cloudflare AI APIs

Installation

  1. Clone the repository:

    git clone https://github.com/usermp/gitt.git
    cd gitt
  2. Install the CLI globally:

    chmod +x install.sh
    ./install.sh

    This will copy the gitt script to /usr/local/bin/.

Configuration

To enable AI commit message generation via Cloudflare AI, you must configure your API credentials:

gitt --config-api

You will be prompted to enter your:

  • CLOUDFLARE_API_TOKEN
  • CLOUDFLARE_ACCOUNT_ID

These will be stored securely in ~/.config/gitt/.env.

Usage

CLI Mode

Run the following command in a Git repository:

gitt

Workflow:

  1. Select files to stage (or [ALL]).

  2. Choose a commit type.

  3. Choose whether to use AI to generate the commit message.

  4. If AI is used:

    • AI suggests a short message.
    • You can edit the suggestion or accept it as-is.
  5. Review the final commit message.

  6. Confirm to execute the commit.

GUI Mode (coming soon)

gitt --gui

Commit Types

Type Description
no type No specific type selected; for minor or unclear changes
feat A new feature
fix A bug fix
chore Routine tasks and maintenance
refactor Code refactoring without functional change
docs Documentation updates
style Code formatting changes (whitespace, etc.)
test Adding or modifying tests
perf Performance improvements
ci Continuous integration changes
build Build system or dependency changes
revert Reverting a previous commit

Example

$ gitt
📁 Select files to stage → fzf interface opens
🔧 Select commit type → e.g., "feat"
🤖 Use AI to generate commit message? [Y/n] → Y
💡 Suggested: Add pagination to product listing
📝 You can now edit the message:
> Add pagination to product listing
✅ Final commit message: [feat] Add pagination to product listing
✔️ Commit created successfully!

Acknowledgments

Inspired by Sina Bayandorian's original gitt project, with added AI integration and usability improvements.

Contributing

Feel free to fork, improve, or suggest features via pull requests or issues.

License

Licensed under the MIT License. See the LICENSE file for more information.

About

gitt is a CLI tool that simplifies writing commit messages in Git by allowing users to select commit types, choose files, and automatically format messages, promoting clarity and consistency.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages