Skip to main content

gut 🫀

Trust your guts on git — An AI-powered CLI tool that executes git and gh commands from natural language queries.

Transform commands like "add all my changes and commit with a meaningful message" into the exact git commands you need, with AI-powered intelligence and human-in-the-loop validation.

✨ Features

  • 🤖 Natural Language Processing: Describe what you want to do in plain English
  • 🔄 Human-in-the-Loop: Review and approve commands before execution
  • 🎯 Smart Command Selection: Automatically chooses between git and gh commands
  • 📖 Command Explanation: Get clear explanations of what each command does
  • 🎨 Rich Console Interface: Beautiful terminal experience with syntax highlighting

🚀 Quick Start

Installation

Install gut using pip:

pip install gut-ai

Setup

  1. Get a Groq API key
  2. Set your API key as an environment variable:
export GROQ_API_KEY="your_api_key_here"

Or create a .env file in your project directory:

GROQ_API_KEY=your_api_key_here

Usage

Simply run gut and describe what you want to do:

gut-ai

Example interactions:

  • "Add all my current changes to git"
  • "Create a new branch called feature/login"
  • "Push my changes to origin"
  • "Create a pull request"

You can also run gut to check and correct your commands:

gut-ai --command "git commit 'feat: analytics'" --question "Why is my command failing?"

Or to simply explain them:

gut-ai --command "git checkout -b 'feat/analytics'"

Note: You can also use the -c and -q as abbreviated flags.

🔧 Development Setup

Prerequisites

  • uv package manager

Clone and Install

git clone https://github.com/AstraBert/gut
cd gut/
uv sync

Run from Source

uvx --from . gut-ai

🛠️ How It Works

gut uses an AI-powered workflow built with llama-index-workflows that follows these steps:

Gut interface

  1. Command Analysis: Analyzes your natural language input to understand intent
  2. Command Selection: Chooses between git and gh based on your requirements
  3. Parameter Mapping: Determines the specific subcommands and options needed
  4. Explanation Generation: Creates a clear explanation of what the command will do
  5. Human Validation: Shows you the command and explanation for approval
  6. Execution: Runs the command if approved, or restarts the process with your feedback

Gut --command and --question

  1. Command Analysis: Analyzes your command and question, producing an explanation and a potential fix for it.
  2. Human Validation: Shows you the explanation and, if there, the corrected command and waits for approval
  3. Execution: Runs the command if approved, or restarts the process with your feedback

The entire experience runs in a beautiful Rich console interface with structured inputs and outputs using Pydantic models.

📋 Requirements

  • Groq API Key: Required for AI functionality
  • Git: Must be installed and configured
  • GitHub CLI (optional): Required only for GitHub-related commands (gh)

🤝 Contributing

We welcome contributions! Please read our Contributing Guide to get started.

📄 License

This project is licensed under the MIT License.

🙋‍♀️ Support


Made with ❤️ for developers who want to git things done faster

Metadata

Release files for gut-ai 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gut-ai 0.3.1
File Size Uploaded
gut_ai-0.3.1.tar.gz 74.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gut-ai 0.3.1
File Interpreter ABI Platform
gut_ai-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 87.0 kB

Release files / gut_ai-0.3.1.tar.gz

Download URL gut_ai-0.3.1.tar.gz
Size 74.3 kB
Tags Source
SHA-256 checksum
How to use checksums
df5fa44aae7c7faa1abea3ceee9330a130b4b6e2c007584c97c7a92ab7797ad5
BLAKE2b-256 checksum
How to use checksums
252d0989a274c60be0373bd4fde86279cd9eb56ef9351e7d5ab2288092e3b6d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.3

Release files / gut_ai-0.3.1-py3-none-any.whl

Download URL gut_ai-0.3.1-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3931de83ced0945fd1a32324df5cbad81e6c5bc80bd9760de223d6f539c740d6
BLAKE2b-256 checksum
How to use checksums
135b444912065742bec480d30aec4d4cdf7f401cae224499c5f98c41ac071e96
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.3

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page