Opinionated CLI utility to generate pull request summaries from commit history and issue trackers.
Good PR summaries save time. They provide context that code alone cannot. By clearly stating the "Why", "What", and "How" of your PR, reviewers can quickly understand the context.
A generated summary follows an opinionated three-section format:
- Why: The business or technical reason for the change, often linked to an issue tracker ticket.
- What: A concise description of the functional changes, optionally generated by AI.
- How: A bulleted list of the actual implementation steps derived from commit subjects.
# Title
🚧 🐛 BUG/PROJ-123: Fix session timeout
# Why
Corrected user session timeout bug, see [PROJ-123](https://linear.app/my-org/issue/PROJ-123)
# What
Updated the session middleware to properly handle expiration timestamps and added a logout redirect for invalidated sessions.
# How
- [x] fix: session timeout calculation
- [x] feat: add redirect on session expiry
- [x] test: add regression test for session middleware- Commit Summarization: Collects subjects between current and base branch.
- Issue Tracker Integration: Fetches ticket details from Linear, GitHub, or Jira.
- AI-Powered: Optional OpenAI integration for polished descriptions.
- Configurable: Support for global and project-specific settings.
brew tap simonmittag/cli && brew install simonmittag/cli/gh-pr-summarizergo install github.com/simonmittag/gh-pr-summarizer/cmd/gh-pr-summarizer@latestRun from any git repository:
gh-pr-summarizer--current <branch>: Override detected current branch.--base <branch>: Override detected base branch (defaults to main/master).--version: Show version.
OPENAI_API_KEY: Enables AI-generated summaries.GITHUB_TOKEN,LINEAR_API_KEY,ATLASSIAN_TOKEN: Defaults for Tracker authentication.ATLASSIAN_EMAIL: (Optional) Your Atlassian email for Jira API basic auth.
Hierarchical system: local .ghpr.toml overrides global ~/.config/gh-pr-summarizer/config.toml.
tracker = "linear"
[linear]
ticket_url_stem = "https://linear.app/my-org/issue/"
token_env = "MY_CUSTOM_LINEAR_TOKEN_ENV" # Defaults to LINEAR_API_KEY
[github]
token_env = "GITHUB_TOKEN"
[jira]
ticket_url_stem = "https://my-org.atlassian.net/browse/"
token_env = "ATLASSIAN_TOKEN"
email_env = "ATLASSIAN_EMAIL" # OptionalDetects ticket IDs in branch names (e.g., feature/PROJ-123-add-login) to fetch context.
Contributions are welcome. See CONTRIBUTING.md and our Code of Conduct.