| Crates.io | ghit |
| lib.rs | ghit |
| version | 0.1.1 |
| created_at | 2025-06-23 20:11:05.61416+00 |
| updated_at | 2025-07-08 04:31:06.377366+00 |
| description | AI-powered Git commit message generator and workflow automation |
| homepage | https://github.com/evisdrenova/ghit |
| repository | https://github.com/evisdrenova/ghit |
| max_upload_size | |
| id | 1723376 |
| size | 76,886 |
https://github.com/user-attachments/assets/6c9f3129-bcfa-4357-a3e7-14422dc163df
ghit is a CLI that uses AI to automatically generate meaningful Git commit messages and streamline your dev workflow.
Download the latest binary for your platform from the releases page:
macOS/Linux:
curl -L https://github.com/evisdrenova/ghit/releases/latest/download/ghit-$(uname -s)-$(uname -m).tar.gz | tar -xz
sudo mv ghit /usr/local/bin/
Windows:
Download ghit-windows.zip from releases and add to your PATH.
git clone https://github.com/evisdrenova/ghit.git
cd ghit
cargo build --release
sudo cp target/release/ghit /usr/local/bin/
cargo install ghit
Create a .ghit.toml file in your home directory (~/.ghit.toml or C:\Users\YourName\.ghit.toml):
model = "gpt-4.1" # any openai model
api_key = "your-openai-api-key-here"
message_level = "normal" # quiet, normal, or verbose
Automatic workflow (most common):
# Auto-stage all changes, generate message, commit, and push
ghit --auto
# Or simply (default behavior)
ghit
Generate message only:
# Generate commit message for staged changes (doesn't commit)
ghit --generate
Stage and generate:
# Add specific files and generate message (doesn't commit)
ghit --stage-and-generate src/main.rs src/lib.rs
# Add all changes and generate message
ghit --stage-and-generate
# Auto-commit only specific files
ghit --auto src/main.rs README.md
# Push to a specific branch
ghit --auto --branch feature-branch
# Stage specific files and generate message
ghit --stage-and-generate src/components/ tests/
| Option | Description | Default |
|---|---|---|
model |
OpenAI model to use (gpt-3.5-turbo, gpt-4, etc.) |
none |
api_key |
Your OpenAI API key | Required |
message_level |
Commit message verbosity (quiet, normal, verbose) |
normal |
Configure in ~/.ghit.toml:
quiet: One-line commit message onlynormal: Subject line + short description (default)verbose: Detailed subject + explanatory bodyMake your changes to any files in your repository
Run ghit:
ghit --auto
Review the generated message:
Generated commit message:
Subject: feat: add user authentication with JWT tokens
Body:
- Implement JWT-based authentication system
- Add login and registration endpoints
- Include middleware for protected routes
- Update user model with password hashing
Create this commit? [Y/n]:
Confirm by pressing Enter or 'y'
Done! Your changes are committed and pushed automatically
ghit analyzes your code changes and generates commit messages that follow best practices:
For a bug fix:
fix: resolve memory leak in image processing
- Fix buffer overflow in resize function
- Add proper cleanup for temporary arrays
- Update error handling for edge cases
For a new feature:
feat: implement dark mode toggle
- Add theme context provider
- Create toggle component with smooth transitions
- Persist user preference in localStorage
- Update all components to support both themes
ghit [OPTIONS] [FILES...]
OPTIONS:
-a, --auto Add files, generate message, commit, and push automatically
-b, --branch <BRANCH> Branch to push to (defaults to current branch)
-g, --generate Only generate commit message for staged changes
-s, --stage-and-generate Add files and generate message (don't commit)
-h, --help Print help message
EXAMPLES:
ghit # Auto-commit all changes (default)
ghit --auto # Same as above
ghit --branch main # Push to specific branch
ghit src/main.rs # Auto-commit specific file
ghit --generate # Just generate message for staged changes
ghit -s src/ tests/ # Stage files and generate message
"No changes found to commit"
git status to see if there are any changes"Failed to load config"
.ghit.toml exists in your home directory (~/.ghit.toml)"OpenAI API error"
gpt-3.5-turbo instead of gpt-4)Permission denied when installing
sudo when copying to /usr/local/bin/Contributions are welcome! Here's how to get started:
git checkout -b feature-nameThis project is licensed under the MIT License - see the LICENSE file for details.
If you find ghit useful, please consider: