Skip to main content
The Replicas CLI manages workspaces, environments, automations, media, and local connections.
For Coding Agents: If you’re using coding agents like Claude Code, Codex, Cursor, Muse Code, Opencode, or Pi, the CLI is the recommended way to work with Replicas from inside a workspace. Coding agents tend to perform better with bash commands than MCP integrations.

Installation

Requires Node.js 18 or newer.

Authentication

Opens a browser to authenticate with your Replicas account. If you belong to one organization, the CLI selects it automatically. Otherwise, it asks which one to use. The selection persists until you change it or lose access.

Connect a Coding Agent Account

To use Codex, Claude Code, or Muse Code inside Replicas workspaces, link the relevant OAuth account. Each command opens a browser to complete the provider OAuth flow and uploads the resulting credentials to Replicas. Cursor uses an API key configured in Organization → Coding Agents. Credentials attach to your personal account by default, which works in every organization you belong to:
Claude gives you a code to paste into your terminal; Codex completes authorization automatically. After credentials are saved, the browser notifies onboarding and returns to Replicas. The completion tab closes when onboarding regains focus; otherwise, it opens Replicas directly. Organization admins can pass --org to share one set of credentials with every member instead:
Check the signed-in account and active organization, or sign out:
Inside a workspace, replicas whoami instead prints that workspace’s ID and, when available, its organization ID.

Replica Management

Use a logged-in CLI session to manage workspaces interactively:
replicas list prints the IDs used by the other commands. replicas create prompts for any omitted name, environment, task, or coding agent; pass --environment, --message, and --agent to provide them directly. Deletion asks for confirmation unless you pass --force. Use the API or Automations instead of scripting these interactive commands. List connected repositories and their IDs with:

Environment Management

Manage Environments from the CLI. Use replicas environment or the shorter replicas env alias.

List Environments

Shows every environment in your organization, including its ID and the Global environment, with attached variable, file, skill, and MCP counts.

Get Environment Details

Shows one environment by name, UUID, or global.

Create an Environment

Creates an environment. Without a name or repository flag, the CLI prompts interactively. Options:
  • -d, --description <description> - Environment description
  • -r, --repository <name|id> - Repository to bind to the environment
  • --system-prompt <prompt> - System prompt for agents started in this environment
Example:

Edit an Environment

Updates environment metadata or its repository binding. Options:
  • -n, --name <name> - New name
  • -d, --description <description> - New description
  • -r, --repository <name|id> - Repository binding; pass an empty string to unbind
  • --system-prompt <prompt> - System prompt

Delete an Environment

Deletes an environment after confirmation. Options:
  • -f, --force - Skip confirmation prompt

Manage Environment Variables

Values are masked by default when listed. Pass --reveal to show full values.

Manage Environment Files

Files are written into new workspaces at the configured destination path.

Manage Warm Hooks

Manage environment-level hooks that run while workspaces are pre-warmed. get shows the active hook, save activates it immediately, test runs it without saving, save-test saves only after a passing test, and repository-hooks lists hooks from bound repositories. Every command that accepts --file also accepts inline --content. See Warm Hooks for the execution model.

Manage Start Hooks

Manage environment-level start hooks that run at workspace startup. See Start Hooks for the execution model.
  • get - show the active start hook
  • save - persist and activate a new version, or clear the active hook with empty content
  • test - run a hook in an isolated sandbox without saving (streams output live)
  • repository-hooks - list per-repo start hooks defined in replicas.json / replicas.yaml

Slack Thread Routing

Slack thread commands attach the current Slack thread to a workspace so replies in that thread route to the selected workspace. Agent mode targets only the current workspace. A newer, non-archived workspace can replace an older archived destination in the same organization; subsequent replies route to the newer workspace.
Find the target workspace ID in its app URL before switching. Both commands default to REPLICAS_SLACK_CHANNEL_ID and REPLICAS_SLACK_THREAD_TS. Pass --channel <id> and --thread-ts <ts> when attaching a different thread. Selecting a destination other than the current agent workspace, or replacing a non-archived destination, requires user authentication outside agent mode.

Preview Management

Preview commands register ports from a workspace as public URLs. Agent mode commands run inside a workspace and use the local agent configuration. Human mode commands run from your local terminal and target a workspace by ID.

Create a Preview

Registers a port from the current workspace and prints the public preview URL. This command is available in agent mode. Options:
  • -a, --authenticated - Require Replicas login cookies before the preview can be accessed. Use this for user-facing frontends, not backend APIs called by frontend code.

