Skip to content
flow

Sync & devicesflow-remote command reference

flow-remote command reference

Every flow-remote command with its synopsis, flags and effect, for pairing, grants, listing sessions, attaching and checking the daemon and sync.

View as Markdown
On this page

flow-remote is the daemon and command-line tool behind Puddles: it pairs your devices, manages what each one may do, lists and opens another device's terminal sessions, and reports what the daemon and its sync are doing. The Puddle page in the app does most of this for you; this page is the reference for running it yourself or from a script. For the concepts, see Pair devices with flow-remote.

Where the binary is

flow-remote ships inside the app, beside Flow's other command-line tools, at Flow.app/Contents/MacOS/flow-remote. It is not on your PATH, and Install command-line tools does not link it. Run it by its full path:

sh
/Applications/Flow.app/Contents/MacOS/flow-remote --help

While Puddles is on (Settings › Experiments › Puddles), the app runs flow-remote serve for you. You only need serve yourself to run the daemon by hand.

Conventions

  • <device> is a device id, a unique prefix of one (4 or more characters), or a device name. If the text could mean more than one device, the command refuses and asks for the id.
  • Every command takes --help (or -h). -- ends the options.
  • --json prints machine-readable output where a command lists it, and is an error elsewhere.
  • Every failure is one line on stderr and exit status 1. Success is exit status 0.
  • HOME must be set to an absolute path. Nothing is looked for relative to the working directory.
  • State lives in ~/.flow/remote, or in $FLOW_REMOTE_DIR when it is set.
  • Commands that talk to "the daemon" need flow-remote serve running for the same state directory. Without it they fail with "flow-remote is not running on this device", except devices, revoke, grant and deny, which then work on the stored device list directly.

Command summary

CommandNeeds the daemonEffect
serve(is the daemon)run the daemon in the foreground
pairyesprint a one-time pairing token, then approve the device that joins
joinnopair with another device, reading its token from stdin
devices [--json]nolist the paired devices
revoke <device>noforget a device and close its connections
grant <device> open|createnolet a paired device open or create sessions here
deny <device> open|createnotake that back
ping <device>nocheck that a paired device answers
sessions <device> [--json]nolist a paired device's terminal sessions
attach <device> <session>noopen a paired device's session live in this terminal
attach <device> --newnohave that device's Flow create a session, then open it
status [--json]yeswhat the daemon is doing
sync status [--json]yeswhat the daemon's sync is doing

serve

text
flow-remote serve [--bind tailscale|lan|loopback|tailcat|IP] [--port N] [--settings PATH]
                  [--sessions-index PATH] [--bus PATH] [--sink-db PATH] [--started-by-app]

Runs the daemon in the foreground: the network listener for your other devices and the local control socket for this device's commands. One daemon runs per state directory; a second one refuses to start.

serve refuses to start unless Puddles is on: features.remote must be true in ~/.flow/settings.json, or in the file --settings names. It reads the flag once, at start; switching Puddles off later does not stop a daemon you started by hand.

FlagValueDefaultEffect
--bindtailscale(none)listen on the tailnet IPv4 only; an error if there is none. With no --bind: the tailnet IPv4 when Tailscale is up, else loopback with a notice
lanlisten on every interface (opt-in). A literal 0.0.0.0 or :: is refused; use lan
loopbacklisten on 127.0.0.1; nothing to advertise, so no pairing token can be made
an IP addresslisten on that address
tailcatrun a tailcat tunnel server in the daemon and listen inside it; reaches other networks through public relays, with no Tailscale account. Opt-in only
--portinteger47633the listening port
--settingsabsolute path~/.flow/settings.jsonthe settings file the Puddles flag is read from
--sessions-indexabsolute pathnonethe app's index of groups and tab titles, so listings carry them
--busabsolute path~/.flow/bus.sockthe app's command socket, which creating sessions and the app's verbs ask
--sink-dbabsolute pathnonethe app's sync store (sink.db); without it the daemon serves without sync
--started-by-app(flag)offfor Flow's own use: marks a daemon the app may stop when Puddles turns off

Tailscale is found through its CLI: the macOS app's binary at /Applications/Tailscale.app/Contents/MacOS/Tailscale first, then PATH. A loopback address is never put in a pairing token.

pair

sh
flow-remote pair

Asks the daemon for a one-time pairing token and prints it: single use, valid for 5 minutes, one pairing waiting at a time. It then waits for the other device, shows the name and id that device gave and a six-digit confirmation code, and asks Pair with this device? [y/N]. y or yes (any case) approves; anything else, Ctrl-C, or no answer within 60 seconds of the other device arriving refuses.

pair needs a terminal on both stdin and stdout and takes no arguments. Approve only when your other device shows the same code: the name is whatever that device chose.

join

sh
flow-remote join

Reads a pairing token from stdin (on a terminal it prompts Pairing token: and switches echo off), dials the other device and pairs, printing Confirmation code: NNNNNN. Approve on the other device if it shows the same code. It ends with Paired with <name> (<id>). Echo is switched back on however it ends, Ctrl-C included.

The token is never taken as an argument: flow-remote join fr1.… is an error. A token from a script can be piped in:

