pr-visual
v1.0.14
Published
Generate visual infographics for PR diffs using Gemini
Maintainers
Readme
pr-visual
Generate infographic images from pull requests using Gemini, with Nano Banana Pro and Gemini 3 Flash
'Excalidraw' style:
'Clean' style:
Installation
npx pr-visualOr install globally:
npm install -g pr-visualAuthentication
Option 1: Google OAuth (recommended)
pr-visual loginOpens browser to authenticate with your Google account. Uses your own Gemini quota.
Option 2: API Key
export GEMINI_API_KEY=your_key_here
pr-visualGet a key at aistudio.google.com/apikey
Usage
Interactive Mode
pr-visualWalks you through selecting what to visualize and which style to use.
Non-Interactive Mode
# Visualize branch diff
pr-visual --mode branch --yes
# Visualize staged changes
pr-visual --mode staged --yes
# Visualize a specific commit
pr-visual --mode commit --commit abc1234 --yes
# Custom output path
pr-visual --mode branch --yes --output my-visual.pngVisual Styles
pr-visual --mode branch --style excalidraw --yes| Style | Description |
|-------|-------------|
| clean | Corporate/PowerPoint style (default) |
| excalidraw | Hand-drawn whiteboard aesthetic |
| minimal | Simple, icon-heavy, lots of whitespace |
| tech | Dark mode with neon accents |
| playful | Colorful and fun with illustrations |
Custom Prompts
Skip diff analysis and provide your own prompt:
pr-visual --prompt "Create an infographic showing a login flow" --yes
pr-visual --prompt-file my-prompt.txt --yesGitHub Action
Automatically generate and post infographics on PRs.
Setup
- Add
GEMINI_API_KEYto your repository secrets - Create
.github/workflows/pr-visual.yml:
name: PR Visual
on:
pull_request:
types: [opened, synchronize]
jobs:
visualize:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: gitethanwoo/pr-visual@v1
with:
gemini-api-key: ${{ secrets.GEMINI_API_KEY }}
style: clean # optionalThe action will:
- Use Gemini CLI to intelligently analyze the PR (can read files for context, not just the diff)
- Generate an infographic from the analysis
- Upload it to a GitHub Release (no commits to your PR branch!)
- Post a comment with the image and a collapsible prompt/history section
CLI Reference
pr-visual [command] [options]
Commands:
login Login with Google OAuth
logout Clear stored credentials
status Show authentication status
upgrade Upgrade to the hosted version
(none) Generate infographic (default)
Options:
-h, --help Show help
-m, --mode <mode> Diff mode: branch, commit, staged, unstaged
-s, --style <style> Visual style: clean, excalidraw, minimal, tech, playful
-p, --prompt <text> Custom prompt (bypasses diff analysis)
--prompt-file <path> Read prompt from file
-c, --commit <hash> Commit hash (for mode=commit)
-y, --yes Skip confirmation prompt
-o, --output <path> Output file pathLicense
ISC