List Previews

Lists active preview URLs for the current workspace in agent mode. In human mode, pass the workspace ID:

Delete a Preview

Unregisters a preview port from the current workspace. This command is available in agent mode.

Add a Preview

Registers a preview port for a workspace from human mode. Options:
  • -p, --port <port> - Port number to preview
  • -a, --authenticated - Require Replicas login cookies before the preview can be accessed. Use this for user-facing frontends, not backend APIs called by frontend code.

Remove a Preview

Unregisters a preview port from a workspace in human mode. Options:
  • -p, --port <port> - Port number to unregister

Workspace Identity

Workspace identity (OIDC), including the AWS/GCP credential helpers, requires a Team or Enterprise plan or an active trial.
Obtains a short-lived workspace identity token for the audience you name. Audiences are not registered anywhere; the receiving service verifies aud exactly. Available in agent mode only.
Prints a token for replicas:workspace, or for the audience you pass. Options:
  • -a, --audience <audience> - Audience (aud) the receiving service verifies, usually its URL
  • --format <text|gcp> - Raw token (default), or JSON for Google’s executable credential source

AWS Credential Helper

Obtains a workspace token and exchanges it for temporary AWS credentials, printing the JSON expected by AWS credential_process. Credentials are cached and reused while more than 15 minutes remain. Requires the AWS CLI. See the AWS and Google Cloud sections for profile and credential configuration. Options:
  • --role-arn <arn> - Required IAM role that trusts the Replicas issuer
  • -a, --audience <audience> - Audience configured on the IAM OIDC provider, default sts.amazonaws.com
  • --region <region> - AWS region for the STS exchange
  • --session-name <name> - Role session name, default replicas
  • --source-identity - Record the workspace ID as the AWS source identity in CloudTrail. Off by default; the role’s trust policy must allow sts:SetSourceIdentity

Run a Command With a Token

Runs the command with REPLICAS_WORKSPACE_TOKEN and REPLICAS_WORKSPACE_TOKEN_AUDIENCE set to a fresh token. Quote the script so the variable is expanded by the command, not by the shell that launched it. Options:
  • -a, --audience <audience> - Audience (aud) the receiving service verifies

Service Management

Service commands run long-lived processes (dev servers, APIs, daemons) detached from the agent session. Detached services survive the agent’s turn ending and workspace sleep/wake, so a server started for a preview is still running after the workspace wakes. Available in agent mode only.

Start a Service

Starts the command as a detached daemon. Starting an existing name restarts it. Quote the command when it contains shell operators. Options:
  • -d, --cwd <dir> - Working directory for the service (defaults to the current directory)

List Services

Lists registered services with pid and running/stopped status.

Service Logs

Prints the last lines of the service log (~/.replicas/services/<name>.log). Options:
  • -n, --lines <n> - Number of lines to print (default 50)

Stop a Service

Stops the service and its whole process group.

Computer Use

Drives the workspace’s Linux desktop through the replicas-computer daemon. The live H.264 and Opus stream is automatically published as an authenticated preview on port 6080 at engine startup, so the app’s Desktop tab is always available without any agent action. Available in agent mode only. Multiple viewers can watch the same desktop concurrently. Input commands from separate agents are serialized as complete gestures so clicks, typing, scrolling, and drags do not interleave.

Get the Viewer URL

