GitHub - us702/pr-desc-cli: Turn a git diff into a ready-to-paste PR description - no more pasting your diff into ChatGPT by hand. · GitHub
/" data-turbo-transient="true" />
Skip to content
Type / to search
Sign in<br>Sign upAppearance settings
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
us702
pr-desc-cli
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
master
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>2 Commits<br>2 Commits
.claude/memory
.claude/memory
bin
bin
examples
examples
.gitignore
.gitignore
CLAUDE.md
CLAUDE.md
LICENSE
LICENSE
README.md
README.md
package.json
package.json
View all files
Repository files navigation
pr-desc-cli
Turn a git diff into a ready-to-paste PR description. No more copying your<br>diff into ChatGPT/Claude and asking "can you write a PR description for this?"<br>every single time you open a pull request.
Why
Every PR needs a summary, a list of what changed, and a checklist - and most<br>people generate that by hand-pasting their diff into an AI chat window. This<br>CLI does that step locally and deterministically: it reads a diff, groups the<br>changes (source / tests / config / docs), counts additions/deletions per file,<br>and produces clean markdown you can paste straight into GitHub/GitLab. An<br>optional --ai flag will polish the wording with Claude if you want it, but<br>the tool works fully offline with zero dependencies either way.
Quick start
npx pr-desc --branch main
or install it globally:
npm install -g pr-desc<br>pr-desc --branch main
Usage
Diff against another branch (default comparison)<br>pr-desc --all Diff of all uncommitted changes (staged + unstaged)<br>pr-desc Read a diff from a file<br>cat some.diff | pr-desc - Read a diff from stdin<br>pr-desc --ai Polish the output with Claude (needs ANTHROPIC_API_KEY)<br>pr-desc --help Show help">pr-desc Diff of staged changes (git diff --cached)<br>pr-desc --branch Diff against another branch (default comparison)<br>pr-desc --all Diff of all uncommitted changes (staged + unstaged)<br>pr-desc Read a diff from a file<br>cat some.diff | pr-desc - Read a diff from stdin<br>pr-desc --ai Polish the output with Claude (needs ANTHROPIC_API_KEY)<br>pr-desc --help Show help
AI polish (optional)
Set ANTHROPIC_API_KEY in your environment and pass --ai to have Claude<br>rewrite the generated description for clarity. If the key isn't set, --ai<br>silently falls back to the plain, locally-generated description - never<br>required for basic usage.
Example
node bin/cli.js examples/sample.diff
Produces:
## Summary
This PR updates 3 source file(s), adds 1 new file(s), removes 1 file(s),<br>touches 1 test file(s), updates 1 doc file(s) (+25/-6 lines across 5 file(s)).
## Changes
**Source**<br>- `src/auth/login.js` (+8/-0)<br>- `src/auth/rateLimiter.js` (new) (+8/-0)<br>- `src/auth/legacyLogin.js` (deleted) (+0/-6)
**Tests**<br>- `tests/auth/login.test.js` (+7/-0)
**Docs**<br>- `README.md` (+2/-0)
## Checklist
- [ ] Tests added/updated<br>- [ ] Docs updated<br>- [ ] Manually verified the change
License
MIT
About<br>Turn a git diff into a ready-to-paste PR description - no more pasting your diff into ChatGPT by hand.<br>Resources<br>Readme<br>MIT license<br>Activity<br>Stars<br>0 stars<br>Watchers<br>0 watching<br>Forks<br>0 forks<br>Report repository
Releases
Packages
Contributors
Languages
You can’t perform that action at this time.