mesh
Overview
Section titled “Overview”snippbot mesh status # Show this machine's mesh key and membershipsnippbot mesh status --json # The same, as JSONsnippbot 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 codesnippbot mesh join # New machine: make a join ticket and a 6-digit codesnippbot mesh approve <ticket> # Owner machine: start letting that machine insnippbot mesh accept <bundle> # New machine: check the mesh ID, then joinsnippbot mesh members # List the machines in this meshsnippbot mesh init --dev # Create a test mesh signed with software keys
snippbot mesh nodes # Machines this one can reach, and their agentssnippbot mesh tasks # Work given to other machines, and work given to this onesnippbot mesh task <task-id> # One tasksnippbot mesh approve-task <caller> <task-id> # Allow (or --deny) a task waiting heresnippbot mesh answer <task-id> # Answer another machine's question about a task you gave itsnippbot 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 itsnippbot mesh pause [machine] # Pause new work; unpause lets it start againsnippbot mesh privilege <machine> control|membersnippbot mesh remove <machine> # Remove a machine from the meshsnippbot mesh policy monitor|protect|lockdownsnippbot mesh grants # Permissions between machinessnippbot mesh grant <caller> <target> [options]snippbot mesh revoke <grant-id>snippbot mesh replace-phone # Make a new phone the confirming devicesnippbot mesh replace-root [key] # List root keys, or replace one (test meshes)snippbot mesh renew # Extend every membership by 90 dayssnippbot mesh export <file> # Carry the record to another machine ...snippbot mesh import <file> # ... and merge it theresnippbot mesh conflicts # A conflict in the record, if there is onesnippbot mesh merge # Settle it: keep the owner machine's versionsnippbot mesh off # Take this machine out locally; on undoes itEvery 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.
snippbot mesh status
Section titled “snippbot mesh status”Shows the machine ID, the key fingerprint, where the key is stored, and whether this machine belongs to a mesh.
snippbot mesh statusMachine ID: lm6xybizr53g2qspFingerprint: LM6X-YBIZ-R53G-2QSPKey storage: keychainMesh: not a member of any mesh yetThe 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.
Options
Section titled “Options”| Option | Description |
|---|---|
--json | Output as JSON |
Several meshes on one machine (--mesh)
Section titled “Several meshes on one machine (--mesh)”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.
snippbot mesh listsnippbot mesh list --jsonName the mesh in any other command with --mesh, before or after the command:
snippbot mesh --mesh <slot> memberssnippbot 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.
Letting a machine in
Section titled “Letting a machine in”Membership changes are approved in three places, and all three are needed:
- The owner machine starts the change (
snippbot mesh approve, or the Mesh page). - Your phone shows what is about to change and confirms it.
- A root key signs it: Touch ID on the owner Mac, or Windows Hello on the backup machine.
The steps for a new machine:
# On the new machinesnippbot mesh join > ticket.txt # also shows a fingerprint and a 6-digit code
# On the owner machinesnippbot mesh approve ticket.txt # asks for the code; shows the fingerprint to compare
# Back on the new machine, with the bundle the owner hands oversnippbot mesh accept bundle.txt # shows the mesh ID to compare, then joinsJoin with a code
Section titled “Join with a code”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:
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.
Stops and changes
Section titled “Stops and changes”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.
| Command | Effect | Who |
|---|---|---|
snippbot mesh halt | Every machine refuses mesh work | Control or owner machine |
snippbot mesh isolate <machine> | One machine is cut off; it stays a member | Control or owner machine |
snippbot mesh pause [machine] | New work waits; running work finishes | Control or owner machine |
snippbot mesh unpause [machine] | New work may start again | Control or owner machine |
snippbot mesh off | This machine alone refuses mesh work | Any 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.
| Command | Change |
|---|---|
snippbot mesh resume | Lifts an emergency stop |
snippbot mesh unisolate <machine> | Ends a machine’s isolation |
snippbot mesh privilege <machine> control|member | Gives or takes away Control |
snippbot mesh remove <machine> | Removes a machine |
snippbot mesh policy monitor|protect|lockdown | Sets the protection level (and the freshness window with --lease-hours) |
A machine is named by its name or its fingerprint (see snippbot mesh members).
Permissions between machines
Section titled “Permissions between machines”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.
snippbot mesh grants # Who may ask whom for whatsnippbot 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 90snippbot mesh revoke g_Ab3xY9Qw # Withdraw one (ID from `grants`)| Option | Meaning |
|---|---|
--op | What the caller may do: delegate, ask, file_put, file_get, broadcast |
--agent | An agent on the target the caller may use |
--tool | A 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, --write | Folders on the target the caller may read or write to |
--usd-per-day, --max-minutes, --max-concurrent | Spending, time and load limits |
--standing | Don’t ask you before each task (default: ask each time) |
--days | Expire 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.
Freshness
Section titled “Freshness”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.
Replacing the phone
Section titled “Replacing the phone”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.
Replacing a root key
Section titled “Replacing a root key”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:
- 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.
- Confirm on your phone. It shows the new key’s name and fingerprint; they must match the machine where the key was created.
- 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.
Settling a conflict in the record
Section titled “Settling a conflict in the record”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.
snippbot mesh conflicts # This machine's version and the other onesnippbot mesh merge # On the owner machine: keep its version, drop the otherSettling 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.
Connecting machines
Section titled “Connecting machines”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:
| Setting | Where | Meaning |
|---|---|---|
SNIPPBOT_MESH_RELAY=1 | The reachable machine | Forward sealed traffic between members that connect to it |
SNIPPBOT_MESH_RELAYS=wss://host/mesh/relay | Every other machine | Dial out to that machine and stay connected (comma-separated for more than one) |
SNIPPBOT_MESH_PUBLIC_URL=https://host | The reachable machine | Its 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=0 | Any machine | Keep 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.
Carrying the record between machines
Section titled “Carrying the record between machines”A machine that isn’t connected gets a stop or a change made on another machine only when you carry the record across:
snippbot mesh export record.txt # on the machine that has the newer recordsnippbot mesh import record.txt # on the other machine; every entry is verifiedOnly a record of the same mesh is merged.
Renewals
Section titled “Renewals”Memberships last 90 days. snippbot mesh renew on the owner machine extends all of them, using a
renewal key that can do nothing else.
Work between machines
Section titled “Work between machines”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.
snippbot mesh nodes # Machines this one can reach: online or offline, and their agentssnippbot mesh tasks # Tasks given to other machines, and tasks given to this onesnippbot mesh task <task-id> # One task: state, agent, result, and anything waiting for yousnippbot mesh approve-task <caller> <task-id> # Allow a task waiting on this machinesnippbot mesh approve-task <caller> <task-id> --deny # Refuse itsnippbot mesh answer <task-id> [--deny] # Answer another machine's question about a task you gave itsnippbot mesh files # Files that moved, and refused requests this machine madesnippbot mesh files --all # Include finished transfers- Approving a task. A permission given without
--standingmakes each task wait on the machine that does the work until you approve it there withsnippbot mesh approve-task.<caller>is the asking machine’s name or key, assnippbot mesh tasksshows 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 withsnippbot mesh answer. - Files. A file that crosses the mesh lands in a quarantine folder on the receiving machine and
is never run.
snippbot mesh fileshides 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
interruptedand 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.
Test meshes
Section titled “Test meshes”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.
Where the machine key is kept
Section titled “Where the machine key is kept”| System | Storage |
|---|---|
| macOS | The login Keychain |
| Windows | A file encrypted for your Windows account (DPAPI) |
| Linux | A 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.