prl

command module
v0.10.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 111 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

prl

A Swiss Army knife for GitHub pull requests.

Install

macOS / Linux
brew install gechr/tap/prl
Windows
scoop bucket add gechr https://github.com/gechr/scoop-bucket
scoop install gechr/prl
Go
go install github.com/gechr/prl@latest

Authenticate with PRL_GITHUB_TOKEN, GITHUB_TOKEN, GH_TOKEN, or gh auth login. Building from source requires the Go version in go.mod.

Quickstart

prl --init

This writes ~/.config/prl/config.yaml. Edit it to set defaults such as owners, authors, output mode, plugin, and TUI behavior.

Examples

Everything is flags plus optional free-text query terms - no subcommands.

# Your open PRs
prl

# All PRs across states
prl -s all

# PRs for a specific repo
prl --repo owner/repo

# GitHub URLs work too, with or without the scheme
prl -R https://github.com/owner/repo -a any
prl -R github.com/owner/repo -a any

# PRs with "fix" in the title/body/comments
prl fix

# Specific PRs by URL or owner/repo#N (search filters such as --state are ignored)
prl https://github.com/owner/repo/pull/1 https://github.com/owner/repo/pull/2 owner/other#3

# PRs created in the last 2 weeks
prl -c 2weeks

# PRs that have never been updated after creation
prl --drift 0

# Open an interactive TUI browser
prl --interactive

# Open the TUI with a slower refresh cadence for this run
prl --interactive --interval 30s

# Refresh results continuously
prl --watch

# Watch with a custom refresh interval floor for this run
prl --watch --interval 30s

# Print only the total count
prl --count

# Break down the results by author
prl --group author

# Break down by repo, then author within each repo
prl --group repo,author

# Approve selected PRs
prl --approve

# Enable auto-merge for your PRs
prl --merge -y

# Clone matching repos
prl --clone -y

# Send your PRs to Slack via plugin
prl --send

# Dry run: show the query without executing it
prl --dry

# JSON output
prl -o json

Flags

Filters
Flag Short Description
--owner -O Limit to GitHub owner(s), comma-separated
--repo -R Limit to a specific repo
--filter -f Raw GitHub search qualifier (repeatable)
--match Restrict text search to title, body, or comments
--author -a Filter by author(s), comma-separated
--commenter Filter by commenter
--no-bot -B Exclude bot authors after fetch
--team -t Filter by team authors via plugin or config
--involves -I Filter by involvement
--requested Filter by requested reviewer
--closed-by Filter by who closed the PR
--merged-by Filter by who merged the PR
--reviewed-by Filter by reviewer
--ci Filter by CI status: success, failure, pending
--comments Filter by comment count, for example >5 or 10..20
--language -l Filter by language
--review -r Filter by review status
--state -s Filter by state: open, closed, ready, merged, all
--topic -T Filter by repo topic via plugin
--created -c Filter by creation date
--drift Filter by gap between creation and last update
--updated -u Filter by last updated date
--merged -m Filter by merged date
--archived Include archived repos
--draft / --no-draft Filter by draft state

--ci takes a comma-separated list, and a leading ! or - excludes a status: --ci='!failure' hides PRs with failing CI. Quote ! in bash and zsh.

For flags that accept a GitHub user, copilot is an alias for copilot-pull-request-reviewer[bot].

Interactive Actions
Flag Short Description
--interactive -i Launch the full-screen TUI browser
--diff -d Open matching PRs directly in diff view
--interval Override auto-refresh interval for TUI/watch
--approve Approve each PR
--close Close each PR
--copilot Request Copilot review on each PR
--delete-branch Delete the branch after close
--comment Add a comment to each PR
--edit -e Edit title and body of each PR
--mark-draft Convert each PR to draft
--mark-ready Mark each PR ready for review
--merge / --no-merge Toggle auto-merge
--force-merge -M Poll for checks, then force-merge
--unsubscribe -U Remove review request and unsubscribe
--update Update each PR branch from its base branch
--yes -y Skip the confirmation prompt

