Skip to content

mesh

Terminal window
snippbot mesh status # Show this machine's mesh key and membership
snippbot mesh status --json # The same, as JSON
snippbot mesh list # Every mesh this machine is in (and ones it left)
snippbot mesh join --code XXXX-XXXX --owner ADDRESS # New machine: join with the owner's code
snippbot mesh join # New machine: make a join ticket and a 6-digit code
snippbot mesh approve <ticket> # Owner machine: start letting that machine in
snippbot mesh accept <bundle> # New machine: check the mesh ID, then join
snippbot mesh members # List the machines in this mesh
snippbot mesh init --dev # Create a test mesh signed with software keys
snippbot mesh nodes # Machines this one can reach, and their agents
snippbot mesh tasks # Work given to other machines, and work given to this one
snippbot mesh task <task-id> # One task
snippbot mesh approve-task <caller> <task-id> # Allow (or --deny) a task waiting here
snippbot mesh answer <task-id> # Answer another machine's question about a task you gave it
snippbot mesh files # Files that moved between machines
snippbot mesh halt # Emergency stop (Control or owner machine)
snippbot mesh resume # Turn the mesh back on (owner machine)
snippbot mesh isolate <machine> # Cut one machine off; unisolate ends it
snippbot mesh pause [machine] # Pause new work; unpause lets it start again
snippbot mesh privilege <machine> control|member
snippbot mesh remove <machine> # Remove a machine from the mesh
snippbot mesh policy monitor|protect|lockdown
snippbot mesh grants # Permissions between machines
snippbot mesh grant <caller> <target> [options]
snippbot mesh revoke <grant-id>
snippbot mesh replace-phone # Make a new phone the confirming device
snippbot mesh replace-root [key] # List root keys, or replace one (test meshes)
snippbot mesh renew # Extend every membership by 90 days
snippbot mesh export <file> # Carry the record to another machine ...
snippbot mesh import <file> # ... and merge it there
snippbot mesh conflicts # A conflict in the record, if there is one
snippbot mesh merge # Settle it: keep the owner machine's version
snippbot mesh off # Take this machine out locally; on undoes it

Every command takes --mesh <slot> to say which mesh it is about (see Several meshes).

To turn it off, set SNIPPBOT_MESH_ENABLED=0 in the daemon’s environment and restart the daemon. With the setting off, the daemon creates no mesh key and no mesh routes, and the command reports that the mesh is off.


Shows the machine ID, the key fingerprint, where the key is stored, and whether this machine belongs to a mesh.

Terminal window
snippbot mesh status
Machine ID: lm6xybizr53g2qsp
Fingerprint: LM6X-YBIZ-R53G-2QSP
Key storage: keychain
Mesh: not a member of any mesh yet

The fingerprint is what you compare by eye when you admit a machine to a mesh. The private key never leaves the machine: it is kept in the Keychain on macOS, in Windows protected storage on Windows, and in a file only you can read elsewhere.

OptionDescription
--jsonOutput as JSON

A machine can be in more than one mesh. snippbot mesh list shows each one with its slot, its name, the start of its mesh ID, its state and this machine’s role, plus how many machines are online. It also lists meshes this machine left or disbanded; those can be restored or deleted on the Meshes page for 30 days.

Terminal window
snippbot mesh list
snippbot mesh list --json

Name the mesh in any other command with --mesh, before or after the command:

Terminal window
snippbot mesh --mesh <slot> members
snippbot mesh members --mesh <slot>

With only one mesh you don’t need it: the command finds that mesh and uses it. With several, a command that changes something and names no mesh is refused and asks you to choose. snippbot mesh off --mesh all takes this machine out of every mesh at once, and snippbot mesh on --mesh all puts it back in all of them.


Membership changes are approved in three places, and all three are needed:

  1. The owner machine starts the change (snippbot mesh approve, or the Mesh page).
  2. Your phone shows what is about to change and confirms it.
  3. A root key signs it: Touch ID on the owner Mac, or Windows Hello on the backup machine.

