CLI reference
For AI agents: this page is Markdown at https://squiggle.sh/docs/reference/cli.md. Every docs page is listed at https://squiggle.sh/llms.txt, and all of them are one file at https://squiggle.sh/llms-full.txt.
The squiggle command has 43 commands, grouped here by what you use them for, with the flags you'll use most. squiggle --help lists every command and flag.
Find any command
squiggle # pick a command from a menusquiggle --help # every command, groupedsquiggle perf --help # the commands under perfsquiggle perf sql --help # one command's arguments, defaults and examplessquiggle --schema-json # every command, flag and exit code, as JSONFor tab completion, run squiggle completions zsh --install (or bash, or fish). It prints the command that writes the completion script where your shell reads it; run that command.
Choose the simulator
Every command that drives a device takes --udid <id>. With one simulator booted you don’t need it. With several booted and none named, the command uses the simulator your agent’s Squiggle server or Studio is driving for this project, else the one simulator running your app. Otherwise it stops with E_DEVICE_AMBIGUOUS and lists each one’s name and UDID, and which Squiggle session drives it. Name one with --udid, SQUIGGLE_UDID, or "udid" in .squiggle/config.local.jsonc. A command you don’t point at a simulator never takes one whose app another Squiggle session is driving (a CLI run or agent server of another project, or of another checkout of this repository): it uses the other simulators, and when every booted one is taken it stops with E_DEVICE_HELD, naming each session. Create a simulator of your own with squiggle device simulator create (or start one with squiggle device simulator boot <udid>) and name it, or stop that session first. A simulator you do name is still not relaunched under that session: squiggle up, --fresh, and the relaunch a run makes to replace an out-of-date agent stop with the same error there. up chooses its simulator the same way as every other command. Commands that run several flows, such as bench, bisect, bakeoff, card and perf budget, run every flow on that one simulator. flows is the exception: it takes no --udid for a simulator, and runs on every booted one, a shard each (limit it with --shards). A React web app open in Squiggle’s window is named by its origin, such as --udid web:http://localhost:5173; see React web apps.
Set up and check
| Command | What it does |
|---|---|
init | Sets Squiggle up in your app. See Set up your app. In a Vite or Next.js app it adds the plugin and declares the dev server’s origin; see Set it up with squiggle init. --pr-evidence also lets your agent put screenshots and recordings on your pull requests; see Show your work on the pull request. When no booted simulator is free for your app, it offers to create one for the project and records its UDID in .squiggle/config.local.jsonc; --create-simulator does it without asking, and --yes alone never does. See Give the project a simulator of its own. It asks once before connecting the coding agents it finds: --yes connects them all, --agent claude,codex (claude, copilot, codex or cursor; none for no agent) names the ones to connect, and --agents-only connects them without setting up the app, in any folder. See Add the server. |
add | add screen <kind> [name] writes a screen from a template, with its route, flow, declared controls and budget. The kind is list, form, auth, detail, settings or onboarding; the name is its route, such as orders (default: the kind). --dry-run prints every file it would write, --force overwrites files that already exist, and --app-dir points at the app when it isn’t the current folder. In a React web app it writes the web version of the screen, and a Next.js page for it. See Start a screen from a template. |
up | Relaunches the app with the agent that came with this squiggle, gets a development build past the Expo launcher, and reports ready once the app’s JavaScript has connected. It is optional: a flow, your agent’s tools and Studio launch the app the same way when they need it, so use up to open the app before anything else does. Like a project’s first flow run, the first up also watches the app for a few seconds and keeps a perf baseline named first, so perf diff --against first has something to compare with from day one. --no-baseline leaves it to the next run; delete .squiggle/baselines/first.json to take it again. --url <port or URL> opens a React web app in Squiggle’s window instead, as does a port or URL in place of the bundle id (squiggle up 5173), and --production (or --prod) opens a production build served on your machine; --maps <dir> names its components from the source maps in its output folder when the server serves none. --browser <path or name> picks the Chromium browser to open, and --debug prints what happens to each tab, such as a reload or a dialog closed with nothing driving it. With SQUIGGLE_HEADLESS=1, or CI set, the window is headless. See React web apps. |
doctor | Checks the simulator, the app, screen tracking, source lines and your licence. For a React web app it checks the plugin, the declared origin, the dev server, and that it serves a development build. --fix repairs what it can; --bundle writes a support file. --quick reports in a second or two without waiting for the app: the device, whether the app runs with the agent, who holds the device, SDK and kit versions against the CLI, and the next step. It needs no licence, and your agent kit runs it when a session starts. |
device | The controls in Studio’s device menus, from a terminal. device keyboard on keeps the iOS on-screen keyboard showing while you type from the Mac; device keyboard off stops it, and device keyboard status (the default) reads it. It stays on for that simulator after the app relaunches, until you turn it off, and Studio’s Keep software keyboard shows the same setting. device keyboard off also makes your agent type as a hardware keyboard, where it otherwise opens the on-screen keyboard. device keyboard default forgets on or off, so your agent opens the keyboard again and flows type as a hardware keyboard. |
device appearance · contrast · text-size · status-bar | Change the simulator’s appearance, Increase contrast, text size and status bar, the settings in Studio’s System menu. Leave the value off to print the current one, except for status-bar, which always takes clean or reset. |
device location · permission · button · shake | Set the simulator’s location (a place, latitude,longitude, a route, or clear), grant, revoke or reset the app’s permissions, press a hardware button, or shake the device: Studio’s Location, Permissions and Hardware menus. |
device simulator | Lists, creates, boots and shuts down the Mac’s iOS simulators. device simulator list prints every simulator with its state and UDID, the installed iOS versions and the device types you can create. device simulator create creates one and boots it: with no options it’s the newest iOS version’s current iPhone, named Squiggle and the model, such as Squiggle iPhone 17 Pro; --name, --type (a device type as list prints it) and --runtime (such as 26.4) choose, and --no-boot creates it without booting it. device simulator boot <udid> and device simulator shutdown <udid> start and stop one; shutdown refuses a simulator that Studio, an agent’s Squiggle server or a CLI run is driving. A new simulator has no apps: install your development build on it before you run a flow. It doesn’t delete simulators. |
release | Frees the app when another process holds it. Lists each one, asks it to let go, and ends a run that is only waiting for your agent’s answer. --force ends a process that won’t let go. Studio is asked, never ended. |
activate · license | Start the trial, activate a key, and check your licence. See Licence and trial. |
Run flows
| Command | What it does |
|---|---|
flow | Runs one flow, by name or path. |
flows | Runs every flow in a folder, split across the booted simulators. --udid <udid> runs it only on the simulators you name (repeat it, or separate them with commas); SQUIGGLE_UDID or udid in your config names one too. With --udid web:<origin>, runs them on your web app, --shards N at a time, each in a browser context of its own. |
watch | Runs a flow again every time you save a file. |
bench | Runs a flow and compares its speed with the last benched run that passed. --runs <N> runs it N times and records one: the median run, or, when any run failed, the failed run, so the command exits 1 and that row is never compared against. --history shows the trend, and --breaks lists where its time changed: a jump between two commits (a slowdown comes with the squiggle bisect command for that range, its --budget-ms between the two times), a change with no commit between, a short stretch that came back, or a steady drift. It needs at least six passing runs with the same flags; with fewer it reports no breaks. A bench never relaunches your app: after you rebuild it, run the flow once with squiggle flow, which relaunches an app with an out-of-date agent. |
bisect | Finds the commit that broke a flow by running it on each commit, served through Metro with no rebuild, or through the web app’s own dev server with --platform web. See Find the commit that slowed a flow and the flags below. |
bakeoff | Runs one flow against your current commit and the revisions you name with --against (comma-separated), served through Metro with no rebuild (or the web app’s dev server with --platform web), taking turns run by run. Prints one table: passes, flow time, renders per interaction, dropped frames, memory growth and startup. --runs sets the runs per revision (default 3). A revision that changes native code or dependencies is refused. See Compare two implementations. |
motion | Records how a view moves after a tap and fits the spring that reproduces it: damping ratio, stiffness, settling time, and the withSpring config to paste. A motion that is not a plain spring is reported as one. With --video, judges a recording instead: how far the content moved each frame, and whether it was smooth. Flags below. |
crawl | Explores the app on its own and reports the screens it reached and any crashes. --tour opens every screen the app declares; --changed tours only the screens your branch touches, and --files <a.tsx,b.tsx> does the same for the files you name, relative to the project root. --only <paths> adds paths to the tour, even ones Squiggle has never seen. --legibility, with --tour or --changed, scores each toured screen for how easily an agent can drive it. |
history | Lists recent runs. history rerun <id> runs one again. |
Flags for flow
| Flag | What it does |
|---|---|
--fresh | Relaunches the app before the run. Use it after a failed run. |
--auto-scroll | Scrolls a control into view when a step targets one that is off screen. |
--continue-on-fail | Runs every step, instead of stopping at the first failure. |
--chaos <profile> | Runs the flow on a bad network: slow, flaky, truncated or offline-midstep. none runs it on a working network, even when the flow declares a profile. |
--stubs <run> | Answers every request from stubs built from an earlier run (its id, or latest): the same status, latency and response shape, with placeholder values. Each screen that made requests in both runs then gets a ready line comparing its time to ready with the earlier run’s. |
--stub-delays <match=ms,…> | With --stubs: answers each endpoint whose METHOD url contains match after ms instead of its recorded latency, then prints each screen’s time to ready beside what the earlier run’s order of requests predicts. |
--twin <profile> | Runs the flow on a working network, then under a chaos profile (or all), and reports what the app did differently. Exits 0 when every run completes, whatever it found. |
--fuzz | Runs the flow, then breaks each endpoint it called one at a time (500, empty, cut off, 5 s late, 404). --fuzz-max caps the runs (default 10). --twin, --fuzz and --race each choose the network themselves, so they can’t be combined with each other, --chaos or --stubs. |
--cache-twins <cold>,<warm> | Runs the flow from two save slots, one taken before anything was cached and one after, and lists each endpoint with both runs’ request counts: cached, refetched, more, or warm only. Can’t be combined with --twin, --fuzz or --fresh. |
--bisect-state <green>,<failing> | Finds the app state that makes the flow fail. Give it two save slots, one the flow passes from and one it fails from: it loads the first with some of the second’s values put in, runs the flow, and narrows to the smallest set of values that still fails. With --race, the race search runs from the failing slot, and each race it finds is searched the same way after its steps are shortened. Exits 1 unless it finds them. Can’t be combined with --fresh, --cache-twins, --tune, --twin, --fuzz or --matrix. |
--race | Searches for races. Every request is answered 2 s late from a recording, then the same tap is fired again, or Back pressed, at points while it is pending. Reports a request sent twice or a screen that appears after Back, each with its shortest reproduction. --race-max caps the runs (default 16). Exits 1 when it finds a race. |
--race-random <seed> | With --race: places the repeated taps at random points instead, from this seed, to compare against the default search. |
--boundaries | On each screen the flow reaches, checks a point 1 pt inside and outside every edge of each control that has a testID or label, and reports an edge whose touches land on something else. A dead edge fails the run. Needs Squiggle running in the app, which a debug simulator build does by itself. |
--boundaries-random <seed> | With --boundaries: checks 400 random points instead of the control edges, from this seed, to compare against the default search. |
--breakpoints | On a web page: after the flow reaches its screen, moves the page’s width from 320 to 1280 px and lists each width where a control with a testID appears, disappears or moves to another row, and where a control starts or stops growing with the page or changes how fast it grows, each to the pixel. The page is resized in place, without reloading, and put back at its width afterwards. It samples every 32 px first, so a change that appears and reverts within 32 px can be missed. The widths it finds aren’t saved; add --json to keep them. On an iOS simulator: runs the flow at each of the 12 text sizes, one fresh launch each, and lists between which two sizes a control appears, disappears (below the bottom edge counts) or changes row; the smallest size runs three times first, and the sweep stops if those disagree. In a debug build it also predicts the screen at each size from one capture and says at how many the prediction matched. On a Mac app, or on an iOS simulator with --breakpoints-range or --breakpoints-prove: lays your app out at each width inside its screen, from 320 pt to the screen’s width, and lists what changes as it does on a web page, in points. A Mac app’s window is widened to the screen first and put back afterwards; one with no touch capture is swept by resizing its window, from the narrowest it allows. Exits 0 when the sweep finishes, whatever it finds, and 1 if the flow fails first; 2 when --breakpoints-range runs past a native app’s screen. The text-size sweep also exits 1 when the smallest size reads differently across its three runs, or when no control with a testID can be read. |
--clock | Moves your app’s clock (a debug build) to each calendar landmark over the next 400 days (--clock-days sets another span, 1 to 3650): each side of month and year ends, 29 February, the next UTC midnight and each daylight-saving change, and noon every 30 days. Opens the flow’s last screen at each, finds every second where what it says changes, and checks each one twice more. Exits 1 when a change does not repeat. The flow runs again at each instant without relaunching, so it must be able to start from its own last screen. An app that can’t move its clock stops with E_CLOCK_UNSUPPORTED. |
--confirm-jank | Runs the flow from a fresh launch, takes the timer its periodic-jank finding names, mutes it in your app (a debug build), runs the flow again, and says confirmed when the beat is gone. Exits 0 when it is confirmed, or when no finding names a timer; 1 when the beat is still there or the flow fails; 2 when the app can’t mute timers (a release build). Needs a project that declares the app. |
--busy-js <ms> | Runs the flow from a fresh launch, then again with your app’s JS thread held busy for this long (1 to 5000 ms) before every step, so each step arrives while it is busy. Lists each step that passed the first time and fails the second, or needed its tap delivered twice. Measures the block on the device. Exits 1 when a step breaks or the measured block is more than 10% off; 2 when the app can’t hold its JS thread (a release build). Needs a debug build with the Squiggle SDK. |
--reorder | Runs the flow from a fresh launch, then once for each pair of its requests that were in flight together (up to six), holding back the one that answered first until the other has answered. Lists each swap that fails the flow or changes the text on its last screen, and exits 1 when there is one. Needs network capture, which every run turns on, on an iOS simulator. |
--from-step <k[,k]> | With --busy-js: starts the busy thread at this step, counted from 0, so the steps before it run as they are; several steps, separated by commas, make one run each. With --reorder: one step, and only requests that start there or later are swapped. Default 0. |
--gesture-map <testID[,testID]> | After the flow reaches its screen, drags from the middle of each control at angles from sideways to vertical, finds to the degree where the drag stops moving the control and starts scrolling its list, and measures how far a sideways and a vertical drag go before anything moves. Each drag returns to where it started before the finger lifts. Exits 1 when a gesture has less than --gesture-margin degrees to spare, or a swipe or scroll step in the flow drags on a mapped control within that margin. iOS simulator only. |
--gesture-margin <degrees> | With --gesture-map: how far every gesture must be able to lean, more than 0 and under 45. Default 15. |
--scroll-sweep <testID> | After the flow reaches its screen, moves this scroll view from its top to its end with no animation, reads where each element with a testID is drawn, and fits its position to the offset in straight pieces, listing where each bends or jumps. Exits 1 when something that scrolls with the list is never wholly visible, a sticky element lets go and leaves the screen, an element on screen still moves at the end of the list, or an element jumps. Scrolls the list back to the top afterwards. iOS simulator only; needs your app running Squiggle, which a debug build does by itself. |
--drag-sweep <testID> | After the flow reaches its screen, holds a finger on this element at about a hundred points along --drag-by, and fits where each element is drawn against how far the finger has moved, listing where each bends or jumps. Exits 1 when an element jumps. The finger goes back to where it started before it lifts. iOS simulator only. |
--drag-by <dx,dy> | With --drag-sweep: how far to drag, in points. Default 0,-300 (300 pt up). Both 0 stops the run (exit 2). |
--motion | Runs the flow twice from a fresh launch while watching every view, fits each element’s motion as a spring on the first run and checks the fit against the second, and lists each one: a spring with its damping ratio, settle time and poles, a value that jumps (it reaches its new value within two frames), or not a plain spring. An element is matched across the two runs by its testID, or in a debug build by the line in your source that renders it. Exits 1 when a value jumps, when views rendered by one line run different springs, or, once there are ten springs, when one is like no other in the app; each must happen in both runs. Exits 1 when the flow fails, and 5 when the app has no Squiggle agent to watch it. iOS simulator only. |
--breakpoints-prove | With --breakpoints on a web page or a native app: marks every width proven, falsified or inconclusive for controls running off the page (or below the bottom of a native screen) and controls overlapping, from the two ends of each stretch between the widths the sweep found. Exits 1 when a width is falsified, with or without --breakpoints-save. |
--breakpoints-save | With --breakpoints on a web page (a native app refuses it): for each width where a control appears or disappears, saves two flows to .squiggle/flows/, one pixel either side, that open the page at that width and assert which of those controls are shown, then runs them. Exits 1 when one does not hold. Needs a project that declares the app. |
--breakpoints-range <lo..hi> | With --breakpoints: the widths to sweep, such as 360..1024, in CSS pixels on a web page or points on a native app. The low end must be at least 100 and the high end above it; on a native app the high end can’t be wider than the screen. |
--matrix --predict | Runs the flow once, then predicts what the matrix would find at every text size from the screen the flow ends on, without relaunching. The setups it flags, and about a quarter of the rest (the same ones on every run), are then run for real, and the report says whether each agrees. The run exits 1 when a real run disagrees with the prediction; predicted problems alone don’t fail it. --predict-widths 375,402 also predicts other screen widths, run for real only in a debug build with touch capture on; --predict-check 1 runs every setup for real. Each setup also says how far it is from the nearest width where the layout jumps, such as a label wrapping ("layout-notifications changes 6.5 pt wider"), and --json lists every width where the layout jumps or bends, per text size, from 320 to 480 pt. iOS simulator only. Needs a debug build of your app. Every --predict-… option below needs --matrix --predict. |
--predict-breakpoints | With --matrix --predict: also tests half a point either side of each width where the layout jumps, and says how many real problems each relaunch found there against the setups at the device’s own widths. |
--predict-expansion <max> | With --matrix --predict: makes every label in your app 10%, 20%, … up to max longer (0.5 is 50%, and 1 at most), the way a translation can, and says at which length each label wraps or causes a problem. Needs a debug build. |
--predict-heights <pt> | With --matrix --predict: predicts the layout as the screen height falls from its current height to pt, as a keyboard or a sheet at a lower detent does, and lists each height where the layout jumps or bends. Nothing runs on the device for it. |
--predict-keyboard <testID> | With --matrix --predict: raises the keyboard from this text input once per control on the screen (the first six with a testID, relaunching each time). Says whether each control animated or jumped, whether it settled where the layout puts it at the height most controls settled at, and how tall the keyboard is against the space the layout gave it. Fails when a control jumps, settles more than a point off or ends up under the keyboard, or when the layout gives the keyboard more than a point more or less space than it covers. A control it can’t record only warns. Needs a debug build. |
--predict-funnel <name> | With --matrix --predict: splits a saved funnel’s conversion between the real sessions each predicted problem reaches and the rest, and says whether they differ by more than noise. Needs at least 30 sessions on each side; with fewer, it says how many there are. A name that isn’t a saved funnel stops the run before it starts (exit 2); squiggle product funnel lists the saved ones. |
--predict-prove | With --matrix --predict: for each text size, marks every width from 320 to 480 pt as proven, falsified or inconclusive, and runs the narrowest falsified width on the device to confirm it. The proof is saved on this machine in .squiggle/gate/layout.jsonl, when your project owns the app. A run that no longer proves a width an earlier run proved fails. A falsified width doesn’t fail this run, but squiggle card fails on it. Needs a debug build. |
--predict-steps | With --matrix --predict, and no other --predict-… option: checks where each step’s target lands at every text size, at your device’s width and any --predict-widths: off the screen, cut off, covered, or a different nth match. For each target off the screen it proposes a scrollUntilVisible before the step and runs the changed flow in that setup. Exits 1 when a proposal doesn’t make the flow pass; the other problems are reported without failing the run. |
--cliff <VAR=lo..hi> | Runs the flow with its env VAR at sizes from lo to hi, and reports the size where dropped frames stop being flat, with what rendered most there. Exits 1 when it finds one. Each sweep is saved in .squiggle/gate/cliffs.jsonl, which the report card reads against the sizes a screen declares. |
--cpu-throttle <rate[,rate]> | With --cliff on a web page: runs the sweep once per rate, with the page’s CPU that many times slower (1 is full speed, up to 20), and says where frames start dropping at each. A simulator refuses it (exit 2). |
--tune <name> | Chooses the value of a tunable the app declared with defineTunable. Runs the flow at every value the tunable allows, without relaunching, scores each run on what its assert: { scroll } measured, and proposes the lowest value when it beats the default by more than the noise of five runs. Saves the result for propose_fix. Can’t be combined with --fresh. |
--tune-weights <dropped=1,blank=0.05,ms=0> | With --tune: the score of one dropped frame, one point of blank band and one millisecond of the run. |
--tune-reps <n> | With --tune: runs at each value (default 3). |
--tune-slot <slot> | With --tune: starts every run from this save slot instead of the flow’s prerequisite. |
--matrix | Runs the flow once in each simulator setup (as found, the other appearance, the largest text size) and reports the overlapping, cut-off or off-screen controls each setup adds, including a control the first setup showed that another pushes off a screen that can’t scroll it back. Exits 1 when one adds any. iOS simulator only. See Run settings. |
--repair <name,name> | With --matrix: on the flow’s last screen, searches these declared layout tunables for values that leave no overlapping, cut-off, off-screen or under-44 pt control in any setup, moves them onto the tokens each tunable declares, and saves the result for propose_fix. Exits 1 when nothing it tries clears every setup. |
--repair-search <program|soft|expected|grid|random:seed|descent> | With --repair: how to search. By default (program) it learns how each tunable moves the screen’s layout and measures only the values it computes, once per setup; if your app can’t capture its layout (it needs a debug build), it searches the grid instead. soft and expected are other searches on the layout; grid, random:<seed> and descent measure value after value. |
--repair-landing-check | With --repair: when the change moves several tunables, checks every in-between state of applying them one at a time on the device, and says whether each matches the prediction. Runs only with the program or soft search, or with --repair-control. A mismatch is reported but doesn’t fail the run. |
--repair-control <seeds> | With --repair: also measures what each search (program, softened, expected value, grid, random search over this many seeds, and step-by-step descent) spends to reach a layout with no problem in any setup, on one set of measurements, and saves it with the repair. |
--ax-only | Finds every control through the accessibility tree only, the way VoiceOver reaches it. See Run settings. |
--settle-debug | Prints every wait under its step and, when a wait runs long, names what was still animating: the component and its file:line. |
--junit <file> | Writes JUnit XML, which most CI systems display. |
--events | Prints one JSON line per step on standard error, for CI logs and scripts. |
--record | Records a video of the run. --attach-pr adds it to the pull request for this branch. |
--record-to <file> | Records a video of the run to this file. It is filmed even when the app belongs to another project, and never pruned. |
--record-fps <n> | Sets the video’s frame rate, from 1 to 120: 60 by default, 30 for a React web app. A simulator draws at most 60 frames a second, so asking for more gives 60. |
--record-tail <ms> | Keeps recording for this long after the last step, up to 30000 ms, so what it set off, like a keyboard closing, is in the video. To film longer, add a wait step to the flow. |
--needs-agent fail | Exits 1 instead of 6 when an agent step needs an agent. |
--inline <yaml> | Runs a flow given as text. flow - reads it from standard input. Its runFlow and addMedia paths start at the project folder, and a runFlow file can be a library flow’s name. |
squiggle flow --help lists the rest, and Run settings covers the flags that change how steps are delivered.
Flags for bisect
squiggle bisect login --good v1.4.0squiggle bisect login --good main~20 --budget-ms 3000 --runs 3 --hunks| Flag | What it does |
|---|---|
--good <ref> | A commit where the flow passes. Required. |
--bad <ref> | A commit where it fails. Default: HEAD. |
--budget-ms <N> | A run slower than N ms counts as bad too, so you bisect a slowdown instead of a failure. |
--runs <N> | Runs per commit, judged by the median. Default: 1. Use 3 or more with --budget-ms. |
--hunks | After finding the commit, reverts each change in it one at a time and reports how much of the slowdown each one accounts for. |
--app-dir <path> | The Expo app’s folder, when it isn’t the project root. |
bisect needs a booted simulator running an Expo development build whose app.json sets expo.scheme, and a range of commits that only change JavaScript. It exits 0 when it finds a confirmed commit, 1 when the result isn’t confirmed or there is nothing to bisect (the bad end passes, or the good end already fails), 2 when the range is invalid or changes native code (E_BISECT_NATIVE), and 5 when no simulator is booted.
Flags for bakeoff
squiggle bakeoff checklist-scroll --against flatlist-variantsquiggle bakeoff login --against legend-store,zustand-store --runs 5| Flag | What it does |
|---|---|
--against <ref,ref> | The branches or commits to compare with your current commit, comma-separated. Required. |
--runs <N> | Runs per revision, taken in turns and judged by the median. Default: 3. |
--app-dir <path> | The Expo app’s folder, when it isn’t the project root. |
bakeoff needs the same setup as bisect. It exits 0 when every run of every revision passed, 1 when a run failed or a revision never ran (E_BAKEOFF_NO_RUN), 2 for bad arguments or a revision that changes native code (E_BAKEOFF_NATIVE), and 5 when no simulator is booted.
Flags for motion
squiggle motion sheet --tap open-sheetsquiggle motion nav-indicator --tap nav-pill-1,nav-pill-2 --json > nav.jsonsquiggle motion nav-indicator --tap nav-pill-1,nav-pill-2 --match nav.json| Flag | What it does |
|---|---|
<view> | The testID of the view that moves. It can be one the tap brings in, such as a sheet: it is followed from the first frame it appears in. Its on-screen position, size and opacity are recorded. |
--tap <testID,…> | What to tap to start the motion. Required. With several, they are tapped in turn, so a motion that goes there and back is recorded both ways. |
--ms <N> | How long to record after each tap, from 100 to 10000; a longer window is refused. Default: 800. |
--runs <N> | How many recordings. The first half are fitted and the rest are held out to check the fit. Default: 6. |
--match <file> | Scores the recordings against a fit saved by an earlier --json run, to check that a changed config still produces the same motion. |
--json | Prints the fit and every recording. |
--udid <id> | The simulator, when several are booted. |
Each moving property gets its own line. When the held-out recordings miss the fitted spring by more than 0.25% of the distance travelled, it says NOT a plain spring from rest and prints no config, for example because the motion is retargeted while it runs. Otherwise it prints a withSpring config with mass: 1: Reanimated’s default mass is 4, so keep the mass when you paste it. Where Reanimated can solve it, it also prints the dampingRatio and duration form, with the duration in milliseconds.
motion needs a debug build of the app on an iOS simulator. It exits 0 with a fit, 1 when nothing moved, a tap target wasn’t on screen, the view never appeared after the tap, or --match doesn’t match, 2 when the --match file can’t be read, and 5 when there is no simulator or the app runs without Squiggle attached.
Judge a recording
With --video, motion reads a screen recording (one of Squiggle’s, or any mp4) and reports how far the content moved in each frame and whether the motion was smooth. It needs ffmpeg, but no device.
squiggle motion --video .squiggle/videos/chat-1.mp4 --region 0,300,1320,1900squiggle motion --video scroll.mp4 --ignore '0,0,1320,180;0,1900,1320,968' --frames| Flag | What it does |
|---|---|
--video <file> | The recording to judge. |
--region <x,y,w,h> | The part that moves, in pixels of the recording. Default: the whole frame. |
--ignore <x,y,w,h;…> | Areas to leave out, such as the keyboard, the status bar or a sticky header. Anything that stays put while the content moves pulls the reading toward zero. |
--from <s>, --to <s> | Only judge this part of the recording. |
--axis <x|y> | Judge only this direction. By default each direction that moved is judged, and each problem names its own. |
--chart <file> | Also writes a chart of speed over time with every bad frame marked in red: a PNG, or an SVG when rsvg-convert is not installed. |
--against <file> | Compares with a baseline of the same motion: an earlier recording, measured the same way, or a report saved with --json. It prints each measure before and after, and exits 1 only when one got worse by more than run-to-run noise. |
--frames | Also prints every frame: its time, step, speed and finding. |
--json | Prints the report, and with --frames every frame. |
The first line gives the verdict, the number of frames and the recording’s frame rate, the same rate the filmstrip tool gives. A screen recording writes frames only while the screen changes, so when it held still for a while the average comes after the rate: 60.0 fps (variable rate, 29.3 frames/s on average). With --json, these are fps, meanFps and variableRate.
Each problem is printed with its time and frame numbers: a stall (frames that did not move mid-motion), a duplicate (one repeated frame), dropped frames (a gap longer than 1.75 frames, read from the recording’s own timestamps), a jump, judder (uneven steps) or a reversal. Stillness longer than half a second is a pause between two motions, not a stall, unless the content then carries on at speed in the same direction, as it does after a freeze. After a pause the next motion can go either way without counting as a reversal. A gap between frames longer than half a second is judged the same way, so a recording that wrote no frames while the screen held still isn’t read as dropped frames. A frame where the screen changed instead of moving, such as a fade, is left out.
When something else in the frame moves on its own, such as a looping banner or a carousel, the whole-frame reading mixes it with the content, and a stall in the content can read as smooth. Motion then prints a warning with the area it found and the flags to pass next: a --region around the part that moved furthest, or an --ignore for the others. A part that swings back and forth in place, such as a turning progress indicator, is named even when nothing else moves, with only an --ignore to pass; its swings count as stillness, not as reversals, and the report gives their number as oscillatingFrames. With --json, the report carries the areas as independentMotion.
It exits 0 when the motion is smooth or still and 1 when it is janky, so a script can gate on it; with --against, 1 means it got worse. It exits 2 (E_MOTION_VIDEO) when the recording or the baseline can’t be read, or ffmpeg isn’t installed, and says how to install it.
For a recording Squiggle made, each problem also lists what your app was busy with in those frames after busy:, such as a long JavaScript task or the components that rendered. For any other video, the output says what the app was doing then: unknown, … and why.
Record and replay
| Command | What it does |
|---|---|
record | Records the app until you press Ctrl-C, into .squiggle/recordings/. |
replay | Replays a recording, and can check a flow against it with no device. With no file, lists recordings. |
diff | Compares two recordings: renders, screens, network requests and timings. With --journey <intent> (that program’s runs that passed) or --cohort <pattern>, compares one recording with many and lists every number outside the range of all of them. |
contracts | contracts propose proposes asserts for what your screens have always shown, from the recordings of runs that passed, and proposes removing the ones that no longer hold, each with the run that shows it. Prints the proposal; --write adds and removes the asserts in your flows and --pr opens a pull request with the changes. --min-confidence sets the share of passing visits an assert must have held in (default 0.9), and --app picks the app when your recordings are of more than one. See Assertions. contracts navigation checks the navigation your project declares in navigation over the screens Squiggle has recorded: each check proven, falsified with the shortest path that breaks it, or inconclusive. It exits 1 when one is falsified; --platform checks one app, and --reproduce saves each falsified answer as a flow and runs it on one device: a booted simulator, or the one --udid names (web:<origin> for a web app). See Check your app’s navigation. |
Save and load app state
| Command | What it does |
|---|---|
save | squiggle save <name> saves the screen the app is on and the data behind it as a named slot, in .squiggle/agent/fixtures/<name>.json. --description adds a note that load lists. It prints what it saved and any paths it left out. |
load | squiggle load <name> puts a saved slot back in under a second, instead of tapping through screens to rebuild it. With no name, lists slots, with no device needed. |
Both take --udid <id> to pick the simulator whose app to use when several are running; without it, they use the app launched most recently with Squiggle attached. Both take --json too. A name starts with a letter or digit and has up to 80 letters, digits, dots, dashes and underscores; any other name exits 2. A load the app refuses exits 1 with the reason, for example a slot saved by an older version of the app: save it again. MMKV data stays on the simulator the slot was saved on.
Read the data
| Command | What it does |
|---|---|
perf | Performance data: sql, top, saved, detector-stats, report, insights, watch, snapshot, diff, export, labels, budget, gc, profile, heap, heapdiff, crashes and symbolicate. |
product | Product analytics: overview, screens, usage, affinity, releases, users, sessions, state, retention, friction and funnel. |
probe | Reads a running app through Metro, with no rebuild: renders, animations, timers and CPU. It reads the Metro that serves your app, the one metroUrl or SQUIGGLE_METRO_URL names when you set either, unless you pass --port <port>. probe when runs your own rules inside the app and probe export keeps them as a tested detector; probe inputs lists what a rule can read, with each input’s range. probe replay and probe when need a licence to drive, probe export one to analyze; the rest are free. Flags below. |
logs | Prints the app’s console lines your project has saved, a worklet’s console.log included: the newest 100 by default, oldest first, each with its time, level and text, then the cursor to read on from. --json adds each line’s seq, the same fields the MCP logs tool returns. --level keeps that level and above, --text keeps lines containing it (ignoring case), --limit caps the lines (default 100), and --since takes either the cursor of the last read, to print only what was saved after it, or a duration such as 30s, 2m or 1h, to print the lines saved in that last stretch. --follow keeps printing new lines until you press Ctrl+C. --json prints the lines and the cursor, or one JSON line per console line with --follow. |
reproject | Rebuilds the performance data from your recordings. |
Console lines are saved while the MCP server, a squiggle flow run or Studio records an app your project owns, so logs prints nothing for an app your project doesn’t own, or before anything has recorded it.
On a React web app, perf crashes lists the times the page crashed, and perf symbolicate reads the dev server’s source maps, or the folder --maps names for a production build.
The perf and product commands you’ll use most
| Command | What it does |
|---|---|
perf diff --against <name> | Compares the newest session (or --session) with a baseline saved by perf snapshot. --against first compares with the baseline the project’s first run took. --assert <file> exits 1 on any breach of its thresholds. |
perf budget | Checks every screen with a budget against the newest session (or --session <id>), with the margin to each limit. Exits 1 on any breach. |
perf budget --changed | Runs the fewest flows that reach the screens this branch changed, and checks only those screens. --base <ref> sets what the branch is compared with (default: where it left origin/main). A changed screen no flow reaches is listed under no flow covers, and doesn’t fail the check. |
perf labels | Writes every labelled run (outcome, heals, escalations, frame windows, and the app state) as JSONL, to .squiggle/agent/labels.jsonl. --out picks another file, which must be inside .squiggle/. Runs under --chaos, --stubs, --fuzz or --race are marked synthetic, with what each broke. |
product state [path] | With no path, lists the state paths the app has sent, such as zustand:useCart.items#len. With a path, shows its values per screen; --screen <route> keeps one screen. --coverage lists the states real sessions reach that no flow or save slot does, each with a proposed slot; --save-gap <n> --as <name> saves gap n’s slot. --drift compares two releases (--from and --to pick them; default the latest against the one before). --perf reads performance findings against the state they happened in. |
product screens --cost | Ranks screens by what they cost the newest 200 real sessions (--last sets another count): the share that opened each, its dropped frames on the worst tap and its time to interactive, each times that share, the share over its budget, and changed when the numbers moved against the sessions before. It doesn’t take --session or --where. |
product … --where <rule> | Every product report except product screens --cost takes --where, such as --where "zustand:useCart.items#len >= 3", and splits its numbers between the sessions that reached that state and the rest. product friction --state also adds the app state behind each friction cluster. |
Flags for probe when and probe export
squiggle probe inputssquiggle probe when 'fps < 45' 'scroll.moved == 1' --id janky-scrollsquiggle probe when 'render.watch0 >= 5' --component ProductCard --for 30squiggle probe export 'fps < 45' 'scroll.moved == 1' --id janky-scroll --out src/detectors| Flag | What it does |
|---|---|
<rule> … | One or more rules, each an input, a comparison and a number, such as render.max >= 30. probe inputs lists the inputs. |
--any | Fires when any rule holds. Default: when all of them do. |
--component <name> | A component whose renders render.watch0 to render.watch7 count, in the order given. Repeatable. |
--id <name> | The probe’s name, which probe export finds its firings by. Default: the rules, joined. |
--for <seconds> | probe when: stops after this long. Default: runs until Ctrl-C. |
--udid <id> | probe when: the simulator whose app to probe, when several are booted. |
--session <id> | probe export: the session whose firings to use. Default: the newest that has any. |
--out <dir> | probe export: where to write the detector, its test and the firings it is tested on. Default: the current folder. |
--runner <bun|vitest|jest> | probe export: the test runner the test is written for. Default: bun. |
probe export takes the same rules, --any and --component the probe ran with, and refuses others (E_PROBE_MISMATCH).
Agents
| Command | What it does |
|---|---|
mcp | Starts the MCP server for your coding agent. See Connect your agent. |
mcp --http <port> | Serves the MCP server in HTTP mode, at http://127.0.0.1:<port>/mcp, for an agent that is already running. --http 0 takes a free port. --host <address> listens beyond this machine. See Connect your agent. |
agent | Runs and checks agent programs, and installs the agent kit (agent kit --install). |
legibility | Scores how easily an agent can drive your app, and names the lines to fix, biggest gain first. --fix adds the missing testIDs. |
card | The feature report card: starts the app cold, runs the flows over the screens your change touched and checks their budgets, startup, findings, legibility, wasted renders, render growth, each screen’s requests against the last green run, and each screen’s last saved layout proof. Each flow runs against stubs built from its last green run, so the card needs no backend. Exits 1 until every row passes. Flags below. |
benchmark | Scores an agent on a set of tasks in your app; --suite web scores the web app’s tasks. See Benchmark an agent. |
Your agent’s tools are listed in MCP tools.
Flags for card
What each row checks, and how to read one, is in The report card.
| Flag | What it does |
|---|---|
--files <a.tsx,b.tsx> | The files the change touched, relative to the project root. Default: what this branch changed since --base. |
--base <ref> | Without --files, what the branch is compared with. Default: where it left origin/main. |
--full | Every remembered screen and every saved flow, not only what the change reaches. |
--no-tour | Skips touring the touched screens and checking their legibility. |
--all-flows | Runs every saved flow that covers a touched screen, instead of the fewest that reach them all. |
--dry-run | Prints what the card would tour and run, and doesn’t touch the simulator. |
--live | Runs the flows against your real backend. Use it when a flow checks text that stub placeholder values would break. |
--json | Prints the whole card. |
Every card is saved to .squiggle/runs/card-<time>.json. When it ran any flows, its numbers are also recorded for squiggle gate app.
The agent commands
| Command | What it does |
|---|---|
agent kit | The skills, subagents and commands for your agent. --install writes them into the repo, and warns when Claude Code has no Squiggle server registered for the folder: squiggle init --agents-only --agent claude registers it. -o <dir> writes everything, hooks included, to read first. |
agent rules | An AGENTS.md section for this repo: the commands to use and the mistakes to avoid. --write writes AGENTS.md at the project root. |
agent config | The deny rail and run limits. --init writes the defaults to .squiggle/agent.json. |
agent run | Runs an intent program against the app. With --answers-stdin, another program answers its decisions on standard input, one JSON line each. |
agent validate | Checks flows and intent programs without running them: name files, folders (subfolders included) or globs. Each file, and every file its runFlow steps name, must load, and each file must pass the selector and recording check; --parse-only checks only that they load. A runFlow file that can’t be found fails, naming the paths tried. Each file is checked against the project whose .squiggle/ holds it, wherever you run the command. With nothing named, it checks that every flow in the project’s .squiggle/flows loads. Every check also compares each testID selector with your source: a testID nothing in your source can render, and no screen in .squiggle/interfaces declares, fails the check, with the closest one it found when one is close (did you mean …?). Conditional testIDs ({isLast ? 'submit' : 'next'}) count as both values, a template such as option-${index} matches option-0, option-1 and so on, and a prop used in a testID (${testIDPrefix}-${option.id}, with option each element of a constant array or of an options array passed as a prop) counts as what each place that renders the component passes, shared packages included. A selector with a flow variable is checked with the flow’s own env: values filled in (never its secrets:); with a variable still left, the text around it must match fixed text in your source (${TASK_ID}-row needs a testID such as task-${id}-row that ends in -row; option-${index} doesn’t count), and a selector made only of variables (${TARGET}, ${A}-${B}) isn’t checked. The source is the src, app and components folders of the app’s project, plus the same folders in a monorepo’s packages/*, never the other apps in apps/* (a project at the repository root reads them all); with no files named, --source <glob> picks the files instead. A control the app doesn’t draw in React (the system photo picker’s Add) counts once a flow or tour has reached it on a device. A testID the check can’t read (testID={id}, or a template with no letters or digits of its own) makes an unknown selector it could produce a warning that names that line, not a failure; a selector it couldn’t produce still fails. --parse-only skips the testID check. At a monorepo root with no .squiggle/ of its own and several projects in apps/* and packages/*, it checks the flows of each, naming each; with no project at all, it fails with E_NO_PROJECT_STORE rather than passing on zero flows. --hook is what the agent kit’s flow-edit hook runs: it reads the Claude Code hook event on stdin and checks only the file that edit wrote, testIDs included, so your agent hears about a typo straight away; an unknown selector that is only a warning passes it quietly. Exits 1 if any file fails. Needs no device or licence. |
agent guard | What the agent kit’s simulator hook runs before a shell command that names simctl: it reads the Claude Code hook event on stdin and, when the command runs simctl erase or simctl delete, prints it as refused and exits 1, which the hook turns into a block. A command that only mentions them (an echo, a commit message, a search) passes. Needs no device or licence. |
agent branch | Replays a program’s first steps (--at <n>), then tries each alternative (--alt, repeatable) from there. With --from-slot, it runs those steps once, saves a slot there and loads it before each alternative, instead of relaunching and replaying; the steps must end on a known screen (a waitFor or assert on the route). If the slot can’t be used, every branch replays and the result says why. --order margin runs the alternative whose first tap most surely matches a control on the branch screen first, and --first-win stops at the first alternative that reaches its goal. Exits 0 when an alternative reaches its goal. |
agent schema | Prints a JSON schema: intent programs (the default), flows, or the config file. -o writes it to a file. |
agent library | The saved flows your agent can replay. A flow in a folder is listed by its path under .squiggle/flows, such as auth/login, the name both squiggle flow auth/login and your agent’s run_flow take. |
agent journal | What the agent did in a run, and why. |
agent watch | Turns new crashes, friction and findings into briefs as they appear, for your agent to pick up. --incidents prints one line per recorded incident instead, for a Monitor to wait on. |
agent stats | Model turns, heals, escalations and cost across runs. --history shows the trend. |
agent briefing | The working rules your agent is given, including what it has learned about this app. |
agent amend | Only what the agent has learned, so you can review it in a pull request. |
agent eval | Replays recorded agent runs and reports each outcome. |
agent skill | Proposes a skill from decisions that keep coming up, and keeps it only if it measurably helps. |
agent patterns | Popup handlers you can share between projects, with no app data in them. |
agent export | The run history as JSONL training data, each run scored by whether it reached its goal. |
Everything else
| Command | What it does |
|---|---|
explain | Explains an exit code or error code. See Exit codes and errors. |
update | Updates the squiggle command when you downloaded it on its own. An npm install, or the command that comes with Studio, is told what updates it (npm, or Squiggle → Check for Updates…) and nothing changes. --check only checks; --to <version> installs a specific version. |
uninstall | Removes Squiggle. --dry-run lists every file it would delete, with sizes. The command that comes with Studio stays: move Squiggle.app to the Trash to remove it. |
telemetry | Shows what anonymous usage data is sent. telemetry off turns it off. |
store | store audit lists data in this project’s store that came from an app the project doesn’t own. --purge removes it. |
redact | Shows what would have to be removed from a file before you share it. --write removes it. |
completions | Tab completion for zsh, bash or fish. |
licenses | Third-party notices for what the binary includes. |
consumer | Watches the app with no UI and records performance until you stop it. |
gate | Checks that Squiggle keeps working when the app relaunches (gate relaunch) and that the MCP server works (gate mcp). |
gate app | Fails when the newest card, or the app’s bundle size, is worse than on main by more than its budget allows. --base <ref> picks what it compares with (default origin/main). In CI, --bundle <dir> measures the iOS bundle an expo export wrote there, and --base-bundle <dir> the base’s, built in the same job. Needs no licence. See Run in CI. |
Output for scripts and CI
With --json, a command prints only its data on standard output, and its progress on standard error, so you can pipe it:
squiggle flow checkout --json | jq '.steps[] | select(.status == "fail")'squiggle perf sql "select * from spans limit 5" --json | jq '.[]'Every status has a symbol as well as a colour. --no-color, --no-unicode, NO_COLOR and CI switch to plain output.
Screenshots of failed runs
When a flow fails, Squiggle saves a screenshot of the simulator to .squiggle/runs/ and prints its path under the failing step. Terminals that can show images (iTerm2, kitty, WezTerm, Ghostty, VS Code) show the screenshot itself. SQUIGGLE_NO_IMAGES=1 prints only the path.