sh
pbpaste | flow-remote join

devices

sh
flow-remote devices [--json]

Lists the paired devices: ID, NAME, LINK (connected or -), LAST SEEN and CAPABILITIES. Capabilities are sessions.list (every paired device), sessions.attach (granted open) and sessions.create (granted create). With no daemon running it reads the stored list, and nothing shows as connected.

revoke

sh
flow-remote revoke <device>

Forgets the device and, through a running daemon, closes its connections at once: Revoked Studio (a1b2…); closed 2 connection(s). With no daemon it edits the stored list, and the daemon refuses that device from its next request or handshake. Revoking is one-sided; remove this device on the other one too.

grant and deny

sh
flow-remote grant <device> open|create
flow-remote deny <device> open|create
WordCapabilityLets the device
opensessions.attachwatch this device's terminal sessions and type into them: full shell access here
createsessions.createhave Flow on this device create terminal sessions

Both are off by default. deny … open through a running daemon ends that device's live views at once and leaves its other links alone. Listing can't be granted or denied: it is what being paired means (use revoke). These are the same switches as Can open my sessions and Can create sessions on the Puddle page.

ping

sh
flow-remote ping <device>

Dials the device with this device's identity and prints the round trip: Studio (a1b2…) answered in 3.2 ms (API v…). A success also updates the device's last-seen time.

sessions

sh
flow-remote sessions <device> [--json]

Lists the other device's terminal sessions: SESSION and STATE, plus TAB (group › tab title) when the device sends them. It sends group names to a device it lets open or create sessions, and tab titles to one it lets open. A session marked no sharing can't be opened. Everything shown came from the other device and is cleaned before printing.

attach

text
flow-remote attach <device> <session>
flow-remote attach <device> --new [--group ID] [--request ID] [--resume] [--announce]

Opens a session of the other device live in this terminal: the remote screen as output, your keys as input, window resizes passed on. It needs a terminal on stdin and stdout and the device's open grant.

FlagEffect
--newhave the device's Flow create a session first (needs create), then attach to it. A reconnect attaches the session it made; it never creates a second one
--group IDwith --new: create the session in that app group
--request IDwith --new: the create's request id, 16–32 lowercase hex digits. A create repeated after a lost reply makes no second session on a device that supports it. Without it, attach picks one
--resumefor Flow's own use: with --request, only reattach the session that request made; never create
--announcefor Flow's own use: with --new, name the created session to the Flow pane before any remote output

attach exits only when the remote shell exits (with its status), when stdin ends or the terminal goes away, or on a signal from outside. Anything else reconnects by itself:

What happenedWhat attach does
the link dropped, or the device didn't answer (asleep, network change, its daemon restarting)retries by itself with a backoff from 0.5 s up to 10 s; shows "<device> is offline — this view reconnects when it's back." while it can't reach it
the device refused the handshakeretries; after three in a row, waits 15 s to a minute, and from the sixth at least five minutes
the device withdrew accesssays "<device> stopped sharing its sessions with this Mac." and which switch to ask for, then waits for Enter
the session is gonesays "<device> closed this session." and waits for Enter
a protocol error, an unpaired device or an old device that can't do itprints why, then "Press Enter to try again, or close this tab."

Enter always tries again at once. While waiting, a status of at most two dim lines sits on the bottom rows of the screen. The terminal stays in raw mode the whole time, so Ctrl-C reaches the remote program instead of ending the view. Keys typed while the remote screen is being replayed are dropped, never queued.

status

sh
flow-remote status [--json]

Asks the running daemon what it is doing. The text form prints the device name and id, then one line each:

LineShows
listeningthe address and port it listens on, and the bind mode
advertisesthe addresses a pairing token would carry, or nothing
devicesN paired, M connected (or why the device list is unreadable)
pairingwaiting for a device while a pair waits, else no
syncwith a sync store: its sequence number, the peers by state and the streams it serves; or off: and why
pidthe daemon's process id

A tailcat address is a secret and is always shown as tailcat (tc…). --json adds fields such as the live terminal streams, and "running": false when no daemon answers (the command still exits 1).

sync status

sh
flow-remote sync status [--json]

Shows what the daemon's sync is doing: the store (path, device, sequence number), each collection's rows per owner, each paired device's subscriber state (connecting, syncing, live, offline, refused, or too_old for a device whose Flow is too old to sync) with its last error, the streams it serves, the intents still waiting per device, and the last cleanup pass. It says sync is off when the daemon was started without --sink-db. See How Flow syncs data.

Files

PathWhat it holds
~/.flow/remote/identity.jsonthis device's name and keypair
~/.flow/remote/devices.jsonthe paired devices and their permissions
~/.flow/remote/daemon.logthe output of a daemon the app started
~/.flow/remote/tailcat.jsonthe tailcat tunnel's keys (--bind tailcat only); delete it and pair again to change the address

All are 0600 in a 0700 folder. Edit them only through these commands or the Puddle page.

Sources

Written from these files in the Flow app repo

  • src/bin/flow-remote.rs
  • docs/flow-remote.md
  • src/remote_link/pairing.rs
  • src/remote_link/mod.rs
  • src/puddle.rs
  • scripts/make-app.sh