The steps for a new machine:

Terminal window
# On the new machine
snippbot mesh join > ticket.txt # also shows a fingerprint and a 6-digit code
# On the owner machine
snippbot mesh approve ticket.txt # asks for the code; shows the fingerprint to compare
# Back on the new machine, with the bundle the owner hands over
snippbot mesh accept bundle.txt # shows the mesh ID to compare, then joins

The simpler way, with nothing to carry between machines. On the owner machine open the Mesh page and press Add a machine; it shows an 8-character code that works once, for 10 minutes. Then on the new machine:

Terminal window
snippbot mesh join --code 7KQ4-M2T9 --owner daemon.example.com

--owner is the owner machine’s Snippbot address (the one your phone uses for it, or 192.168.1.20:18781 on the same network). The command prints this machine’s fingerprint and waits. Your phone shows the same fingerprint: check it there, approve, and sign on the owner machine. The new machine then joins by itself. Five wrong codes stop a code, and if two machines use the same code the owner stops both.

A machine joins with no permissions. A join ticket works once and for 10 minutes. A started approval waits 30 minutes for the phone and the root keys, and only one can be waiting at a time.

Every mesh command except snippbot mesh off needs an API key for the daemon, including the ones that only read, such as status, members and join (snippbot auth create-key, then --api-key or SNIPPBOT_API_KEY). A program running on the machine without that key, including an agent’s shell command, cannot read or change the mesh. The one thing it can do is take its own machine out with snippbot mesh off, which you can see and undo.

There are two kinds of action, and they are deliberately not equally easy.

Stops take effect at once. halt, isolate and pause are signed by the machine’s own key, so a Control machine can issue them without your phone or a root key. They only ever make the mesh do less.

CommandEffectWho
snippbot mesh haltEvery machine refuses mesh workControl or owner machine
snippbot mesh isolate <machine>One machine is cut off; it stays a memberControl or owner machine
snippbot mesh pause [machine]New work waits; running work finishesControl or owner machine
snippbot mesh unpause [machine]New work may start againControl or owner machine
snippbot mesh offThis machine alone refuses mesh workAny machine, for itself

snippbot mesh off needs no API key, no root key and no network, so it works in an emergency. snippbot mesh on, which puts the machine back, needs the API key like every other change.

Changes of power need your phone and a root key. They are started on the owner machine and then wait, one at a time, for the phone’s confirmation and a root key’s signature on the Mesh page.

CommandChange
snippbot mesh resumeLifts an emergency stop
snippbot mesh unisolate <machine>Ends a machine’s isolation
snippbot mesh privilege <machine> control|memberGives or takes away Control
snippbot mesh remove <machine>Removes a machine
snippbot mesh policy monitor|protect|lockdownSets the protection level (and the freshness window with --lease-hours)

A machine is named by its name or its fingerprint (see snippbot mesh members).

Being in the mesh allows nothing. A machine can ask another for work only after you give a permission that says who asks, who does the work and exactly what is allowed. Anything you don’t list is refused.

Terminal window
snippbot mesh grants # Who may ask whom for what
snippbot mesh grant studio-mac render-win \
--op delegate --agent render --tool 'comfy_*' \
--read 'B:/ComfyUI_dl/**' --write 'mesh-inbox/**' \
--usd-per-day 20 --max-concurrent 2 --days 90
snippbot mesh revoke g_Ab3xY9Qw # Withdraw one (ID from `grants`)
OptionMeaning
--opWhat the caller may do: delegate, ask, file_put, file_get, broadcast
--agentAn agent on the target the caller may use
--toolA tool that agent may use for the caller; comfy_* covers a family; a * is only allowed at the end, after three or more characters
--read, --writeFolders on the target the caller may read or write to
--usd-per-day, --max-minutes, --max-concurrentSpending, time and load limits
--standingDon’t ask you before each task (default: ask each time)
--daysExpire after this many days

