gritch is an AI-powered CLI that helps you write Conventional Commits, generate CHANGELOG.md entries, review staged diffs before you push, and explain commits in plain English. It solves the “blank commit message” problem and streamlines the review + documentation workflow using Groq.
- AI-generated conventional commit messages
- Pre-push code review with scoring
- Automatic CHANGELOG.md generation
- Plain-English commit explanations
- Works in any git repo
- Free to use with Groq API
npm install -g gritch- Get a Groq API key from https://console.groq.com/.
- Set the
GROQ_API_KEYenvironment variable.
Windows PowerShell
$env:GROQ_API_KEY = "your_key_here"macOS / Linux (bash/zsh)
export GROQ_API_KEY="your_key_here"Setting the API key with export (macOS/Linux) or $env (Windows PowerShell) only lasts for the current terminal session. When you close the terminal, the environment variable is lost.
To make GROQ_API_KEY available in every new terminal session:
- Open the Start Menu and search for Environment Variables.
- Click Edit the system environment variables.
- Click the Environment Variables button.
- Under User variables, click New.
- Set the variable name to
GROQ_API_KEY. - Set the variable value to your Groq API key.
- Click OK on all dialogs.
- Restart the terminal.
- Open Terminal.
- Run:
echo 'export GROQ_API_KEY="your_key_here"' >> ~/.zshrc
- Then run:
source ~/.zshrc
- Open Terminal.
- Run:
echo 'export GROQ_API_KEY="your_key_here"' >> ~/.bashrc
- Then run:
source ~/.bashrc
After doing this, gritch will work in any terminal session without needing to set the key again.
Generate a Conventional Commit message from staged changes:
gritch commitReview staged changes before pushing (default language: typescript):
gritch reviewReview staged changes with a specific language:
gritch review --language javascriptGenerate a CHANGELOG.md for a version range:
gritch changelog v1.0.0 v1.1.0Explain what a commit did in plain English:
gritch explain abc123def456{ "model": "llama-3.3-70b-versatile", "maxTokens": 1024, "reviewThreshold": 7, "conventionalCommits": true }
## Built With
- TypeScript
- Node.js
- Groq AI
- LLaMA 3.3
- Commander.js
- simple-git
## License
MIT
## Contributing
Contributions are welcome! Open an issue or submit a pull request—whether it’s bug fixes, new features, or documentation improvements.