Prints the live desktop viewer URL (https://6080-<hash>.replicas.dev/). Use this when you want to share the stream out-of-band; the app already points at the same authenticated URL.

Session Status

Checks and repairs the desktop bridge, then shows which desktop services are running and the active preview URL.

Screenshot

Captures the desktop to a PNG. By default, the image includes Replicas branding for sharing with replicas media upload. Use --raw for a 1:1 desktop capture with no padding or branding. Use --grid for a 1:1 capture with a coordinate grid; the optional value sets grid spacing in pixels and defaults to 100. Prefer --grid when choosing coordinates for click, move, or drag.

Observe

Waits briefly for the screen to stop changing, saves a 1:1 desktop screenshot, and prints JSON context: dimensions, stability, frame/change counts, mouse location, active window title, and visible window titles. By default, observe waits up to 3s for 600ms of visual stability and saves a 100px coordinate-grid screenshot. Use it after clicks, navigation, typing, or page loads when an agent needs the next reliable screen state.

Browser State

Waits for a Chrome page to settle, saves its viewport screenshot, and returns a compact native accessibility tree in the same coordinate space. Actionable nodes have document-bound refs such as [ref=42] button "Save". The tree includes roles, accessible names, values, states, visible bounds, and same-target iframe content. The first capture returns the full tree. Later captures for the same target and document return accessibility changes by default; navigation or reload forces a new full tree and invalidates old refs. Use --full to reset the baseline. Prefer this over coordinate planning for Chrome. Use replicas computer browser [--snapshot] to list Chrome tabs or request the compatibility snapshot format.

Browser Batch

Runs up to 100 ordered click, fill, key, type, scroll, or wait actions through one Chrome session. The batch stops at the first failure and reports per-action and total execution time. Use refs from one browser-state; after navigation or a document change, capture fresh state before starting another batch.

Browser Click

Scrolls the referenced node into view and sends trusted mouse input at its current visible bounds. Refs come from browser-state. Text matching remains available as a fallback with browser-click <text>.

Browser Fill

Focuses the referenced field, fills it with trusted browser input, and verifies the resulting value. Select controls use their semantic option value; typed controls such as date, number, and range inputs use their native value setter. Text matching remains available as a fallback with browser-fill <field> <value>.

Browser Input

Sends trusted wheel or keyboard input directly to the selected Chrome target. Use browser-fill when setting a known field value; use browser-key and browser-type for keyboard-driven widgets.

Browser Wait

Waits until the active Chrome page matches text in the title, URL, body text, or visible controls. Use --mode title|url|text|control|any to narrow where it matches. Prefer this after browser-click or browser-fill when waiting for web app state. For browser state and actions, pass --target-id <id>, --title <text>, --url <text>, or --page <n> when multiple Chrome tabs are open. Prefer the stable target ID returned by computer launch chrome because titles and URLs can change after an action. The matched tab is brought to the foreground before each action, so driving multiple tabs or recording the screen switches which tab is visible.

Mouse Input

Mouse coordinates can be pixels (960 540) or percentages (50% 50%). Percentages resolve against the current display size. Click options: --button <n> (1/2/3), --double, --modifiers <ctrl+shift> Scroll options: --amount <n> (default 3), --x <x> --y <y> (hover before scrolling)

Keyboard Input

Type options: --delay <ms> (default 12, ~80 wpm)

Launch an App

Pass a URL directly when opening a known page, for example replicas computer launch chrome http://localhost:3000/. Chrome launches return after the requested page is controllable and print its page ID. Carry that ID with --target-id into browser snapshots and actions so unrelated tabs cannot steal task context.

Screen Recording

Record options: --fps <n> (default 60) Recordings are post-processed from the desktop action log: clicks, typing, drags, and scrolls stay at normal speed, idle gaps are accelerated, click moments get eased camera zoom, and a synthetic cursor animates between logged mouse positions with natural settling before spaced-out clicks. record start returns after ffmpeg writes the first bytes. record stop waits for ffmpeg to finalize before post-processing; a timeout preserves the recording state so stopping can be retried safely.

End-to-End Example

Canvas vs replicas media upload

Two related surfaces share the workspace VM:
  • The Canvas at ~/.replicas/canvas/ accepts files up to 25MB, including chat attachments. Inline previews and downloads are capped at 5MB.
  • replicas media upload is the right place for screenshots, screen recordings, generated videos, audio clips, and anything large enough that base64-inflating it through the engine on every app fetch would be wasteful. Images always get a public link that works in chat and on GitHub. Video and audio return a chat-only embed URL (or a public link with --access public). Every upload also prints an app deep-link, then a reminder to paste the embeds verbatim in the chat reply and to upload the file itself to Slack, Linear, or GitLab.
  • replicas media upload <page.html> --name "<name>" --access organization prints a stable Forge link for pull requests. It opens in a dedicated sandboxed viewer, requires Replicas sign-in and organization membership, and returns signed-out members to the page after authentication.
  • Include the printed HTML page link in an agent reply to render the page directly in chat, with Open and Download controls.
  • Public links are unguessable, revocable bearer URLs: anyone with the URL can view the file. HTML pages only support organization access. --share is an alias for --access public. Rotate a link with replicas media share <media-id> (this breaks the old link) and revoke it with replicas media revoke <media-id>.
  • For inline images in GitHub PRs, copy the printed image embed into the PR body alongside its View in Replicas link. GitHub’s native attachments (gh --attach) don’t accept Replicas’ GitHub App tokens, and chat-only URLs can’t render on GitHub.
  • Each upload shows a human-readable display name in the app. --name is required, one per file in order (e.g. replicas media upload a.png b.png --name "Before" --name "After"). Names are normalized to hyphen-case (my-screenshot), the backend still addresses media by UUID, and duplicate names get a -1, -2 suffix.
Rule of thumb: use Canvas for workspace files such as plans and reports. Use replicas media upload for captured media, HTML previews in chat, or HTML pages shared outside the workspace.

Automation Management

Manage Automations directly from the CLI. All commands support both flag-based (scriptable) and interactive input modes. Use the alias auto for brevity (e.g. replicas auto list).

List Automations

Shows all automations in your organization with their status, triggers, and schedule. Options:
  • -p, --page <page> - Page number for pagination
  • -l, --limit <limit> - Number of items per page
  • --owner <org|user|all> - Show org automations, your personal automations, or both
  • --trigger-type <type> - Only automations with a trigger of this type: cron, github, gitlab, slack, sentry, custom
  • --enabled <true|false> - Only enabled or only disabled automations
  • --background <true|false> - Only Background or only main-list automations
  • --search <search> - Case-insensitive substring match on the name
Any GitHub checks an automation reports on are listed too, so you can see which ones are already configured.

Get Automation Details

Shows detailed information about a specific automation including triggers, prompt, environment, cron schedule, and lifecycle policy.

Create an Automation

Creates a new automation. If options are not provided, the CLI will prompt interactively. Options:
  • --prompt <prompt> - Prompt the agent will receive
  • --environment <name|id> - Environment the automation runs in (see Environments)
  • --trigger-cron <expression> - Cron schedule (e.g. "0 9 * * 1-5")
  • --trigger-cron-timezone <tz> - Timezone for cron trigger (default: UTC)
  • --trigger-github <event> - GitHub event trigger (e.g. pull_request.opened)
  • --trigger-github-repos <repos> - Comma-separated repository names to filter GitHub triggers
  • --trigger-github-exclude-users <users> - Comma-separated GitHub usernames whose events should not fire the trigger
  • --trigger-gitlab <event> - GitLab event trigger (e.g. merge_request.opened)
  • --trigger-gitlab-repos <repos> - Comma-separated project names to filter GitLab triggers
  • --trigger-gitlab-exclude-users <users> - Comma-separated GitLab usernames whose events should not fire the trigger
  • --github-checks <names> - Comma-separated GitHub check names to report the run’s verdict on (requires a PR opened/updated trigger)
  • --lifecycle <policy> - Workspace lifecycle: default, archive_when_done, or sleep_when_done
  • --sleep-when-done - Shortcut for --lifecycle sleep_when_done
  • --auto-stop-minutes <minutes> - Inactivity timeout for the default lifecycle policy
  • --pr-followups - Allow follow-up actions on matching PRs
  • --agent-provider <provider> - Coding agent to use: claude, codex, cursor, muse, opencode, or pi (or none to inherit org default)
  • --model <model> - Model identifier (must be valid for --agent-provider; pass none to clear)
  • --thinking-level <level> - Thinking/reasoning level: low, medium, high, xhigh, max, Codex/Muse ultra, or Claude Code-only ultracode (or none to clear)
  • --plan-mode - Run automation messages in plan mode
  • --goal-mode - Set automation messages as goals
  • --fast-mode - Run automation messages in fast mode
  • --personal - Create a personal automation owned by you
  • --in <duration> - Run once after 30m, 2h, 3d, 1w, 1d12h, etc. Inside a workspace, runs come back to that workspace unless --workspace says otherwise
  • --at <datetime> - Run once at an ISO-8601 time with a timezone, e.g. 2026-10-08T09:00:00-07:00
  • --max-runs <n> - Delete the automation after n runs (none for unlimited)
  • --workspace <target> - new (new workspace each run), reuse (one workspace created on the first run), current (this workspace), or a workspace ID. See Workspace and run limit
  • --background - Keep it in the Background section instead of the main list
  • --disabled - Create the automation disabled
Example:
To ignore bot or user activity on code-host triggers:

Edit an Automation

Updates an existing automation. Without flags, opens interactive mode pre-filled with current values. Options:
  • --name <name> - New name
  • --prompt <prompt> - New prompt
  • --enabled <true|false> - Enable or disable
  • --trigger-cron <expression> - Replace triggers with a cron trigger
  • --trigger-cron-timezone <tz> - Timezone for the cron trigger
  • --trigger-github <event> - Replace triggers with a GitHub event trigger
  • --trigger-github-repos <repos> - Comma-separated repository names to filter GitHub triggers
  • --trigger-github-exclude-users <users> - Comma-separated GitHub usernames to exclude. Without --trigger-github, updates existing GitHub triggers. Pass an empty string ("") to clear existing GitHub exclusions.
  • --trigger-gitlab <event> - Replace triggers with a GitLab event trigger
  • --trigger-gitlab-repos <repos> - Comma-separated project names to filter GitLab triggers
  • --trigger-gitlab-exclude-users <users> - Comma-separated GitLab usernames to exclude. Without --trigger-gitlab, updates existing GitLab triggers. Pass an empty string ("") to clear existing GitLab exclusions.
  • --github-checks <names> - Comma-separated GitHub check names to report the run’s verdict on. Replaces the current list; pass an empty string ("") to stop creating checks.
  • --add-github-checks <names> - Comma-separated check names to add, keeping the ones already configured. Use this when adding checks across existing automations, so a name someone else configured is never dropped.
  • --environment <name|id> - Move the automation to a different environment
  • --lifecycle <policy> - Workspace lifecycle: default, archive_when_done, or sleep_when_done
  • --sleep-when-done - Shortcut for --lifecycle sleep_when_done
  • --auto-stop-minutes <minutes> - Inactivity timeout for the default lifecycle policy
  • --pr-followups <true|false> - Toggle whether matching PRs can receive follow-up actions
  • --agent-provider <provider> - Coding agent to use: claude, codex, cursor, muse, opencode, or pi (or none to inherit org default)
  • --model <model> - Model identifier (must be valid for --agent-provider; pass none to clear)
  • --thinking-level <level> - Thinking/reasoning level: low, medium, high, xhigh, max, Codex/Muse ultra, or Claude Code-only ultracode (or none to clear)
  • --plan-mode <true|false> - Enable or disable plan mode
  • --goal-mode <true|false> - Enable or disable goal mode
  • --fast-mode <true|false> - Enable or disable fast mode
  • --in <duration> / --at <datetime> - Replace the triggers with a one-time schedule
  • --max-runs <n> - Total run limit, including runs already used (none for unlimited)
  • --workspace <target> - new, reuse, current, or a workspace ID
  • --background <true|false> - Move to or from the Background section

Run an Automation

Manually triggers an automation. Only automations with a cron trigger can be run manually.

Delete an Automation

Deletes an automation. Options:
  • -f, --force - Skip confirmation prompt

Report a GitHub Check

Reports this run’s verdict on one of its GitHub checks. Run from inside an automation workspace, which is what identifies the run that owns the check. Options:
  • --token <token> - Ownership token for this check, copied from the prompt (required)
  • --conclusion <conclusion> - success or failure (required)
  • --title <title> - One-line verdict shown on the check (required)
  • --summary <summary> - What was checked and why it passed or failed
Prints a notice instead of writing when a newer run of the same automation has taken the check over. That is expected, not an error.

Workspace Connection

Connect via SSH

Opens an interactive SSH session to the workspace. Multi-word names work with or without shell quotes:
SSH access is unavailable for the Mothership workspace. Open it in the Replicas web app instead.

Forward a Port to Localhost

Makes a service in the cloud workspace available on the same port at 127.0.0.1. Keep the command running while you use the service. To bind a different local port:

Open in VS Code

Opens the workspace in VS Code via Remote SSH. Run replicas code to pick a workspace with the arrow keys and Enter, or pass a workspace name or ID directly. Names with spaces work with or without quotes. Set a different IDE command, such as Cursor, and inspect the current CLI configuration with:

Switch Organization

The active organization is where org-scoped commands read and write, including credentials saved by claude-auth, codex-auth, and muse-auth. The CLI selects it automatically when you belong to only one organization; otherwise, you choose. The selection persists across sign-outs until you change it or lose access.
replicas claude-auth, replicas codex-auth, and replicas muse-auth save to your personal account unless you pass --org, which shares the credentials with every member of the active organization and requires the admin role. These commands show your account, role, credential, and destination for confirmation before opening your browser, and confirm where the credentials landed on success. While an organization is still in onboarding, an admin’s personal connection also becomes the organization default. Pass -y, --yes to skip the confirmation in scripts. Personal credentials take priority over organization defaults.

Repository Configuration

Repository-level workspace setup is driven by replicas.json or replicas.yaml. Both formats use the same schema — YAML is especially useful for multiline system prompts. Create a starter file in the current repository:
See Repository Configuration for the full schema.