Giving and withdrawing a permission are changes of power: your phone confirms and a root key signs. Folders where keys or passwords are kept (.ssh, .env, .aws, Snippbot’s own data folder and similar) can never be named, and every machine refuses a record entry that tries.

The machine that would do the work checks the permission against its own copy of the record before anything runs. Only its check counts. When the record changes so that the caller may no longer ask (a stop, isolation, removal, or the permission withdrawn), work already running for it is cancelled.

A machine that has not synced the record with another machine for 24 hours may have missed a removal or a stop. snippbot mesh status shows until when its copy counts as fresh. Change the window with snippbot mesh policy <level> --lease-hours N.

When machines are connected, freshness is renewed by agreeing with the owner machine, or with an always-on machine you name: snippbot mesh policy <level> --anchor <machine> (repeat for more). Agreeing with any other machine renews nothing, so a machine you removed can’t keep an out-of-date machine believing it is current.

Step by step, with the recovery table: Mesh Recovery.

The phone confirms every change, so it can’t confirm its own replacement. snippbot mesh replace-phone needs both root keys instead. Open Mesh in the Snippbot app on the new phone and offer it as the replacement, start the change on the owner machine, carry the request it shows to the machine that holds the other root key (Mesh → Machines → Replace or sign → Sign a request), and paste the signed block back.

The other machine checks the request against its own copy of the record before it lets you sign: the mesh, the phone being replaced and the record’s position must all match. If its copy is older, it asks you to import the latest record first (see below). You also have to tick that the new phone’s screen shows the key in the request. With the old phone gone, that comparison is the only thing that keeps someone else’s phone out.

If a root key is lost, stolen or being retired, the other root key signs its replacement and your phone confirms it. Either key can be recovered from, and no single key can swap out the other.

snippbot mesh replace-root lists the mesh’s root keys with their fingerprints. The replacement itself is done in Mesh → Machines → Replace or sign → Replace a root key on the owner machine, because a new key is created with Touch ID or Windows Hello:

  1. Choose the key to replace, and create the new key on this machine, or create it on your other machine (Mesh → Machines → Replace or sign → Create a new root key) and paste its block.
  2. Confirm on your phone. It shows the new key’s name and fingerprint; they must match the machine where the key was created.
  3. Sign with the other root key. If that key lives on your other machine, carry the request there (Mesh → Machines → Replace or sign → Sign a request) and paste the signed block back.

A key can’t approve its own replacement, and at least one root key must always be the kind that stays on one device. Replacing a root key does not change the phone, the machines or their permissions.

Changes to the mesh form one chain. If two different changes ever exist at the same position (for example after the owner machine is restored from an old backup and then makes a new change), each machine that sees both freezes: no change is accepted until the conflict is settled. Stops still work.

Terminal window
snippbot mesh conflicts # This machine's version and the other one
snippbot mesh merge # On the owner machine: keep its version, drop the other

Settling keeps the owner machine’s version. Your phone confirms and a root key signs. Every other machine then takes that version when it imports the record: it drops its own differing changes, keeps them as evidence, and cancels anything that was waiting for approval. A machine that was let in only by a dropped change is no longer in the mesh and needs a new join ticket.

By default machines are not connected, and the record is carried between them as a file (below). To connect them, one machine that the others can reach (for example a Fly machine) forwards for the rest:

SettingWhereMeaning
SNIPPBOT_MESH_RELAY=1The reachable machineForward sealed traffic between members that connect to it
SNIPPBOT_MESH_RELAYS=wss://host/mesh/relayEvery other machineDial out to that machine and stay connected (comma-separated for more than one)
SNIPPBOT_MESH_PUBLIC_URL=https://hostThe reachable machineIts own public address. A machine joining by code is told to meet it there, so nothing has to be set on the joining machine. Left unset, a remote-access tunnel with a lasting name that is running now is used (never a quick tunnel); with neither, the code screen warns that the new machine will have nowhere to meet it
SNIPPBOT_MESH_DIRECT=0Any machineKeep this machine forwarded-only: it never opens a direct path (default: direct paths allowed)

