Cursor Origin
Cursor Origin CLI Reference: Every origin Command, Explained
The Origin CLI is one binary, origin, with 14 command groups, including auth, repo, pr, stack, ruleset and api. Install it with Cursor's script and run origin auth login. Most commands then infer the repository from your checkout's origin remote. It is a separate tool from Cursor's agent CLI.

On this page
What is the Origin CLI and how do you install it?
The Origin CLI is Cursor's command-line client for Origin, its code host. One origin command covers sign-in and git credentials, repositories, pull requests, stacks, rulesets, SSH keys, apps and a raw API escape hatch. Install it with the script Cursor publishes, then sign in once through the browser.
curl -fsSL https://downloads.cursor.com/origin/install.sh | sh origin auth login
Two points from the docs are easy to get wrong on day one. The Origin CLI is not the Cursor Agent CLI, which is a separate binary called agent with its own docs section. And the CLI is in early beta with the rest of Origin. Its reference has grown since launch and now lists 14 command groups, so check it before you script against a flag.
If the shell can't find origin after the install script runs, the binary is in ~/.local/bin and that directory isn't on your PATH. The docs give the usual fix: add an export line to ~/.zshrc for zsh or ~/.bashrc for bash, then source the file. On native Windows, install from PowerShell with irm https://downloads.cursor.com/origin/install.ps1 | iex instead. It puts origin.exe in %LOCALAPPDATA%\cursor\bin and adds that folder to your PATH, so open a new terminal afterward.
Before you go further, run origin --version to confirm the install worked.
This is covered hands-on in Cursor Compile 2026 — 1 short Unit, free to read.
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.
What are the origin command groups?
The reference lists 14 groups in one table, each with a one-line usage example. The shape will feel familiar if you use gh: a noun, then a verb, with the repository inferred from the checkout you're in. The global options are now just --version and -h or --help. The CLI reads its API endpoint and credentials from environment variables, covered in the last section.
- Group
- auth
- What it does
- Sign in, sign out, and configure git authentication
- Example
- origin auth login
- Group
- repo
- What it does
- Create, view, edit, clone, mirror and delete repositories, and manage their access
- Example
- origin repo create acme/checkout
- Group
- pr
- What it does
- Create, review and merge pull requests
- Example
- origin pr create
- Group
- stack
- What it does
- View, restack and push stacks of pull requests and their local branches
- Example
- origin stack restack
- Group
- label
- What it does
- Manage the labels a repository defines
- Example
- origin label list
- Group
- ruleset (alias rs)
- What it does
- Manage Origin rulesets, merge-time and push-time
- Example
- origin ruleset list
- Group
- namespace (alias ns)
- What it does
- Manage access to an Origin namespace
- Example
- origin namespace access list acme
- Group
- app
- What it does
- Manage Origin apps, their signing keys and webhook deliveries
- Example
- origin app list
- Group
- ssh-key
- What it does
- Manage SSH keys registered with your Origin account
- Example
- origin ssh-key list
- Group
- api <endpoint>
- What it does
- Authenticated request to the Origin REST API at api.cursor.com/v1/origin
- Example
- origin api /repos/{owner}/{repo}
- Group
- agent
- What it does
- Print a usage guide for AI agents, or install a skill that points agents to it
- Example
- origin agent prompt
- Group
- completion
- What it does
- Set up bash or zsh tab completion
- Example
- origin completion >> ~/.zshrc
- Group
- update
- What it does
- Update origin to the current release on your channel
- Example
- origin update
- Group
- config
- What it does
- Manage configuration, including the release channel
- Example
- origin config get-channel
| Group | What it does | Example |
|---|---|---|
| auth | Sign in, sign out, and configure git authentication | origin auth login |
| repo | Create, view, edit, clone, mirror and delete repositories, and manage their access | origin repo create acme/checkout |
| pr | Create, review and merge pull requests | origin pr create |
| stack | View, restack and push stacks of pull requests and their local branches | origin stack restack |
| label | Manage the labels a repository defines | origin label list |
| ruleset (alias rs) | Manage Origin rulesets, merge-time and push-time | origin ruleset list |
| namespace (alias ns) | Manage access to an Origin namespace | origin namespace access list acme |
| app | Manage Origin apps, their signing keys and webhook deliveries | origin app list |
| ssh-key | Manage SSH keys registered with your Origin account | origin ssh-key list |
| api <endpoint> | Authenticated request to the Origin REST API at api.cursor.com/v1/origin | origin api /repos/{owner}/{repo} |
| agent | Print a usage guide for AI agents, or install a skill that points agents to it | origin agent prompt |
| completion | Set up bash or zsh tab completion | origin completion >> ~/.zshrc |
| update | Update origin to the current release on your channel | origin update |
| config | Manage configuration, including the release channel | origin config get-channel |
From cursor.com/docs/origin/cli/reference/commands. Pull request and stack subcommands have their own reference pages.
Most commands infer the repository from the origin git remote in your current checkout. Override it with -R or --repo in org/name format, or set ORIGIN_REPO for the whole shell. The -R flag wins over ORIGIN_REPO, which wins over the git remote, so origin pr list -R acme/checkout works from anywhere. When a command acts on the wrong repo, check ORIGIN_REPO and which remote is called origin where you ran it.
Two documented commands are missing from that table. On a repo mirrored from GitHub, origin push local pushes your Origin-only origin/* branches to the Origin copy, and it doesn't appear in origin --help. On Enterprise repos where Cursor has turned on CloneKit, origin repo clone-fast replaces git clone in CI jobs, as the CloneKit guide explains.
How do the auth and repo commands work?
The auth group manages your session and the git credential helper, and over HTTPS the helper is what makes plain git push and git pull work against Origin. Running origin auth login signs you in through the browser and configures git. The other subcommands cover the cases where that default doesn't fit.
- Subcommand
- login
- Description
- Sign in through the browser and configure git
- Options
- --api-key <key> to sign in with an API key instead; --local to configure the helper in this repository's git config only
- Subcommand
- setup-git
- Description
- Reconfigure the git credential helper for the Origin host
- Options
- --host <host> (default: derived from CURSOR_ORIGIN_ENDPOINT); --global (default true); --local for this repository only
- Subcommand
- status
- Description
- Show the current authentication method and account
- Options
- --json <fields>, for example account,team,organization
- Subcommand
- token
- Description
- Print the token origin sends with requests
- Options
- Subcommand
- logout
- Description
- Clear stored credentials
- Options
| Subcommand | Description | Options |
|---|---|---|
| login | Sign in through the browser and configure git | --api-key <key> to sign in with an API key instead; --local to configure the helper in this repository's git config only |
| setup-git | Reconfigure the git credential helper for the Origin host | --host <host> (default: derived from CURSOR_ORIGIN_ENDPOINT); --global (default true); --local for this repository only |
| status | Show the current authentication method and account | --json <fields>, for example account,team,organization |
| token | Print the token origin sends with requests | |
| logout | Clear stored credentials |
The --local variants scope the credential helper to one checkout. The default is the global git config.
Credentials follow a fixed order: CURSOR_AUTH_TOKEN first, then CURSOR_API_KEY, then a login stored by origin auth login. Running origin auth status shows which one is in use, and in CI the docs say to set one of the two variables instead of signing in.
The repo group covers a repository from creation to deletion. Pass org/name to target one. Running origin repo create <name> without a slash creates the repository in your account's namespace, which suits a personal experiment better than a repo a team will share. The create-mirrored subcommand is the CLI side of the Sync from GitHub button, and it takes --github-enterprise-id for GitHub Enterprise Server, which you omit when mirroring from github.com.
- Subcommand
- create <repo>
- Description
- Create a repository
- Options
- --default-branch <branch> (server default: main)
- Subcommand
- create-mirrored <github-repo>
- Description
- Create a Cursor mirror of a GitHub repository
- Options
- --namespace <namespace>; --github-enterprise-id <uuid>
- Subcommand
- list
- Description
- List the repositories your account can access
- Options
- --namespace <namespace> to list one namespace
- Subcommand
- view [repo]
- Description
- Display a repository
- Options
- --json <fields>, for example org,name,defaultBranch
- Subcommand
- edit [repo]
- Description
- Change repository settings
- Options
- --default-branch; --visibility internal or private; --allow-merge-commit; --allow-squash-merge; --delete-branch-on-merge
- Subcommand
- from-github [github-repo]
- Description
- Show the Origin repository that mirrors a github.com repository
- Options
- --json <fields>
- Subcommand
- verify-migration [repo]
- Description
- Compare a GitHub repository's settings with its Origin counterpart
- Options
- --github-repo <owner/repo>; --namespace <namespace> to check a whole namespace
- Subcommand
- clone <repo> [directory]
- Description
- Clone over HTTPS using your saved login
- Options
- Subcommand
- delete <repo>
- Description
- Delete a repository
- Options
- -y, --yes to skip confirmation; required in a non-interactive shell
- Subcommand
- access
- Description
- Manage who can access a repository
- Options
- list, set, remove and policies subcommands
- Subcommand
- mirror
- Description
- Manage a repository's GitHub mirror
- Options
- status, sync and detach subcommands
| Subcommand | Description | Options |
|---|---|---|
| create <repo> | Create a repository | --default-branch <branch> (server default: main) |
| create-mirrored <github-repo> | Create a Cursor mirror of a GitHub repository | --namespace <namespace>; --github-enterprise-id <uuid> |
| list | List the repositories your account can access | --namespace <namespace> to list one namespace |
| view [repo] | Display a repository | --json <fields>, for example org,name,defaultBranch |
| edit [repo] | Change repository settings | --default-branch; --visibility internal or private; --allow-merge-commit; --allow-squash-merge; --delete-branch-on-merge |
| from-github [github-repo] | Show the Origin repository that mirrors a github.com repository | --json <fields> |
| verify-migration [repo] | Compare a GitHub repository's settings with its Origin counterpart | --github-repo <owner/repo>; --namespace <namespace> to check a whole namespace |
| clone <repo> [directory] | Clone over HTTPS using your saved login | |
| delete <repo> | Delete a repository | -y, --yes to skip confirmation; required in a non-interactive shell |
| access | Manage who can access a repository | list, set, remove and policies subcommands |
| mirror | Manage a repository's GitHub mirror | status, sync and detach subcommands |
From the Repositories section of the commands reference.
The confirmation prompt is the guard the reference describes for delete. A non-interactive shell has to pass --yes to get past it, so an agent or CI job running origin repo delete gets no second chance. Treat origin repo mirror detach the same way: it permanently disconnects a repository from GitHub, and -y skips its prompt.
Rulesets are no longer read-only from the CLI. Besides list and view, which show the rules behind a repository's Rules and Protections tab, the ruleset group can create, update, delete and import rulesets, and import reads GitHub ruleset or branch-protection JSON. Importing with --enforcement evaluate lets you trial the rules first. The ssh-key group adds, lists and deletes the public keys on your account, and add requires -t or --title to name the key.
How do you open, review and merge pull requests from the CLI?
The pr group has 19 subcommands. Most take an optional target: a number such as 13 or #13, an Origin pull request URL, or a branch name. Leave it out and the CLI uses the open or draft pull request for your current branch.
- Subcommand
- create (new)
- Description
- Open a pull request against an Origin repo
- Usage
- origin pr create -t "Fix CI"
- Subcommand
- list (ls)
- Description
- List pull requests in a repository
- Usage
- origin pr list
- Subcommand
- status
- Description
- Show the pull requests relevant to you
- Usage
- origin pr status
- Subcommand
- view [target]
- Description
- Display a pull request, optionally with its diff, checks, comments or agents
- Usage
- origin pr view 13
- Subcommand
- diff [target]
- Description
- View the diff for a pull request
- Usage
- origin pr diff
- Subcommand
- checks [target]
- Description
- Show CI status for a pull request
- Usage
- origin pr checks
- Subcommand
- requirements [target]
- Description
- Show what a pull request still needs before it can merge
- Usage
- origin pr requirements
- Subcommand
- watch [target]
- Description
- Wait until CI settles, the pull request merges, its head moves, or a comment matches
- Usage
- origin pr watch
- Subcommand
- checkout [target]
- Description
- Fetch and check out the pull request branch
- Usage
- origin pr checkout 13
- Subcommand
- edit [target]
- Description
- Edit the title, body, base branch, labels or reviewers
- Usage
- origin pr edit -t "New title"
- Subcommand
- ready [target]
- Description
- Mark a draft as ready for review
- Usage
- origin pr ready
- Subcommand
- reviewer
- Description
- List, request and remove requested reviewers
- Usage
- origin pr reviewer list
- Subcommand
- review [target]
- Description
- Add a review
- Usage
- origin pr review --approve
- Subcommand
- comment [target]
- Description
- Add, edit or delete a discussion comment
- Usage
- origin pr comment -b "LGTM"
- Subcommand
- thread
- Description
- List, view, resolve, reopen and reply to review threads
- Usage
- origin pr thread list
- Subcommand
- merge [target]
- Description
- Merge a pull request, or a stack up to and including it
- Usage
- origin pr merge
- Subcommand
- close / reopen [target]
- Description
- Close or reopen a pull request
- Usage
- origin pr close
- Subcommand
- refresh [target]
- Description
- Snapshot a new version from the current refs
- Usage
- origin pr refresh
| Subcommand | Description | Usage |
|---|---|---|
| create (new) | Open a pull request against an Origin repo | origin pr create -t "Fix CI" |
| list (ls) | List pull requests in a repository | origin pr list |
| status | Show the pull requests relevant to you | origin pr status |
| view [target] | Display a pull request, optionally with its diff, checks, comments or agents | origin pr view 13 |
| diff [target] | View the diff for a pull request | origin pr diff |
| checks [target] | Show CI status for a pull request | origin pr checks |
| requirements [target] | Show what a pull request still needs before it can merge | origin pr requirements |
| watch [target] | Wait until CI settles, the pull request merges, its head moves, or a comment matches | origin pr watch |
| checkout [target] | Fetch and check out the pull request branch | origin pr checkout 13 |
| edit [target] | Edit the title, body, base branch, labels or reviewers | origin pr edit -t "New title" |
| ready [target] | Mark a draft as ready for review | origin pr ready |
| reviewer | List, request and remove requested reviewers | origin pr reviewer list |
| review [target] | Add a review | origin pr review --approve |
| comment [target] | Add, edit or delete a discussion comment | origin pr comment -b "LGTM" |
| thread | List, view, resolve, reopen and reply to review threads | origin pr thread list |
| merge [target] | Merge a pull request, or a stack up to and including it | origin pr merge |
| close / reopen [target] | Close or reopen a pull request | origin pr close |
| refresh [target] | Snapshot a new version from the current refs | origin pr refresh |
From cursor.com/docs/origin/cli/reference/pull-requests. Pull requests open ready for review by default; pass --draft for a draft.
A new pull request opens ready for review, and -d or --draft makes a draft unless the author's Never open PRs as drafts setting is on. The -f or --fill flag takes the title and body from your commits, and --push pushes the head branch without prompting when it isn't on the remote yet. The --diff, --checks, --comments and --agents flags shape only the plain-text output of origin pr view. For JSON, request fields such as files, mergeability, ciState, comments or threads, and filter them with jq.
origin pr create -t "Fix CI" --push --status open origin pr checks --watch origin pr review --approve -b "Checked the retry path" origin pr merge --auto
The --auto flag turns on merge-when-ready: the merge happens once the requirements are met, and --disable-auto turns it off for one pull request. In a stack, a direct merge lands every open pull request from the stack root up to yours as one commit, and lands nothing if any of them is blocked. With --auto, Origin waits until yours is the lowest open member of the stack, and --auto --downstack also arms the ones below it. Pushing to the head branch snapshots a new version on its own, so run origin pr refresh only when view or checks still report the previous head commit.
Every review comment belongs to a thread with its own resolution state, and thread IDs start with cth_. For a merge gate, origin pr thread list --unresolved --json id | jq length prints the number of open threads. A formal review comes from origin pr review and a discussion comment from origin pr comment, and origin pr view --comments lists both.
Which options, environment variables and channels should you know?
The CLI reads five environment variables. CURSOR_AUTH_TOKEN beats every other credential, CURSOR_API_KEY applies when it's unset, and CURSOR_ORIGIN_ENDPOINT points the CLI at an API server. Older guides show --auth-token and --endpoint as global flags, but the current reference lists neither and reads those values from the environment.
- CURSOR_AUTH_TOKEN
- Cursor auth token, used directly as a bearer token. Takes precedence over every other credential.
- CURSOR_API_KEY
- API key, exchanged for a session and never stored. Used when CURSOR_AUTH_TOKEN is unset; origin auth login asks before using it in an interactive shell.
- CURSOR_ORIGIN_ENDPOINT
- API server endpoint (default: https://api.origin.cursor.com)
- ORIGIN_REPO
- Default repository in org/name format when you omit -R or --repo
- NO_COLOR
- Turn off colored output
From the Environment variables table of the commands reference.
The api command is the escape hatch for anything without its own command. It makes an authenticated request to the Origin REST API at api.cursor.com/v1/origin and takes request flags similar to gh api: -X for the method, -H for headers, -F and -f for fields, and --input for a body file. The --verbose flag prints headers to stderr, --silent drops the body, and you filter JSON by piping it to jq. The {owner}, {repo} and {branch} placeholders expand from -R, then ORIGIN_REPO, then the origin git remote.
Updates come from the stable channel by default. Running origin update moves you to the current release on your channel, and --force reinstalls even when you're current. Switch channels with origin config set-channel latest or stable, and check yours with origin config get-channel.
The docs don't say which channel to use. We'd stay on stable unless a fix you need is only on latest.
Shell completion is one line: append the output of origin completion to your shell config, and branch-valued flags such as --head and --base complete local branch names. The agent group is for coding agents. Running origin agent prompt prints a usage guide for your installed version, and origin agent setup installs a skill that points Cursor, Claude Code or Codex to it.
Frequently asked questions
Is the Origin CLI the same as the Cursor CLI?
No. The Origin CLI is the origin binary for Origin code hosting: auth, repositories, pull requests, stacks, rulesets, SSH keys, apps and the Origin API. The Cursor Agent CLI is a separate binary called agent, documented under Cursor's CLI section. Cursor's docs state the distinction explicitly.
How does the Origin CLI know which repository to use?
By default, from the git remote named origin in the checkout you run it from. Set ORIGIN_REPO to choose a repository for the whole shell, or pass -R or --repo in org/name format. The -R flag wins over ORIGIN_REPO, which wins over the git remote.
Does origin pr create open the pull request immediately?
Yes. A new pull request opens ready for review by default. Pass -d or --draft to create a draft instead, unless the author has turned on the Never open PRs as drafts setting, which opens it ready anyway. Add -f to reuse your commit messages for the title and body, and --push if the branch isn't on the remote yet.
How do I sign in to the Origin CLI without a browser?
Pass --api-key to origin auth login, or set CURSOR_AUTH_TOKEN or CURSOR_API_KEY and skip the login. The CLI uses CURSOR_AUTH_TOKEN first, then CURSOR_API_KEY, then a stored login. With CURSOR_API_KEY set, origin auth login asks before using the key in an interactive shell and defaults to the browser, while in a non-interactive shell such as CI it logs in with the key.
Can I script a check that every review thread is resolved?
Yes. The reference gives origin pr thread list --unresolved --json id | jq length, which prints the number of unresolved threads on the targeted pull request. Zero means every thread is resolved.
Sources & last verified
- Cursor Docs: Origin CLI commands
- Cursor Docs: Origin CLI pull request commands
- Cursor Docs: Install the Origin CLI
- Cursor Docs: Clone, Push & Pull
- Cursor Docs: Pull requests on Origin
- Cursor Docs: Origin stack commands
- Cursor Docs: CloneKit in CI
Cursor ships frequently. Facts verified against primary sources on October 28, 2026.