Rheo documentation
Developer Guide

CLI

Install and use the Rheo CLI to read and write workspace apps, flows, channels, experiments, analytics, rollouts, and media with a workspace API key.

Purpose

The Rheo CLI (@getrheo/cli) is a terminal client for workspace members. Use it to fetch and mutate product content (apps, flows, channels, experiments, rollouts, media) from scripts, CI, or agents without opening the dashboard.

It authenticates with a workspace API key (rheo_wk_…), not a publishable SDK key (ob_pk_…). Writes use the same capability checks as the dashboard for the key creator's current role.

Install

npm install -g @getrheo/cli
rheo --help

Or run without a global install:

npx @getrheo/cli --help

Requires Node.js 20+.

Create a workspace API key

  1. Sign in to the Rheo dashboard (any role: owner, admin, editor, or viewer).
  2. Open Account → Personal.
  3. Under CLI API keys, create a named key and copy the secret once.

Each key is bound to your user and one workspace. Mutations follow your live role; viewers can read but most product writes return 403.

Revoke unused keys from the same page. Rotating a key means create a new one, update login / RHEO_API_KEY, then revoke the old key.

Auth

rheo auth login --api-key rheo_wk_…
rheo auth status
rheo auth logout

Credentials are stored under ~/.config/rheo/config.json (or $XDG_CONFIG_HOME/rheo/config.json). Use --profile <name> for multiple profiles.

Aliases: rheo login / rheo logout (same as auth login / auth logout).

CI / env

export RHEO_API_KEY=rheo_wk_…
export RHEO_API_URL=https://api.getrheo.io   # optional; default production
rheo apps list --json
VariablePurpose
RHEO_API_KEYOverrides the saved profile key
RHEO_API_URLOverrides API base URL
RHEO_CONFIG_PATHCustom path for the config file

Default API base URL: https://api.getrheo.io. Override per command with --api-url.

Role → product writes

RoleTypical product writes
OwnerApps, flows, channels, experiments, media, rollout policy, approve/reject
AdminApps, flows, channels, experiments, media, approve/reject (when designated)
EditorFlows, channels, experiments, media, submit rollout requests
ViewerReads (product writes return 403)

Run rheo whoami to see your workspace, role, plan, and which write capabilities the key currently has.

Global flags

FlagDescription
--jsonMachine-readable list output (mutations, analytics, and stats always print JSON)
--body <json>Inline JSON request body for writes
--file <path>JSON request body from a file (writes); for media upload, the local file to upload
--confirm-name <name>Required for destructive app/channel delete or archive
--profile <name>Config profile
--api-url <url>Override API base URL
-h, --helpShow help

Prefer --file for large payloads (flow drafts, experiment configs).

Command reference

Auth and identity

rheo auth login --api-key <key> [--profile <name>] [--api-url <url>]
rheo auth logout [--profile <name>]
rheo auth status [--profile <name>]
rheo whoami
rheo workspace show   # alias of whoami

Apps

rheo apps list
rheo apps get <appId>
rheo apps create --body|--file
rheo apps update <appId> --body|--file
rheo apps branding <appId> --body|--file
rheo apps delete <appId> --confirm-name <name>

Flows

rheo flows list <appId>
rheo flows get <flowId>
rheo flows draft <flowId> [--out <file>]
rheo flows versions <flowId>
rheo flows version <flowId> <versionId> [--out <file>]
rheo flows create <appId> --body|--file
rheo flows update <flowId> --body|--file
rheo flows save-draft <flowId> --body|--file
rheo flows publish <flowId> [--body|--file]
rheo flows archive|unarchive <flowId>
rheo flows duplicate <flowId> [--body|--file]

Use --out on draft / version to write the manifest JSON to disk.

Channels

rheo channels list <appId> [--include-archived]
rheo channels history <appId> <channelId> [--limit N] [--offset N]
rheo channels create <appId> --body|--file
rheo channels update <appId> <channelId> --body|--file
rheo channels archive <appId> <channelId> --confirm-name <name>
rheo channels unarchive <appId> <channelId>
rheo channels assign <appId> <channelId> --body|--file
rheo channels unassign <appId> <channelId>

Experiments

rheo experiments list <appId> [--include-archived]
rheo experiments get <experimentId>
rheo experiments stats <experimentId> [--start] [--end] [--cohorts] …
rheo experiments stats-timeseries <experimentId>
rheo experiments cohort-keys <experimentId>
rheo experiments cohort-values <experimentId> --dimension <dim>
rheo experiments create <appId> --body|--file
rheo experiments update|delete <experimentId>
rheo experiments add-variant|reorder-variants <experimentId> --body|--file
rheo experiments update-variant|delete-variant <experimentId> <variantId>
rheo experiments status|extend|stop|promote <experimentId> --body|--file

Stats commands accept optional --start / --end (UTC dates), plus cohort filters (--cohorts, --cohort-dimension, --cohort-key, --custom-key) where applicable. --dimension is required for cohort-values.

Analytics

Default environment is live. If you omit --start / --end, the CLI uses the last 7 UTC days.

rheo analytics app-overview <appId> [--env live|test] [--flow-id <id>] [--start] [--end]
rheo analytics <kind> <flowId> [--env live|test] [--version-id <id>] [--start] [--end]

Flow analytics kinds: overview, funnel, dropoff, timeseries, timeseries-cohorts, cvr-heatmap, step-duration, cohorts, cohort-keys, purchases, responses.

For cohorts and timeseries-cohorts, pass --dimension. When --dimension=custom_property, also pass --custom-key.

Rollouts

rheo rollouts policy
rheo rollouts policy-set --body|--file
rheo rollouts list
rheo rollouts get <id>
rheo rollouts channel-list <appId> <channelId>
rheo rollouts submit --body|--file
rheo rollouts approve <id> [--body|--file]
rheo rollouts reject <id> [--body|--file]

Media

rheo media list
rheo media sign-upload --body|--file
rheo media confirm --body|--file
rheo media upload --file <path> [--type] [--content-type] [--name]
rheo media rename <assetId> --name-stem <stem>
rheo media archive <assetId>

media upload signs, uploads bytes, and confirms in one step. Omit --type / --content-type to infer from the filename.

Examples

List apps as JSON, then fetch a flow draft:

rheo apps list --json
rheo flows draft <flowId> --out draft.json

Publish a flow after editing a draft file:

rheo flows save-draft <flowId> --file draft.json
rheo flows publish <flowId>

Upload an image asset:

rheo media upload --file ./hero.png --name hero

Pull last-week funnel analytics for a flow (live):

rheo analytics funnel <flowId> --env live

Exit codes

CodeMeaning
0Success
1Usage error, validation failure, or non-auth HTTP error
2Unauthorized or forbidden (401 / 403)