Cursor Origin
Cursor Origin CLI Reference: Every origin Command, Explained
The Origin CLI is one binary, origin, with nine command groups: auth, repo, pr, ruleset, ssh-key, api, completion, update and config. Install it with Cursor's script, run origin auth login, and 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 its Origin code hosting: sign-in and git credentials, repositories, pull requests, rulesets, SSH keys and a raw API escape hatch, all under one origin command. 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 things the docs say up front that are worth repeating, because both are easy to get wrong on day one. First, origin is not the Cursor Agent CLI; that one is a different binary called agent and lives under its own docs section. Second, the CLI is in early beta along with the rest of Origin, and the docs ask for feedback at hi@cursor.com rather than promising the surface is final.
If origin is not found after the install script runs, the binary landed in ~/.local/bin and that directory is not on your PATH. The fix the docs give is the usual one for zsh: add an export line to ~/.zshrc and source it. Everything in this reference assumes that step is done, and that origin --help prints a command list.
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?
Nine groups, and the reference page lists them in a single table with a one-line usage example each. The shape will feel familiar if you use gh: a noun, then a verb, with a repository inferred from the checkout you are standing in. Four global options work with any command: --auth-token (or the CURSOR_AUTH_TOKEN variable), --endpoint (default https://origin.cursor.com), --version and --help.
- Group
- auth
- What it does
- Sign in, sign out, and configure git authentication
- Example
- origin auth login
- Group
- repo
- What it does
- Create, list, view, clone, and delete repositories
- Example
- origin repo create my-project
- Group
- pr
- What it does
- Create, review, and merge pull requests
- Example
- origin pr create
- Group
- ruleset (alias rs)
- What it does
- View Origin rulesets, merge-time and push-time
- Example
- origin ruleset 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
- completion
- What it does
- Print a bash or zsh tab-completion script
- 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, list, view, clone, and delete repositories | origin repo create my-project |
| pr | Create, review, and merge pull requests | origin pr create |
| ruleset (alias rs) | View Origin rulesets, merge-time and push-time | origin ruleset 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} |
| completion | Print a bash or zsh tab-completion script | 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 subcommands have their own reference page.
Most commands infer the repository from the origin git remote in your current checkout. Override it with -R or --repo in org/name format, so origin pr list -R acme/checkout works from anywhere. That default is convenient and it is also the one to remember when a command seems to act on the wrong repo: check which remote is called origin in the directory you ran it from.
How do the auth and repo commands work?
auth manages your session and the git credential helper, and the helper is the part most people actually want from it. origin auth login signs you in through the browser and configures git, so push and pull against Origin remotes need nothing further. The other three subcommands exist for the cases where that default does not fit.
- Subcommand
- login
- Description
- Sign in through the browser and configure git
- Options
- --api-key <key> to skip the browser flow (automatic when CURSOR_API_KEY is set); --local to configure the helper in this repo's git config only
- Subcommand
- setup-git
- Description
- Reconfigure the git credential helper for the Origin host
- Options
- --host <host>; --global (default true); --local for this repository only
- Subcommand
- status
- Description
- Show the current authentication method and account
- Options
- Subcommand
- logout
- Description
- Clear stored credentials
- Options
| Subcommand | Description | Options |
|---|---|---|
| login | Sign in through the browser and configure git | --api-key <key> to skip the browser flow (automatic when CURSOR_API_KEY is set); --local to configure the helper in this repo's git config only |
| setup-git | Reconfigure the git credential helper for the Origin host | --host <host>; --global (default true); --local for this repository only |
| status | Show the current authentication method and account | |
| logout | Clear stored credentials |
The --local variants scope the credential helper to one checkout; the default is the global git config.
repo covers the lifecycle of a repository from the terminal. Pass org/name to target one; origin repo create <name> without a slash creates it in your account's namespace, which is probably the right default for a personal experiment and the wrong one for anything a team will share. The create-mirrored subcommand is the CLI face of the Sync from GitHub button, and it takes a --github-enterprise-id for GitHub Enterprise Server that 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
- 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 | 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 |
| 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 |
From the Repositories section of the commands reference.
The confirmation prompt is the only guard on delete. A non-interactive shell has to pass --yes to get past it, so an agent or a CI job running origin repo delete has no second chance. Keep deletion a human command.
Rulesets and SSH keys are read-mostly from the CLI. origin ruleset list and origin ruleset view <id> show the merge-time and push-time rulesets configured for a repository, which is how you check from a terminal what the Rules and Protections tab enforces. origin ssh-key add, list and delete manage the public keys on your account; add takes a key file path and -t names the key.
How do you open, review and merge pull requests from the CLI?
origin pr has its own reference page and sixteen subcommands, and the targeting rule is the thing to learn first. Most of them take an optional target: a number selects that pull request, anything else is read as a branch name, and omitting it uses the open or draft pull request for your current branch. So origin pr view on a feature branch just works.
- Subcommand
- create
- 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 its diff, checks or comments
- 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
- checkout [target]
- Description
- Fetch and check out the pull request branch
- Usage
- origin pr checkout 13
- Subcommand
- edit [target]
- Description
- Edit the title, body, or base branch
- Usage
- origin pr edit -t "New title"
- Subcommand
- ready [target]
- Description
- Mark a draft as ready for review
- Usage
- origin pr ready
- Subcommand
- review [target]
- Description
- Add a review
- Usage
- origin pr review --approve
- Subcommand
- comment [target]
- Description
- Add a discussion comment
- Usage
- origin pr comment -b "LGTM"
- Subcommand
- thread
- Description
- List, resolve, reopen, and reply to review threads
- Usage
- origin pr thread list
- Subcommand
- merge [target]
- Description
- Merge a pull request
- 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 | 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 its diff, checks or comments | 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 |
| checkout [target] | Fetch and check out the pull request branch | origin pr checkout 13 |
| edit [target] | Edit the title, body, or base branch | origin pr edit -t "New title" |
| ready [target] | Mark a draft as ready for review | origin pr ready |
| review [target] | Add a review | origin pr review --approve |
| comment [target] | Add a discussion comment | origin pr comment -b "LGTM" |
| thread | List, resolve, reopen, and reply to review threads | origin pr thread list |
| merge [target] | Merge a pull request | 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 as drafts by default; pass --status open or use origin pr ready.
A few defaults change how you will use it. origin pr create makes a draft unless you pass --status open, and -f or --fill takes the title and body from your commits. --push pushes the head branch without prompting when it is not on the remote yet. On the reading side, --diff, --checks and --comments shape the plain-text output of origin pr view only; for JSON you ask for fields by name, such as files, mergeability, ciState, comments or threads, and filter them with -q and a jq expression.
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
merge --auto merges once the requirements are met and then returns, and --disable-auto switches that off again for one pull request. The refresh command is the one I initially misread. Pushing to the head branch snapshots a new version on its own; origin pr refresh exists for the case where view or checks still report the previous head commit, and it does nothing when the resolved commits already match the latest version. You should rarely need it.
Review threads are first-class. Every review comment belongs to a thread with its own resolution state, and origin pr thread list, resolve, reopen and reply manage them by id. The docs offer the one-liner a merge gate wants: origin pr thread list --unresolved --json id --jq length, which prints the number of open threads. Note the distinction the reference draws between review and comment: origin pr review files a formal review, origin pr comment adds a discussion comment, and origin pr view --comments lists both.
Which options, environment variables and channels should you know?
Five environment variables cover non-interactive use, and they map onto flags you have already seen. Set CURSOR_API_KEY and origin auth login skips the browser. Set ORIGIN_REPO and origin api has a repository to expand placeholders from when there is no origin remote. NO_COLOR does what it says.
- CURSOR_API_KEY
- API key for origin auth login. When set, login skips the browser flow
- CURSOR_AUTH_TOKEN
- Bearer token, the same value as --auth-token
- CURSOR_ORIGIN_ENDPOINT
- Default API server endpoint, the same value as --endpoint
- ORIGIN_REPO
- Default repository in org/name format for origin api when there is no origin remote
- NO_COLOR
- Turn off colored output
From the Environment variables table of the commands reference.
origin api is the escape hatch for anything without a first-class command. It makes an authenticated request to the Origin REST API at api.cursor.com/v1/origin and supports request flags similar to gh api: -X for the method, -H for headers, -F and -f for fields, --input for a body file and -q for jq. The {owner}, {repo} and {branch} placeholders in the path expand from -R, from ORIGIN_REPO, or from the origin git remote, in that order of explicitness.
Updates come from the stable channel by default. origin update moves you to the current release on your channel, origin config set-channel switches between latest and stable, and origin config get-channel tells you which you are on. For a tool this new I would stay on stable unless a specific fix is on latest, though the docs do not advise either way. Shell completion is one line, origin completion appended to your shell config, and once it is in place branch-valued flags such as --head and --base complete local branch names.
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, rulesets, SSH keys 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?
Most commands infer it from the git remote named origin in your current checkout. Override with -R or --repo in org/name format. For origin api with no remote, the ORIGIN_REPO environment variable supplies the default.
Does origin pr create open the pull request immediately?
It creates a draft by default. Pass --status open to open it directly, or run origin pr ready later. -f fills the title and body from your commits, and --push pushes the head branch if it is not on the remote yet.
How do I sign in to the Origin CLI without a browser?
Set CURSOR_API_KEY, or pass --api-key to origin auth login. The docs say that when CURSOR_API_KEY is set, login uses it without the flag. A bearer token can also be supplied with --auth-token or CURSOR_AUTH_TOKEN.
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 count of unresolved threads for 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 ships frequently. Facts verified against primary sources on August 22, 2026.