CLI Reference
CLI Reference
The rnx CLI is the operational surface for booting shells, opening sims, driving automation, and exposing the bridge host to agents.
Commands
| command | description |
|---|---|
maestro | author, generate, and run Maestro YAML flows against rnx |
detox | run existing Detox suites against rnx on headless Chromium |
cleanup | inspect and reclaim local rnx disk usage |
record | capture the live sim as webm/mp4/gif, or sample N png frames (—frames) |
film | record a flow on the flat canvas, play it back on the 3d device stage under a camera cinematic, save a clip |
storage | manage guest app storage and launch profiles |
permissions | inspect and change simulated operating-system permissions |
perf | CPU, React render, shell frame, and scroll-layer profiling |
describe | curated human-readable UI summary (default inspection tool) |
find | locate nodes by text / testID / role / type / predicate |
assert | run any read verb and convert its output into an exit code |
screenshot | capture PNGs and manage App Store screenshot assets |
get | read runtime state (tree, a11y, layout, url, count, errors, …) |
do | drive the app (tap, type, scroll, swipe, key, reload, …) |
wait | block until the runtime reaches a known state |
shell | drive shell state and simulator chrome |
mode | toggle screenshot and 3D display modes |
device | inspect or change the live device preset for a sim |
network | inspect live network traffic from the running rnx worker |
logs | inspect live console output from the running rnx worker |
debug | drive __sootsimDebug: channels, snapshots, and inspectors |
what-happened | show recent semantic events: toasts, keyboards, screens, alerts, fetches, errors |
timeline | control the semantic event timeline (enable opt-in kinds, clear, dump) |
ios | start an iOS simulator |
android | start an Android simulator |
open | load a target into the current sim or open a new one |
list | list connected sims or available launch drivers |
use | select a connected sim |
skill | install and inspect bundled rnx agent skills |
claim | take an exclusive lease on a sim |
agent | attached projects + local agent sessions (codex/claude) |
close | close a connected sim |
setup | configure optional local conveniences |
compat | check package compatibility |
report-issue | send an explicitly approved compatibility report |
desktop | launch or install the desktop companion |
daemon | manage the recommended background bridge service |
version | show the CLI + engine runtime versions you are running |
upgrade | update the rnx CLI and engine runtime to the latest |
serve | run the rnx bridge in the foreground |
runtime | manage engine runtimes under ~/.rnx/runtimes/ |
auth | inspect active CLI auth |
login | sign in for preview uploads |
logout | clear the local desktop auth session |
config | manage local CLI preferences |
Global Flags
| flag | description |
|---|---|
-h, --help | show help |
-V, --version | show version |
-v, --verbose | verbose output |
-p, --port <number> | bridge port, depending on command |
-d, --device <model> | override the simulated device model |
-t, --theme <scheme> | override light, dark, or auto color scheme |
--headless | run browser automation without a visible window where supported |
What The CLI Covers
The CLI is split across four jobs:
- +booting a simulator shell around a local React Native bundler
- +opening, listing, and targeting live sims over the shared bridge host
- +automating those sims for Maestro/Detox tests, screenshots, and recordings
- +exposing the same bridge-backed runtime to CLI automation and generated docs
If you only remember one rule, use the highest-level command that matches the task. Reach for rnx open before pasting shell URLs, and rnx describe before debugging with screenshots.
Command Groups
The command set is intentionally shaped around workflow instead of implementation detail.
- +setup and development:
setup,open,desktop - +agent onboarding:
skill installinstalls the bundled rnx workflow skills - +storage:
storage - +automation:
maestro,detox,record,screenshot - +live control:
open,list,use,claim,close - +runtime reads:
describe,find, and theget <noun>family (get tree,get a11y,get layout --styling,get url,get count,get errors,get requests, …) - +runtime actions: the
do <action>family (do tap,do type,do scroll,do swipe,do key, …), plusshell <action>for simulator chrome - +instrumentation:
perffor profiling anddebugfor raw runtime dumps, channels, snapshots, diffs, and events - +compatibility:
compat, plus the explicitly approvedreport-issuefeedback path
That grouping is what the website docs and terminal help now share from the same package source.
Bridge Model
The bridge host is the control plane behind top-level verbs like describe and do tap, plus debug, open, list, use, claim, and close.
- +default bridge port:
7668 - +default shell URL:
http://localhost:7668/ - +every connected sim gets a stable hex id like
a1,a2, …,af,b0 - +browser sims use isolated Playwright Chrome for Testing profiles; the desktop companion uses Electron
- +
rnx openreuses the saved sim by default.--new,--profile, and--ephemeralexplicitly request a separate sim - +the first CLI to send a command to a sim holds a 60s lease on it. other agents are rejected until the lease expires or, last-resort, taken with
rnx claim --force(which interrupts whoever’s mid-flow; preferrnx open --newto get a fresh sim instead). the lease refreshes on every command from the owner
This means you can open a sim one way and still inspect or debug it later from the CLI. The CLI also remembers the last sim you opened or selected, so one common pattern is:
Local Setup And CI
Start the app’s Metro, Expo, React Native, or One development server with its existing command. rnx does not start or replace that server. Run rnx open <port> from the app project root when possible. That directory is the fallback for custom-font, splash-screen, and project-configuration discovery when the development server does not advertise its root.
The local bridge is a lightweight HTTP and WebSocket server at http://localhost:7668/ by default. The background service keeps that bridge and the runtime ready between commands. It is strongly recommended for local agent work because inspect, interaction, and test commands start much faster. It remains optional: enable it any time with rnx daemon install. CI can install the standalone CLI with curl -fsSL https://rnxsim.com/install.sh | RNX_NO_MODIFY_PATH=1 sh and run rnx open <port> --driver playwright --headless; the command starts the bridge for the job without registering an operating-system service. The rnx installer itself does not require Node.js, npm, or Bun.
Coding agents should run rnx skill install once, then restart their session so they load the bundled setup, debugging, testing, visual, and performance workflows.
Common Flows
Multiple Sims
When more than one sim is connected, run rnx list first and pass --sim to the command you care about. The CLI remembers the last sim you opened or used, so explicit --sim matters most when you are juggling more than one target and want deterministic automation.
Passing --sim <sim> also skips the CLI’s identity lookup entirely. If you need a stable identity without pinning a sim on every call, export RNX_CLI_IDENTITY=<any-stable-string> once for your shell or agent run.
Auto-Settle After Writes
Every rnx do <write> command (tap, tap-id, type, scroll, drag, swipe, etc.) briefly waits for layout to stabilize before returning: capped at 200ms (400ms when an agent environment is detected), bailing on 2 consecutive stable frames. This keeps the next CLI call from capturing mid-animation state, which is the single most common source of agent confusion (do tap then describe showing a half-slid screen). When the auto-wait hits its cap without stabilizing, it warns that the next command may see mid-animation state and points at rnx do settle for a longer wait, so agents know what happened.
Opt out with --no-wait on the command, or RNX_NO_AUTO_WAIT=1 for the sim. For longer waits (e.g. screens that animate slowly), chain an explicit rnx do settle <seconds> or rnx wait idle after the write.
Agent detection is automatic: CLAUDECODE, CLAUDE_CODE_ENTRYPOINT, CODEX_THREAD_ID, CURSOR_TRACE_ID, AIDER_MODEL, or explicit RNX_AGENT=1 enables agent-friendly defaults. Set RNX_AGENT=0 to force interactive defaults.
Explicit Waits
rnx wait <kind> gives you bounded, loud synchronization primitives instead of sleep guessing:
- +
rnx wait readyblocks until the guest app bundle is loaded and painted. A persistent runtime readiness flag is cleared on bundle reload and reset by full page reload, avoiding node-count heuristics that can mistake the connection screen for a loaded app. It is idempotent and returns immediately when the app is already ready. The default timeout is 20 seconds; pass--max-ms 30000for slow cold bundles. CLI-side polling has no bridge timeout ceiling. Run it after opening a new sim or afterdebug js "window.location.reload()"; nosleepis needed. - +
rnx wait idleblocks until animations, rAF queue, and layout all stop moving. Same signal asdo settlebut discoverable under thewaitgrouping. - +
rnx wait selector <testid>blocks until a node with that testID is present and laid out. Playwright-style. Whenrnx find --testid fooreturns no result, the CLI prints this as a hint.
All wait subverbs accept --max-ms <ms> and exit non-zero on timeout, so scripts fail loudly.
rnx do <tap|double-tap|long-press> also accept --testid <id> or --text <text> to resolve a node center at call time, equivalent to do tap-id / do tap-text but consistent with find --testid. A missing node prints the wait selector hint.
Flow Drafting
When rnx maestro start is active, successful write commands like tap, tap-id, type, scroll, and swipe update the pending flow candidate. They do not automatically become part of the draft. Use rnx maestro keep only after the last action proved itself.