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
gitandghcommands - 📖 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
- Get a Groq API key
- 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
-cand-qas 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
- Command Analysis: Analyzes your natural language input to understand intent
- Command Selection: Chooses between
gitandghbased on your requirements - Parameter Mapping: Determines the specific subcommands and options needed
- Explanation Generation: Creates a clear explanation of what the command will do
- Human Validation: Shows you the command and explanation for approval
- Execution: Runs the command if approved, or restarts the process with your feedback
Gut --command and --question
- Command Analysis: Analyzes your command and question, producing an explanation and a potential fix for it.
- Human Validation: Shows you the explanation and, if there, the corrected command and waits for approval
- 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
- 🐛 Bug Reports: Open an issue
- 💡 Feature Requests: Start a discussion
- 📧 Questions: Check existing issues and discussions
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| gut_ai-0.3.1.tar.gz | 74.3 kB | Without provenance | Details for gut_ai-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| gut_ai-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for gut_ai-0.3.1-py3-none-any.whl |
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
|
Security for gut-ai 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.