Skip to main content

Command Palette

Search for a command to run...

Origin

Pull request commands

Every origin pr subcommand with its options. For the rest of the CLI, see Commands. For how pull requests work in Origin, see Pull requests.

Targeting a pull request

Pull request commands infer the repository from the origin git remote in your current checkout. Override it with -R, --repo in org/name format.

Most subcommands take an optional [target]. A number selects that pull request, anything else is read as a branch name. Omit it and the CLI uses the open or draft pull request for your current branch:

origin pr view 13        # pull request 13origin pr view my-branch # pull request for my-branchorigin pr view           # pull request for the current branch

Subcommands

SubcommandDescriptionUsage
createOpen a pull request against an Origin repoorigin pr create -t "Fix CI"
list | lsList pull requests in a repositoryorigin pr list
statusShow the pull requests relevant to you in a repositoryorigin pr status
view [target]Display a pull request, and optionally its diff, checks, or commentsorigin pr view 13
diff [target]View the diff for a pull requestorigin pr diff
checks [target]Show CI status for a pull requestorigin pr checks
checkout [target]Fetch and check out the pull request branchorigin pr checkout 13
edit [target]Edit the title, body, or base branchorigin pr edit -t "New title"
ready [target]Mark a draft as ready for revieworigin pr ready
review [target]Add a revieworigin pr review --approve
comment [target]Add a discussion commentorigin pr comment -b "LGTM"
threadList, resolve, reopen, and reply to review threadsorigin pr thread list
merge [target]Merge a pull requestorigin pr merge
close [target]Close a pull requestorigin pr close
reopen [target]Reopen a closed pull requestorigin pr reopen
refresh [target]Snapshot a new version from the current refsorigin pr refresh

Pushing to the head branch snapshots a new version on its own. Run origin pr refresh only when origin pr view or origin pr checks still report the previous head commit. It does nothing when the resolved commits already match the latest version.

origin pr review files a formal review. origin pr comment adds a discussion comment. origin pr view --comments lists both.

Create

OptionDescription
-t, --title <title>Title of the pull request
-b, --body <body>Body of the pull request
--description <text>Description of the pull request
-F, --body-file <path>Read the body from a file. Use - for stdin
-H, --head <branch>Branch that holds your commits (default: current branch)
-B, --base <branch>Branch you want your code merged into (default: the repo default branch)
--pushPush the head branch without prompting when it isn't on the remote yet
--remote <remote>Remote to push to when the head branch isn't on the remote (default: origin)
--status <status>Initial status: draft or open (default: draft)
-d, --draftCreate as a draft. Alias for --status draft
-f, --fillUse commit information for the title and body
--fill-firstUse the first commit's information for the title and body

List and status

CommandOptionDescription
list-s, --state <state>Filter by state: open, closed, merged, draft, or all (default: open)
list--mineOnly show pull requests you authored
list-B, --base <branch>Filter by base branch
list-H, --head <branch>Filter by head branch
list--file <path>Filter by a changed path. Repeatable; a trailing / matches a folder prefix
list-L, --limit <number>Maximum number of items to fetch (default: 30)
list--json <fields>Output JSON with the fields you list, for example number,title,status
list-q, --jq <expression>Filter the JSON output with a jq expression. Requires --json
status-c, --conflict-statusShow the merge conflict status of each pull request

View, diff, and checks

CommandOptionDescription
view--diffShow the collected patch diff for the selected version
view--checksInclude the mergeability and CI summary
view-c, --commentsShow comments and reviews, with per-thread resolution state
view--name-onlyWith --diff, print only the changed file paths
view--exclude <glob>Exclude paths matching a glob. Repeatable
view-w, --webOpen the pull request in your browser
view--change-version <number>Version to display (default: latest)
view--json <fields>Output JSON with the fields you list. Bare --json lists the fields
view-q, --jq <expression>Filter the JSON output with a jq expression. Requires --json
diff--patchDisplay the diff in patch format
diff--name-onlyPrint only the changed file paths
diff-e, --exclude <glob>Exclude files matching a glob. Repeatable
checks--watchWatch the checks until they finish
checks--json <fields>Output JSON with the fields you list
checks-q, --jq <expression>Filter the JSON output with a jq expression. Requires --json

list, status, view, diff, and checks also take --color <always|never|auto> (default: auto).

--diff, --checks, and --comments only shape the plain-text output of origin pr view. For JSON, request the fields you want instead, such as files, mergeability, ciState, comments, or threads.

Checkout, edit, and lifecycle

CommandOptionDescription
checkout-b, --branch <name>Local branch name to use (default: the pull request's head ref)
checkout--detachCheck out with a detached HEAD
checkout-f, --forceReset the existing local branch to the latest state
checkout--remote <remote>Remote to fetch from (default: origin)
edit-t, --title <title>Set a new title
edit-b, --body <body>Set a new body
edit-F, --body-file <path>Read the new body from a file. Use - for stdin
edit-B, --base <branch>Change the base branch
ready--undoConvert the pull request back to a draft
merge--autoMerge once the requirements are met, then return
merge--disable-autoTurn off merge-when-ready for this pull request
close-c, --comment <body>Leave a closing comment
reopen-c, --comment <body>Add a reopening comment

Review and comment

CommandOptionDescription
review-a, --approveApprove the pull request
review-c, --commentFile the review as a comment
review-b, --body <body>Review body text
review-F, --body-file <path>Read the review body from a file. Use - for stdin
review--change-version <number>Version being reviewed (default: latest)
comment-b, --body <body>Comment body text
comment-F, --body-file <path>Read the comment body from a file. Use - for stdin

Review threads

Every review comment belongs to a thread with its own resolution state.

SubcommandDescriptionUsage
thread list [target]List threads and their resolution stateorigin pr thread list --unresolved
thread resolve <thread-id> [target]Resolve a threadorigin pr thread resolve t_123
thread reopen <thread-id> [target]Reopen a resolved threadorigin pr thread reopen t_123
thread reply <thread-id> [target]Add a comment to a threadorigin pr thread reply t_123 -b "Fixed"
CommandOptionDescription
list--unresolvedOnly show unresolved threads
list-c, --commentsPrint every comment body instead of the opening excerpt
list--change-version <number>Only threads filed against this version (default: every version)
list--json <fields>Output JSON with the fields you list, for example id,resolved,path
list-q, --jq <expression>Filter the JSON output with a jq expression. Requires --json
reply-b, --body <body>Reply body text
reply-F, --body-file <path>Read the reply body from a file. Use - for stdin

Scripts that gate on "all threads resolved" can use origin pr thread list --unresolved --json id --jq length.

Getting help

Every subcommand takes --help:

origin pr --helporigin pr create --helporigin pr thread --help

Next steps