Skip to main content

Add your description here

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gut_ai-0.3.1.tar.gz (74.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gut_ai-0.3.1-py3-none-any.whl (12.7 kB view details)

Uploaded Python 3

File details

Details for the file gut_ai-0.3.1.tar.gz.

File metadata

  • Download URL: gut_ai-0.3.1.tar.gz
  • Upload date:
  • Size: 74.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for gut_ai-0.3.1.tar.gz
Algorithm Hash digest
SHA256 df5fa44aae7c7faa1abea3ceee9330a130b4b6e2c007584c97c7a92ab7797ad5
MD5 cb0702d82233a08de32ead260b3eb0ed
BLAKE2b-256 252d0989a274c60be0373bd4fde86279cd9eb56ef9351e7d5ab2288092e3b6d9

See more details on using hashes here.

File details

Details for the file gut_ai-0.3.1-py3-none-any.whl.

File metadata

  • Download URL: gut_ai-0.3.1-py3-none-any.whl
  • Upload date:
  • Size: 12.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.3

File hashes

Hashes for gut_ai-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3931de83ced0945fd1a32324df5cbad81e6c5bc80bd9760de223d6f539c740d6
MD5 9d53dbc7913a83fb9e185d4715fb8d49
BLAKE2b-256 135b444912065742bec480d30aec4d4cdf7f401cae224499c5f98c41ac071e96

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page