prai - AI-Powered PR Description Generator
A command-line tool that generates concise pull request descriptions from git diffs using configurable AI providers.

Overview
prai analyzes the differences between two git commits and automatically generates a professional PR description highlighting:
- What changes were made
- Why these changes matter
- Any breaking changes or important notes
Perfect for streamlining your PR workflow and ensuring consistent, informative descriptions.
Installation
Via Cargo
From Source
Configuration
prai supports multiple AI providers through a configuration file. The tool looks for a config file at:
~/.config/prai/config.toml(default location)- Path specified by
PRAI_HOMEenvironment variable +/config.toml ./config.toml(current directory)
Supported Providers
- Anthropic Claude - Requires API key from Anthropic's Console
- OpenAI GPT - Requires API key from OpenAI
- Google Gemini - Requires API key from Google AI Studio
- Ollama - For local models (requires Ollama running locally)
Sample Configuration
Create ~/.config/prai/config.toml with your preferred providers:
= "claude"
[[]]
= "claude"
= "anthropic"
= "2023-06-01"
= "claude-3-sonnet-20240229"
= "your-anthropic-api-key"
= 500
= 0.3
[[]]
= "gpt4"
= "openai"
= "gpt-4"
= "your-openai-api-key"
= "https://api.openai.com/v1"
= 500
= 0.3
[[]]
= "ollama"
= "ollama"
= "http://localhost:11434"
= "codegemma:7b"
[[]]
= "gemini"
= "google"
= "gemini-pro"
= "your-google-api-key"
= "https://generativelanguage.googleapis.com/v1beta"
= 500
= 0.3
Usage
This works great with git-fzf.sh so I would recommend using that. Otherwise this ultimately is just calling git diff under the hood so whatever works for the commit arguments there should work here too.
Options
--exclude, -e: Files to exclude from diff (default::!*.lock)--profile, -p: Provider profile to use (defaults to config default)--config, -f: Path to config file (defaults to~/.config/prai/config.toml)
Examples
Generate a PR description comparing two commits:
Compare specific commit hashes:
Exclude additional files:
Use a specific profile:
Use a custom config file:
Sample Output
## Changes Made
• Implemented user authentication with JWT tokens
• Added password validation and hashing utilities
• Created login/logout API endpoints
## Impact
• Enables secure user sessions across the application
• Provides foundation for role-based access control
## Notes
• Breaking change: `/api/login` now requires email instead of username
• New dependency: `jsonwebtoken` crate added
Requirements
- Git (for generating diffs)
- Rust 1.85+ (for installation)
- API key for your chosen provider (Anthropic, OpenAI, Google) or Ollama running locally
TODO
- Configurable prompt templates
- Additional output formats (JSON, Markdown templates)
License
MIT