With --approve --update, prl approves the selected head before requesting a branch update against that SHA. To approve and merge the updated head, run --update first, then review the result before using --approve --merge or --approve --force-merge.

Actions
Flag Short Description
--clone Clone unique repos from the results
--copy -C Copy rendered output to the clipboard
--count -N Print only the total result count
--group -G Break down result counts by field(s): author, repo, owner, state, draft, label (comma-separated for nested breakdowns)
--dry -n Show the query without executing it
--open -P Open each PR in the browser
--web -w Open the GitHub search page in the browser
--send Send PRs to Slack via plugin
--send-to Override the Slack recipient
Output
Flag Short Description
--watch -W Refresh output periodically
--exit-0 -0 Exit immediately when there are no results
--columns Custom table columns
--limit -L Maximum number of results
--output -o table, url, bullet, json, or repo
--reverse Show oldest first
--sort Sort by name, created, or updated
Miscellaneous
Flag Short Description
--init Write the default config file
--color auto, always, or never
--theme Color theme: auto (terminal), light, or dark
--debug Log HTTP requests to stderr
--quick -Q Skip enrichment such as merge status and auto-merge
--verbose -v Enable verbose logging
-h Print short help
--help Print long help with examples

TUI

  • prl -i: browse PRs and diffs. ?: all shortcuts.
  • prl -d opens the first matching diff. Use Left and Right to browse the results. When you name PRs on the command line, the diffs open in the order you give them. Press Esc or q to close the diff and exit prl. Use prl -di to return to the list when you close the diff.
  • Shift+O: filters and stack visibility.
  • f/F: status presets. t/T: time ranges. Ctrl+X: clear both.
  • Left/Right or click a stack header: collapse/expand stacks.
  • In detail view, n/Right and p/Left browse the next and previous PR in the filtered list. In diff view, the same keys browse the selected queue. Both views prefetch the next PR and keep fetched content in memory for the session, so you can revisit a PR immediately. A known-outdated diff stays readable while it refreshes. Approval and merge become available when the current diff arrives.
  • When the PR list overflows, click or drag its scrollbar to browse the filtered rows.
  • Diffs show the old and new code side by side when the body is at least 160 columns wide. Resizing to a narrower terminal switches to a unified diff. Set tui.diff.layout to split or unified to pin a layout, or change tui.diff.split_min_width to move the breakpoint. Set tui.diff.theme to light, dark, or auto (terminal background) to choose a theme for the diff alone. When omitted, the diff follows --theme, which defaults to the terminal background.
  • The current filename stays at the top as you scroll through a diff. Click a file header to jump to its start. Press w to switch between soft wrap (fit long lines to the pane) and hard wrap (follow the file's line breaks and scroll horizontally). prl remembers your choice across restarts. Set tui.diff.word_wrap: false to start in hard wrap mode.
  • In the diff, hover over a code line and click the blue [+] to comment. Drag from it to select a range in the same hunk. Press i to toggle line selection. Use the arrows to choose a line or side, hold Shift with Up or Down to extend the range, then press Enter to write.
  • Review conversations appear beneath their lines. File-level and outdated conversations appear under the file header, or after the diff if the file is absent. The timestamp beside each author links to the comment on GitHub. Hover over it for the exact time and elapsed age. Click Edit on an editable comment to change its text. Update or Ctrl+s saves the change to GitHub. Click Edit again or press Esc to keep the edit as a local draft, or click Cancel to discard it. When you have permission, click Delete on the right of that comment's row and confirm with Yes. Resolved threads start collapsed and open threads start expanded. Press z to collapse all threads in the current PR, or expand them if all are collapsed. Click a thread's disclosure arrow to toggle it individually. prl remembers these choices for each PR across restarts. Use Resolve to mark the conversation resolved or Unresolve to reopen it when you have permission. Use [ and ] to jump to the previous or next thread. The footer shows which directions are available. Press Enter on a focused thread or click Reply to respond. Ctrl+s posts immediately. Drafts save automatically to local state and survive restarts. Esc keeps the draft at its lines. Click its pink [+] or press I to resume. Cancel discards the active draft. With event streams enabled, incoming reviews refresh the conversation.
  • Set tui.diff.review_comments: false to turn off inline comments, replies, drafts, and thread reads. The TUI also skips GitHub's shared review-submitted event, so approvals and requests for changes appear on the next PR status refresh.
  • In a diff or detail view, drag to select text. Hold the pointer above or below the content to keep scrolling, then press Ctrl+c to copy the selection.
  • a: approve, or unapprove your own approval. Approvals name the selected head commit. If the head changes, refresh and review the new revision before approving. Unapprove opens a reason editor prefilled with "Approval withdrawn by reviewer." In diff view, approving advances to the next PR.
  • Alt+a: approve or unapprove without confirmation, using the default reason.
  • --interval 30s: slow auto-refresh.
  • Auto-refresh keeps its idle backoff. Pending CI is checked each refresh. Settled status is reused for up to a minute on screen and three minutes off screen, subject to the refresh interval and rate limits.
  • Returning focus catches up when a refresh is due. Refreshes preserve the selected PR and its screen position when possible.
  • Cached startup results retain their original age, and successful review actions update only the affected PRs on return to the list.
  • View preferences are saved between sessions. In terminals that support OSC 7577, restarting the terminal restores each browser from its own disk cache, including the PR list, selections, open detail or diff, and scroll position. A restored diff or detail refreshes immediately, even with polling and event streams disabled. Approval and merge wait for that live read to succeed. Quitting the browser clears its resume record.
  • tui.presets and tui.review: configure presets and AI reviews.
  • Reviews open in Herdr, Ghostty, iTerm2, Kitty, or Windows Terminal (WSL).
  • Reviews use read-only/plan mode. YOLO allows unrestricted commands and resets each time. Alt+R always uses restricted mode.

Date Syntax

2weeks      # since 2 weeks ago (>=)
>2weeks     # more than 2 weeks ago
<3days      # less than 3 days ago
1y6mo       # compound: 1 year and 6 months ago
1d12h       # compound: 1 day and 12 hours ago
today       # today
yesterday   # yesterday
2024-01-15  # exact ISO date

Units: m/min/mins/minute/minutes, h/hr/hrs/hour/hours, d/day/days, w/week/weeks, mo/month/months, y/year/years

Drift

Gap between PR creation and last update. Default operator is <=.

--drift 0         # never updated after creation
--drift 1week     # updated within 1 week of creation
--drift '>1week'  # updated more than 1 week after creation

Also supports seconds: s, sec, secs, second, seconds.

Table Columns

Default columns: index, title, ref, created, updated.

author is added automatically when multiple authors are in play (e.g. --team).

Available columns: index, owner, ref, repo, number, title, labels, author, state, review, created, updated, url

The review column shows the PR's review decision using the same values as the --review filter: approved, changes_requested, required, dismissed, or none when nobody has been asked to review. It reuses the review decision already fetched for the status column, so it costs no extra API calls (with --quick it renders unknown).

prl --columns title,ref,author,labels

Set default.columns in config.yaml to change the default set. --columns overrides it, and unlike the flag a configured list leaves default.output alone.

In table mode, sort defaults to updated unless --sort is set explicitly.

Configuration

Lives at ~/.config/prl/config.yaml. Overridden by PRL_* environment variables.

default:
  owners:
    - my-org
  authors:
    - "@me"
  bots: true
  columns: []
  limit: 30
  match: title
  merge_method: squash
  output: table
  reverse: false
  sort: name
  state: open

features:
  event_streams: false

# Options: auto, unicode, nerd
# auto selects nerd when NERD_FONTS is non-empty; otherwise it selects unicode.
icons: auto

vcs: git

spinner:
  style: dots
  colors: ["39", "45", "51"]

tui:
  diff:
    # Auto uses split when the diff pane has enough columns, unified otherwise.
    layout: auto
    split_min_width: 160
    word_wrap: true # Set false to clip long lines at the edge of each pane.
    line_numbers: true
    review_comments: true # Read and write inline review conversations in the diff.
    # Inherits --theme when omitted. Set auto to follow the terminal background.
    # theme: auto
    dark:
      syntax_theme: github-dark
      added_bg: "#173322"
      removed_bg: "#3c1e21"
    light:
      syntax_theme: github
      added_bg: "#e4f0e7"
      removed_bg: "#f9e4e6"

  animations:
    enabled: true # Animate pending toast borders and navigation between PRs, file headers, and threads.
  refresh:
    enabled: true
  review:
    # Optional: limit or reorder the available review providers.
    # enabled: [claude, codex, gemini]
    default:
      provider: claude
      model: opus
      effort: high
    providers:
      claude:
        # Optional: override the available model/effort choices.
        # models: [sonnet, opus, fable]
        # efforts: [low, medium, high, max, auto]
        prompt: |
          Review PR #{prNumber} in {ownerWithRepo}.

          URL: {prURL}
      codex:
        # Optional: override the available model/effort choices.
        # models: [gpt-6.2-sol, gpt-6.2-astra, gpt-6.1-terra, gpt-6.1-sol, gpt-6-astra, gpt-6-sol, gpt-6-luna, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna]
        # efforts: [low, medium, high, xhigh, max, ultra]
        # All listed models support ultra except gpt-6-luna and gpt-5.6-luna.
        prompt: |
          Review PR #{prNumber} in {ownerWithRepo}.

          URL: {prURL}
      gemini:
        # Optional: override the available model/effort choices.
        # models: [gemini-4-neon, gemini-4-carbon, gemini-4-hydrogen, gemini-3.7-flash, gemini-3.6-flash, gemini-3.1-pro]
        # efforts: [low, high] # Applies to all configured models.
        # The built-in choices also include medium for Flash, Carbon, Neon, and Hydrogen,
        # and xhigh for Neon and Hydrogen.
        prompt: |
          Review PR #{prNumber} in {ownerWithRepo}.

          URL: {prURL}
  filters: {}
  presets:
    filters:
      - name: Needs your review
        filter: approvable
        when: "!scope:self"
        color: blue
      - name: Waiting for CI
        filter: >-
          scope:self !draft ci:pending OR
          !mine !draft !approved !review:approved ci:pending
        color: "208"
    time:
      field: updated
      filters:
        - name: 10 minutes
          max_age: 10m
        - name: 1 hour
          max_age: 1h
        - name: 1 day
          max_age: 1d
        - name: 1 week
          max_age: 1w
        - name: 1 month
          max_age: 30d
        - name: 1 year
          max_age: 1y
  stacks:
    enabled: true
  sort: {}

plugin: ""

ignored_owners: []

team_aliases:
  ops: my-org/ops

teams:
  my-org/ops:
    - alice
    - bob

authors:
  dependabot: Bot
  jdoe: Jane Doe
  • plugin: if empty, auto-discovers prl-plugin-* on PATH
  • icons: auto selects Nerd Font icons when NERD_FONTS is non-empty and Unicode icons otherwise; use nerd or unicode to choose explicitly
  • vcs: controls whether --clone uses git or jj
  • features.event_streams: set to true to refresh on GitHub PR events in --watch and --interactive. In the TUI, R toggles periodic polling. Event updates stay active with polling off. Requires an account with Event Streams preview access. The TUI listens to the first eight GitHub.com PRs on screen, following the current filter and scroll position. After the visible set settles for one second, new listeners attach and read current PR status. In a detail or diff view, the open PR takes priority for one of those eight listeners. Events refresh the open view in the background. On revisit, entries older than three minutes also refresh to catch changes outside the event stream, such as description edits. The list applies queued updates when you return. Watch mode listens to the first eight GitHub.com PRs in the result set. An event refreshes status fields on the affected PRs. After a push, prl rechecks up to twice while GitHub still reports a conflict or checks have yet to appear. Event batches are spaced at least seven seconds apart, including across repeated pushes. The TUI also spaces event-driven list reads at least seven seconds apart when review delays a read. With polling enabled, periodic searches also discover new matches, recheck search filters, and catch missed changes. prl reconnects and renews expired subscriptions automatically.
  • tui.diff.word_wrap, tui.refresh, tui.sort, tui.filters, tui.stacks.enabled: starting defaults you manage. Interactive changes in the TUI (toggling auto-refresh, sorting columns, applying filters) are not written back to config.yaml. They're saved to a separate state file at $XDG_STATE_HOME/prl/state.yaml (default ~/.local/state/prl/state.yaml), which mirrors the tui: subtree and takes precedence over config. This keeps your version-controlled config stable while remembering your last session.
  • tui.presets.filters: named filters that f cycles through in the TUI
    • name: shown in the TUI
    • color: a colour name such as blue, a hex value or an ANSI number
    • when: show the preset only when the search matches, e.g. "!scope:self"
      • Same syntax as filter, with search terms only (scope:self)
    • filter: terms combined as in GitHub search
      • Space, comma or AND: all must match
      • OR: either side matches; binds more loosely than AND
      • ( ): group terms
      • ! or -: negate a term or group; quote a filter that starts with !
      • Example: (mine AND draft) OR approved
    • Terms:
      • mine, draft, ready, conflict
      • approved: approved by you
      • approvable: not yours, not a draft, not yet approved, CI passing
      • mergeable: not a draft, approved, CI passing, no conflicts
      • broken: failing CI or merge conflicts
      • blocked: open, not a draft, and broken or changes requested
      • outdated: open, not a draft, and behind a base branch that requires it to be up to date
      • scope:self: the search lists only your PRs, as with the default authors: ["@me"]; never with --team
      • ci:<status>, review:<decision>
    • Defaults: Needs your review, Waiting for CI, Approved by you, Mergeable, Outdated and Blocked
      • Waiting for CI shows your PRs when you list only yours, and PRs you can approve once CI passes otherwise
      • Needs your review and Approved by you are hidden when you list only your PRs
  • tui.presets.time.field: timestamp to filter, updated (default) or created
  • tui.presets.time.filters: replaces the default time ranges with entries containing name, max_age and optional color. All Time is always available and is the initial selection. Durations use gechr/x/human.ParseDuration, supporting 10m, 1h, 1d, 1w, 30d, 1y and compounds such as 1w2d. The default month is 30 days and year is 365 days. Filtering applies to the loaded results alongside other filters.
  • tui.filters.time: initial time range by name, before a saved session takes precedence
  • AI review placeholders: {prNumber}, {repo}, {owner}, {ownerWithRepo}, {prURL}, {prRef}, {title}
  • Gemini reviews require the Antigravity CLI (agy). The default is Gemini 4 Neon with high effort. Model and effort selections map to its model slugs (for example, gemini-4-neon with xhigh selects gemini-4-neon-xhigh) and --effort flag.

Plugins

External binaries (prl-plugin-*) that provide completion (author, team, repo, topic, slack-recipient), resolution (team, topic), and Slack sending. Set plugin: in config if multiple are on PATH.

Development

make fmt
make lint
make test
make install

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
diff
Package diff builds unified and split review views from a Git patch.
Package diff builds unified and split review views from a Git patch.
eventstream
Package eventstream reads server-sent events (SSE) streams, such as the one the GitHub Event Subscriptions API delivers events over.
Package eventstream reads server-sent events (SSE) streams, such as the one the GitHub Event Subscriptions API delivers events over.
markdown
Package markdown renders GitHub Markdown in terminal review views.
Package markdown renders GitHub Markdown in terminal review views.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址