Skip to main content
Run rive --help for this list in your terminal, and rive --version to print the installed version.

Commands

update, switch and uninstall are only supported for the installer build under ~/.rive/bin. If installing the CLI via Homebrew, use the brew methods to manage CLI versioning and updates.

Project flags

These apply to rive <project-dir>.

Build modes

Mutually exclusive, so pick one. --screenshot under Capture counts as one of them. With none of them, the CLI opens the preview window and rebuilds as you edit.
Until the project is bound to a Rive file in your account, --publish writes a watermarked build.Binding records push.fileId in rive.yaml, and it is done by rive push, which is coming soon. The watermark applies whether or not the project has scripts.

Modifiers

These attach to whichever mode you chose.

Capture

--bench runs instead of --screenshot, not alongside it. Passing both times the frames and writes no PNG, without saying so. It is a build mode in its own right, so it does not combine with --verify, --once, --publish or --test. It renders at the artboard’s own size and ignores --viewport, and it runs 300 warm-up frames before the ones it times.

Driving the scene

Interactions run in the order you write them, and --pointer and --advance need --screenshot.

Advancing time

--advance steps the scene where it sits among the other interactions. A bare number is whole frames at 60fps; 1s or 250ms is animation time, stepped in 1/60s frames with one shorter frame for any remainder. The time forms take a decimal point, so 1.5s is 90 frames.
Position it for what you need:
A sign, whitespace, trailing text, a decimal point on a bare frame count, or a value above a 32-bit unsigned integer is rejected with exit code 2.
--advance replaces --frame. A bare --advance=N means what --frame=N meant, so --frame=20 becomes --advance=20. Passing --frame is an error naming --advance.--bench takes its own frame count and does not combine with --advance, --pointer, --gamepad, --semantics or --semantic-action.

Setting data

--data takes a property path and a value. The path starts at the view model instance bound to the artboard, and every segment is a property name, so a flat view model takes the bare property and a nested one takes a path:
Each --data sets one property. Repeat the flag to set several:
A path that matches no property logs data: no property at "<path>" and is dropped. The build still succeeds, and the scene renders with that property’s authored value. Under --quiet you see nothing at all, so confirm your values landed rather than assuming they did.

Reading data back

--data sets values going in; --data-dump reads them back out. It builds, runs headless, and writes the bound view model values as JSON, so a test can assert on what the scene computed:
--data-dump-every turns that into a time series instead of a single reading: a header, a frame-0 baseline, then only what changed on each sample. It takes a whole number of frames at 60fps, and counts the frames gestures advance internally.

Simulating a pointer

--pointer takes a kind and a position. down, up, move and click each take a single point. click expands to a move, a press and a release with a frame between each, because a state machine only sees a gesture when it next runs:
--pointer only checks the shape of the value. A kind that is not down, up, move, click or drag parses fine, then fails at delivery with pointer: unknown gesture and exits with 1. drag is a fifth kind, and the only one with a different shape: drag@x1,y1>x2,y2[:steps]. It moves to the first point, presses, emits steps moves along the line to the second point, then releases. steps defaults to 8. Every event gets its own frame, so a drag runs for steps + 3 frames: a higher count is a finer and slower sweep, a lower one a flick. Scroll physics reads the velocity that implies, so the count changes how far a scroll throws.
Quote the drag value so the shell does not read > as a redirection.

Serving

Other

Preview window commands

Type these in the terminal while the preview window is open.

Per-command flags

create

--from-rev converts an editor .rev into a project: scene.rml plus its scripts and assets as files. Without a <dir>, the .rev’s own name is used. The directory must be empty or new.

schema

docs

samples

inspect

Exits 1 when problems contains an error, and 1 with a message on stderr when the directory has no rive.yaml.

doctor

doctor prints five checks (version, update, auth, live-link and project), each ok, warn or fail. It exits 0 when everything is ok or warn, and 1 when a check fails.

Signing in

Credentials live outside the project: ~/.config/rive/app.rive.cli/ on macOS and Linux, honouring XDG_CONFIG_HOME, and Windows Credential Manager on Windows.
A gated mode checks the session live, so --publish and --rev fail on a dropped connection even with valid stored credentials.

Exit codes

Exit 2 does not cover a misspelled flag. On rive <project-dir>, a flag the CLI does not recognize is ignored, so --bogus builds and exits 0. Values are checked, though: --viewport=abc exits 2 with a message, and so does every other flag value the CLI parses. A bare word is read as the project directory and the last one wins, so a stray argument silently changes what gets built. A green exit is not proof your flags landed.

JSON output

--format=json on --once, --verify, --publish or --test prints one JSON object on stdout. data differs per mode. --verify and --once carry the build:
--test carries the run:
command is the mode, not the flag: "build" for --once, "verify" for --verify, "publish" for --publish, "test" for --test. Each entry in data.problems is {severity, kind, code, script, line, column, message}, with severity one of error, warning or hint. errors repeats them as script:line message strings, carrying the same zero-based line, and drops the :line entirely for a problem on the first line. data.riv is null on --verify and on any failed build. Logs stay on stderr, so stdout carries nothing else.
line and column in --format=json are zero-based, while the terminal log and rive inspect report the same problem one-based. Add 1 before showing either to a person.

Environment variables

Interactive pickers draw on stderr, so redirecting stdout alone does not disable them. Where no picker can draw (TERM=dumb, RIVE_NO_TUI=1, or stdin not a terminal as in CI), the CLI falls back to printing the list instead.