Restart the daemon after changing either. Machines at home or in an office open no inbound port: they only dial out. Each one proves to the forwarding machine that its key is in the mesh record, and then sets up an encrypted session with every other machine through it. The forwarding machine can’t read or alter what it passes along; it does see which machines talk and how much.

Once connected, a change made on one machine reaches the others within moments, and snippbot mesh status lists who this machine is linked to.

Direct paths on the same network. Two machines that are already linked through a forwarding machine and sit on the same local network can move their link onto a direct path between them. They agree a one-time secret over their sealed link, and every packet on the direct path carries a tag made with it, so the port answers nobody else. Only private network addresses are ever tried. If the direct path stops working, the two machines go back to the forwarding machine by themselves and try again later. This needs the optional aioquic library (pip install "snippbot[mesh-direct]"); without it, or with SNIPPBOT_MESH_DIRECT=0, machines simply keep using the forwarding machine. Machines on different networks (home and office) always use the forwarding machine in this version.

A machine that isn’t connected gets a stop or a change made on another machine only when you carry the record across:

Terminal window
snippbot mesh export record.txt # on the machine that has the newer record
snippbot mesh import record.txt # on the other machine; every entry is verified

Only a record of the same mesh is merged.

Memberships last 90 days. snippbot mesh renew on the owner machine extends all of them, using a renewal key that can do nothing else.

With a permission in place (see Permissions between machines), an agent on one machine can give a task to an agent on another. These commands show that work and let you answer what waits for you.

Terminal window
snippbot mesh nodes # Machines this one can reach: online or offline, and their agents
snippbot mesh tasks # Tasks given to other machines, and tasks given to this one
snippbot mesh task <task-id> # One task: state, agent, result, and anything waiting for you
snippbot mesh approve-task <caller> <task-id> # Allow a task waiting on this machine
snippbot mesh approve-task <caller> <task-id> --deny # Refuse it
snippbot mesh answer <task-id> [--deny] # Answer another machine's question about a task you gave it
snippbot mesh files # Files that moved, and refused requests this machine made
snippbot mesh files --all # Include finished transfers
  • Approving a task. A permission given without --standing makes each task wait on the machine that does the work until you approve it there with snippbot mesh approve-task. <caller> is the asking machine’s name or key, as snippbot mesh tasks shows it. Only a person can approve: an agent, or text from another machine, can’t approve a task.
  • Answering a question. While a task runs, the other machine may ask before it does something. snippbot mesh task <task-id> shows what it is waiting for; answer with snippbot mesh answer.
  • Files. A file that crosses the mesh lands in a quarantine folder on the receiving machine and is never run. snippbot mesh files hides finished transfers unless you pass --all; failed ones are always shown.
  • A task is never run again by the mesh itself. After a restart, a task that was running becomes interrupted and the asking machine is told. Sending it again makes a new task.

nodes, tasks, task, files and list take --json. Answering needs the API key, like every other change.

snippbot mesh init --dev creates a mesh whose root keys and phone are software stand-ins kept in a private file. It exists to try the flow without hardware, and it is refused unless the daemon runs with SNIPPBOT_MESH_DEV_ROOT=1. A test mesh is marked as such everywhere and must not be used for real work. A real mesh is created in the app, because its root keys are Touch ID or Windows Hello.

SystemStorage
macOSThe login Keychain
WindowsA file encrypted for your Windows account (DPAPI)
LinuxA file only you can read

If the Mac Keychain does not answer within 20 seconds (for example the login keychain is locked), the daemon starts with the mesh off and logs why. Set SNIPPBOT_MESH_KEY_STORE=file to keep the key in a private file instead.

If the daemon runs with no default Mac keychain, for example with HOME set to a folder that has no login keychain, it keeps the key in a private file in the mesh folder of its data directory and logs a warning. It does not show the “Keychain Not Found” dialog. A key the daemon has already saved stays where it is, so the machine keeps the same identity.