An AI enhanced git command line utility
Project description
Gait(g-AI-t): An AI enhanced git command line utility
Table of Contents
Installation
Prerequisites
- Python 3.7 or later (Download from python.org)
python3 --version # Verify Python installation
- Git
git --version # Verify Git installation
- GitHub CLI (for PR features)
- OpenAI (requires API key)
- Linear (requires API key and team ID)
BasicInstallation and Configuration
For macOS:
-
Clone the repository and install:
# Clone the repository git clone https://github.com/EmpyreanTechnologiesInc/gait.git # Navigate to directory and install cd gait pip install -e . # Verify installation gait --version # should display the git version number
-
Configure AI Features
# Find the .env.example file in gait directory # Copy and rename it to .env cp .env.example .env # Open the .env file in your preferred editor nano .env # or vim .env, code .env, etc. # Add your OpenAI API key to .env file OPENAI_API_KEY=your_api_key_here # (Optional) Configure AI model OPENAI_MODEL=gpt-4o-mini # Default model # Test your OpenAI API connection gait test-api # If successful, you'll see: "API connection successful!"
Installing GitHub CLI
For macOS:
# Install Homebrew if you haven't
pip install brew
# Use brew to install GitHub CLI
brew install gh
After installation, authenticate with GitHub:
gh auth login # Follow the prompts to complete the authentication process
Usage
Basic Git Commands
Any git command you know can be used with gait:
# Basic git commands
gait status
gait add .
gait commit -m "your message"
gait push
# All git commands are supported
gait branch -a
gait checkout -b feature/new-branch
gait merge main
Automatically Generate Git Commits with AI
The gait commit --ai command analyzes your staged changes and uses AI to generate a descriptive commit message. This feature helps maintain consistent and informative commit messages across your project.
# Stage your changes first
gait add .
# Generate AI commit message
gait commit --ai
# You'll be prompted to:
# 1. Review the generated message
# 2. Accept (y), reject (n), or edit (e) the message
# 3. Once accepted or edited, 'git commit -m "<message>"' will be executed automatically
AI-Generated Pull Requests
The gait pr create --ai command analyzes your branch changes and uses AI to generate a descriptive pull request title and body. This feature helps create comprehensive and well-structured pull requests. All standard gh pr create options (like --draft, --base, etc.) are supported.
# Make sure your changes are committed and pushed
gait push
# Generate AI pull request
gait pr create --ai # Basic AI-generated PR
# Other options
gait pr create --ai --draft # Create as draft PR
gait pr create --ai --base main # Set target branch
# You'll be prompted to:
# 1. Review the generated PR title and body
# 2. Accept (y), reject (n), or edit (e) the content
# 3. Once accepted or edited, the PR will be created automatically using GitHub CLI
Linear Integration and TODO Processing
When creating a pull request with gait pr create --ai, the tool automatically processes TODO comments in your changes:
-
For new TODOs:
- Creates corresponding Linear issues
- Updates the TODO comment with the Linear issue ID
- Example:
# TODO: Add testsbecomes# TODO(ENG-123): Add tests
-
For removed TODOs:
- Automatically marks the corresponding Linear issue as "Done"
- Example: When you remove
# TODO(ENG-123): Add tests, issue ENG-123 will be marked as completed
# Example TODO comment format:
# TODO:Implement error handling
# TODO(context): Add unit tests
# When creating a PR:
# 1. New TODOs will be converted to Linear issues
# # TODO(ENG-123): Implement error handling
# 2. Removed TODOs will be marked as done in Linear
To use this feature, configure Linear in your .env file:
LINEAR_API_KEY=your_linear_api_key
LINEAR_TEAM_ID=your_team_id
LINEAR_PROJECT_ID=your_project_id
-
Team ID and Project ID can be found on the Linear webpage:
- Press
Cmd/Ctrl + K - Find "Copy model UUID"
- select the ID to copy
- Press
-
API Key can be found in Settings > API
Project Structure
gait/
├── src/
│ └── gait/
│ ├── __init__.py
│ ├── main.py
│ ├── git_wrapper.py
│ ├── github_wrapper.py
│ ├── ai_commit.py
│ ├── ai_pr.py
│ ├── linear_client.py
│ └── utils.py
├── README.md
├── LICENSE
├── setup.py
├── pyproject.toml
├── requirements.txt
├── .gitignore
└── .env.example
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gait_tool-0.1.0.tar.gz.
File metadata
- Download URL: gait_tool-0.1.0.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a8fbd377a841c9528971e5df8118caf5ab4a94106ca20553e7274a1f2281295
|
|
| MD5 |
f4b48698cef02859c3c4696b229eabc9
|
|
| BLAKE2b-256 |
1cf73b5f059328622b8e3e27eb1f9f6ad4f1c8c454efe318a4bef298580398f3
|
File details
Details for the file gait_tool-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gait_tool-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71d5a35c7dd658a55fb652d8ab7432e154d6969222c7a7dceedf20e2aeff385a
|
|
| MD5 |
22f3171301db5507aefa78f8ec242513
|
|
| BLAKE2b-256 |
ff0bd424cc59eb108e4b7abe6f54ce8779e130ac983e89f346fc751d9720d61e
|