Reflex Docs
CLI

reflex connect

Run a closed-loop robot session from your terminal with a single command.

reflex connect is the end-to-end command for running inference on a real robot. It opens a streaming session, reads observations from your robot, streams them to inference, and applies the returned action chunks.

The hardware, transport, and execution loop are all described by a YAML config. See Connect config reference for every field.

Usage

reflex connect --config robot.yaml

A minimal robot.yaml:

mode: dry_run
target:
  kind: webrtc
  base_model: molmoact2-bimanualyam
hardware:
  kind: yam_bimanual
  config:
    left:  { channel: can1, gripper: linear_4310 }
    right: { channel: can0, gripper: linear_4310 }
cameras:
  top: { kind: shm, name: top }

Everything about the run — the transport, the hardware, the mode (dry_run vs apply_actions), control rate, cameras — lives in the config, not in CLI flags. See the config reference.

Flags

FlagDefaultDescription
--configrequiredPath to the YAML config that describes the session.
--record~/.reflex/recordings/<user>/<session>/Directory to record frames, state, and actions for offline eval.
--formatlerobotComma-separated recording formats: lerobot, jsonl, mcap, rerun.
--no-recordoffDisable recording for this run (same as REFLEX_NO_RECORD=1).
--api-keyREFLEX_API_KEY / saved loginAPI key override.
--convex-urlproductionBackend URL override; only set if you've been told to.
--jsonoffEmit a structured JSON result.
--verbose, -voffShow driver-level logs (motor init, ICE candidates, per-step vectors).

Recording is on by default. The JSON result is shaped as:

{ "ok": true, "config": "robot.yaml", "steps": 120, "appliedSteps": 120, "safeStops": 0, "errors": [] }

Shell-driven robots

If you'd rather wire your robot in via subprocesses than write a Python connector, use the subprocess hardware connector in your YAML config — it runs shell commands that read observations and apply actions. The commands and their timeouts are config fields, not CLI flags; see Connect config reference and Observation and action schema for the exact JSON shapes.

Safety

  • The motors do not come live until inference is connected. A Ctrl-C during connect aborts cleanly without powering hardware.
  • Set mode: apply_actions in the config only once you've validated the setup; dry_run streams observations and logs the returned actions without moving the arms.
  • If an error fires mid-run, the runner triggers a safe stop before exiting.