# CLI reference

Every `rebasely` command and flag. This page is generated from the CLI's own help, so it matches what `rebasely help` prints.

```sh
curl -fsSL https://rebasely.com/install | sh
```

The CLI is one file and needs Node.js 22.18 or later. `duragit` is an alias of `rebasely`. Every command takes `--json` for scripts, CI and agents. Exit codes: 0 when it worked, 1 when a check failed, 2 for a usage error or outside a git repository.

## General

| Command | What it does |
| --- | --- |
| `rebasely` | open the TUI |
| `rebasely help` | this help |

## Pull requests

| Command | What it does |
| --- | --- |
| `rebasely pr list` | pull requests: \[`--state open\|closed\|merged\|all`\] \[`--mine`\] |
| `rebasely pr view <n>` | one pull request, what blocks its merge, its reviews and comments: \[`--diff`\] \[`--tab a\|c\|b\|r\|v`\] (summary, code, kb, architecture, conversation) |
| `rebasely pr create` | `--title T` \[`--body B`\] \[`--head branch`\] \[`--base branch`\] \[`--draft`\] \[`--reviewer <email or user id>`\]... |
| `rebasely pr checkout <n>` | fetch the PR's head into the local branch pr/`<n>` and switch to it |
| `rebasely pr comment <n>` | `--body B` \[`--path file` `--line n` \[`--side new\|old`\]\] \[`--reply <comment id>`\] |
| `rebasely pr review <n>` | `--approve` \| `--request-changes` \| `--comment`, with \[`--body B`\] |
| `rebasely pr edit <n>` | \[`--title T`\] \[`--body B`\] \[`--draft` \| `--ready`\] |
| `rebasely pr close <n>` | close; rebasely pr reopen `<n>` reopens |
| `rebasely pr merge <n>` | merge on the server: \[`--method merge\|squash\|rebase\|ff`\] \[`--delete-branch`\] \[`--message M`\] |

## Branches

| Command | What it does |
| --- | --- |
| `rebasely branch list` | branches compared with the base branch |
| `rebasely branch show <name>` | one branch: `--tab a\|c\|b\|r` |

## Knowledge base and architecture

| Command | What it does |
| --- | --- |
| `rebasely kb list` | knowledge base docs and their state |
| `rebasely kb check` | KB shapes, links and staleness; exits 1 on problems |
| `rebasely arch check` | system.yaml against the code; exits 1 on errors |

## Actions

| Command | What it does |
| --- | --- |
| `rebasely runs list` | Actions runs: \[`--workflow file`\] \[`--branch b`\] \[`--status s`\] \[`--limit n`\] |
| `rebasely runs logs <run>` | a job's log: \[`--job key`\] \[`--attempt n`\] \[`--follow`\] |
| `rebasely runs cancel <run>` | cancel a run |
| `rebasely dispatch <workflow>` | start a manual run: \[`--ref branch`\] \[`--input name`=value\]... |

## Sandboxes

| Command | What it does |
| --- | --- |
| `rebasely sandbox create` | a sandbox branch: \[`--from ref`\] \[`--name n`\] \[`--ttl seconds`\] \[`--worktree path`\] |
| `rebasely sandbox list` | sandboxes of the repo: \[`--mine`\] \[`--ended`\] |
| `rebasely sandbox merge <s>` | merge a sandbox: \[`--into branch`\] \[`--mode ff\|merge\|squash`\] \[`--message M`\] \[`--expect sha`\] \[`--keep`\] |
| `rebasely sandbox delete <s>` | delete a sandbox |
| `rebasely sandbox checks <s>` | run the workflows that declare on: sandbox: \[`--wait`\] |

## Repositories

| Command | What it does |
| --- | --- |
| `rebasely repo create <org>/<name>` | create a private repository (needs repo:create, on by default after auth login): \[`--description D`\] \[`--default-branch B`\] \[`--readme`\] |
| `rebasely repo visibility <org>/<name> public\|private` | private at once with an owner's token; public (or a token that may not) asks an owner to approve with a passkey on `<host>`/approve and waits: \[`--no-wait`\] |

## Agents and approvals

| Command | What it does |
| --- | --- |
| `rebasely agent init` | add the Rebasely agent skill to this repo (.claude/skills/rebasely/): \[`--dir path`\] \[`--force`\] \[`--print`\] |
| `rebasely agent create` | ask an owner to approve a new agent identity: `--org O` `--name N` `--scopes a`,b `--repos r1`,r2\[:pattern...\] \[`--role writer\|reader`\] \[`--description D`\] \[`--expires days`\] \[`--caps key`=value,...\] \[`--no-wait`\]; its token comes back once, into the system keychain \[`--print-token`\] |
| `rebasely agent token <org>/<name>` | print an agent's token from the keychain (`REBASELY_TOKEN`=$(...)) |
| `rebasely approval wait <id>` | follow an approval request (started by an MCP tool, say) to its answer |
| `rebasely approval status <id>` | an approval request's state |

## Sign-in

| Command | What it does |
| --- | --- |
| `rebasely auth login` | sign git in with an access token you approve in the browser: \[`--org <slug>`\]... \[`--scopes <list>`\] \[`--expires <days>`\] \[`--yes`\] \[`--allow-plaintext-store`\]; `--all-orgs instead` of `--org`: one token for every organization you belong to, including ones you join later (90 days unless `--expires is` shorter, 365 at most) |
| `rebasely auth status` | the stored token's account, organizations, scopes and expiry |
| `rebasely auth logout` | revoke the stored token and remove it from git's credential helper |

## Live branches

| Command | What it does |
| --- | --- |
| `rebasely mount <org>/<repo> <branch> [<path>]` | edit a live branch in a real directory, synced as you save; works anywhere, and inside a clone `<org>`/`<repo>` may be left out. `<path>` defaults to ./`<repo>`-`<branch>`: \[`--host url`\] \[`--create`\] \[`--adopt`\] \[`--burst ask\|send\|hold`\] \[`--daemon`\] \[`--no-link`\] (`--repo org`/repo also names the repository) |
| `rebasely unmount <branch\|path> stop syncing and remove the mount: [--discard] [--repo org/repo]` |  |
| `rebasely mounts` | the mounts under the managed home and their state |
| `rebasely mount gc` | remove stale mounts that have no unsent edits |

## MCP

| Command | What it does |
| --- | --- |
| `rebasely mcp` | a stdio MCP server for local agents, proxied to `<host>`/mcp with your credential: \[`--host url\|staging\|production`\] |

## Hosts, tokens and the home folder

Actions and sandbox commands (runs, dispatch, sandbox) talk to the origin remote's server and repo, or to `--host <url|staging|production>` and `--repo <org>`/`<repo>`. The token comes from `REBASELY_TOKEN` (or DURAGIT\_TOKEN), else from git's credential helper for that host; it is never printed. auth talks to rebasely.com, or to `--env staging` or `--host <url>`; it never prints a token. Git over SSH was retired in 2026-11: use HTTPS. The managed home (mounts) is `$REBASELY_HOME`, else `~/.rebasely`, or `~/.duragit` when that is the one that exists. Every REBASELY\_ variable may also be given by its older DURAGIT\_ name.

> **Tip:** Point the CLI at staging or a local server with `--host <url|staging|production>` (or `--env staging` for `auth` and `ssh`). The token is only ever sent to Rebasely's own hosts, `$REBASELY_HOST` or a local development host.

---

Source: https://rebasely.com/docs/cli
