Command reference
Bodylet installs two programs:
bodylet, the command line. Use it on any computer to reach your fleet, and on a machine of your fleet to manage that machine.bodylet-runtime, what makes a machine part of your fleet. You rarely call it: bodylet passes the machine commands (status, pause, resume, policy, pair) to it.
bodylet <command> --help describes every option. Every command accepts --json for output that scripts can read.
Connect#
| Command | What it does |
|---|
bodylet connect --server https://bodylet.sanstour.com --machine | This machine joins your fleet, after you approve the code in your browser |
bodylet connect --server https://bodylet.sanstour.com --client claude-code | Gives Claude Code access (or --client codex), after you approve |
bodylet connect --server https://bodylet.sanstour.com --agent | Stores a token for the bodylet command only |
bodylet agent login --server https://bodylet.sanstour.com | Stores a token you created in the dashboard. It asks for it without showing it |
bodylet agent add --client claude-code | Adds the entry bodylet to Claude Code or Codex. --dry-run shows it first, --replace replaces a different entry |
bodylet agent check | Checks that the stored token works, and how many machines it sees |
bodylet agent remove --client claude-code | Removes the entry and deletes the stored token |
bodylet agent logout | Deletes the stored address and token |
bodylet whoami | Shows the account, the token and what it may do |
bodylet profiles, bodylet profiles use NAME | Lists stored profiles (one per server or token), chooses one |
Machines and commands#
| Command | What it does |
|---|
bodylet machines | Lists the machines the token sees. Filters: --status, --os, --tag, --capability |
bodylet machine NAME | One machine: inventory, capabilities, shells, presence |
bodylet exec NAME --shell sh -- 'COMMAND' | Runs a command and prints its output. Shells: sh, bash, cmd, powershell, pwsh, or default |
bodylet exec --os linux --shell sh -- 'COMMAND' | Lets Bodylet choose a machine (--os, --tag, --capability) |
bodylet exec NAME --detach ... | Starts the job and returns at once |
bodylet exec --machines A,B,C --shell sh -- 'COMMAND' | The same command on several machines, as one group |
bodylet jobs | Recent jobs. --machine, --status, --running, --done |
bodylet job ID | The state of one job. --wait waits for its end |
bodylet logs ID | Its output. --follow keeps reading |
bodylet cancel ID | Stops a job (every job of a group) |
bodylet jobs wait ID ID ... | Waits until all the jobs are done, or the first with --any |
Other options of exec: --cwd (folder to start in), --env NAME=VALUE, --timeout SECONDS, --merge (one output stream).
Work sessions#
| Command | What it does |
|---|
bodylet session open --role NAME:REQUIREMENTS ... | Holds one machine per role. Requirements: os=, arch=, tag=, capability=, cpus=, memory=, disk=, gpus=, vram=, machine=, exclude=, exclusive. --ttl sets how long (up to 24 hours) |
bodylet session status ID, bodylet session list | Shows sessions |
bodylet session close ID | Ends it, frees its machines, stops its jobs (unless --keep-jobs) |
bodylet exec --session ID --roles R1,R2 ... | Runs on the machines of the session |
Files#
| Command | What it does |
|---|
bodylet files ls NAME [PATH] | The folders opened to agents, or one folder. --hidden shows hidden files |
bodylet files cat NAME PATH | Prints a text file |
bodylet files write NAME PATH [TEXT] | Creates or replaces a small file (256 KiB at most), from the text or from standard input. --overwrite to replace |
bodylet files put NAME LOCAL PATH | Copies a file to the machine, up to 1 GiB, checksum checked; resumes after a cut |
bodylet files get NAME PATH [LOCAL] | Copies a file from the machine, checksum checked; resumes after a cut |
bodylet files transfer MACHINE:PATH MACHINE:PATH | Copies a file or a folder from one machine to another, up to 8 GiB, checksum checked; resumes after a cut. --sha256, --overwrite, --create-parents, --detach |
Previews, forwards and exposures#
See Web apps and ports for when to use each one.
| Command | What it does |
|---|
bodylet preview open NAME --port N | Opens a private preview of a port. Needs Open previews on the token |
bodylet preview list, bodylet preview close ID | Lists and closes previews |
bodylet forward NAME:PORT [--local PORT] | Reaches a TCP port of the machine from 127.0.0.1 of this computer, until Ctrl-C. --ttl (1 hour by default, 24 hours at most), --bind. Needs Forward ports |
bodylet expose [NAME] --port N [--private|--token] [--name NAME] | Gives a port an https:// address, for people of your account (--private) or for programs with its secret (--token). --ttl (8 hours by default). Needs Open previews |
bodylet exposures, bodylet unexpose ID|NAME [--release-name] | Lists and closes exposures |
Applications#
See Applications and requirements. These need Check applications on the token, and Install applications to install.
| Command | What it does |
|---|
bodylet requirements check FILE|SESSION | Opens a work session from a requirements document (YAML or JSON), or checks a session again, and prints each role's state and plan |
bodylet requirements apply FILE|SESSION [--role R] | Runs the plans: waits for their approval, follows the installs and copies, checks again. --detach returns at once |
Desktop and created machines#
The desktop commands need See the desktop on the token (and Use the desktop to act). The provision commands need Create machines on a host and a quota.
| Command | What it does |
|---|
bodylet desktop list, screenshot NAME -o FILE, observe NAME | Looks at a desktop |
bodylet desktop click, type, key, scroll, focus, launch, release | Drives it |
bodylet provision templates, create TEMPLATE, list, show NAME, destroy NAME | Machines created on a host |
Your fleet, with an operator token#
These manage the fleet itself and need an operator token (see Connecting agents). Add --profile owner when the token is stored under that profile.
| Command | What it does |
|---|
bodylet pair-code [--name NAME] [--tag T]... | Creates a pairing code, with the name and tags the machine will get |
bodylet tokens, tokens create, tokens revoke ID | Lists, creates and revokes agent tokens |
bodylet audit | Reads the activity log |
bodylet approvals, approvals approve ID, approvals deny ID | Lists and decides approvals |
bodylet provision quotas, provision quota-set TOKEN_ID ... | Lists and sets what each agent token may create |
On a machine of your fleet#
Run these in a terminal of the machine, as its owner.
| Command | What it does |
|---|
bodylet status | Connected or not, name, server, pause, what the policy allows |
bodylet pause [REASON] | Stops running jobs and refuses all agent work |
bodylet resume | Allows it again |
bodylet policy show | What agents may do here |
bodylet policy allow terminal.exec, deny terminal.exec | Commands |
bodylet policy allow files.read FOLDER [--write], deny files.read FOLDER | Folders |
bodylet policy deny files.write, deny files.read | Stop writing, stop all files |
bodylet policy allow ports.preview [FIRST-LAST], deny ports.preview [FIRST-LAST] | Previews |
bodylet policy allow ports.other_accounts, deny ports.other_accounts | Previews of other accounts' servers |
bodylet policy allow desktop.observe, allow desktop.control | Desktop |
bodylet policy approval desktop.control never|session | Approvals for the desktop |
bodylet policy approval ports.preview never|first_use|always | Approvals for previews |
bodylet policy approval machines.provision never|first_use|always | Approvals on a host |
bodylet policy allow ports.forward [PORTS], deny ports.forward [PORTS] | Forwards. PORTS is one port or a range, such as 5432 8000-8100 |
bodylet policy allow forward.other_accounts, deny forward.other_accounts | Forwards to servers of other accounts |
bodylet policy approval ports.forward never|first_use|always | Approvals for forwards |
bodylet policy allow apps.check, allow apps.install | Application checks and installs |
bodylet policy approval apps.install never|first_use|always | Approvals for installs (always until you change it) |
bodylet-runtime apps status, apps check [NAME...] | What is allowed and how installs would work here; check applications now |
sudo ~/.local/bin/bodylet-runtime apps enable-system-installs | Linux, by an administrator: lets Bodylet install packages with apt. Then restart the service as your account, with the line it prints. disable-system-installs turns it off |
bodylet pair --server https://bodylet.sanstour.com --code-stdin | Joins a fleet with a pairing code from the dashboard |
bodylet-runtime desktop driver install | Installs the desktop driver |
bodylet-runtime desktop takeover, handback, stop | Takes the desktop back from an agent, gives it back, or ends the agent's session |
bodylet-runtime uninstall | Removes everything Bodylet installed |
bodylet version | The version installed |
The installer's options#
With a pipe, pass options after sh -s --. On Windows, call the script as shown.
Terminalcurl --proto '=https' --tlsv1.2 -fsS https://bodylet.sanstour.com/install.sh | sh -s -- --dry-run
PowerShell& ([scriptblock]::Create((irm https://bodylet.sanstour.com/install.ps1))) -DryRun
| macOS, Linux | Windows | What it does |
|---|
--dry-run | -DryRun | Changes nothing. Prints the plan: version, files, service, how to uninstall |
--yes | -Yes | Installs without asking Install? [y/N] |
--no-connect | -NoConnect | Does not connect the machine at the end |
--client-only | -ClientOnly | Installs bodylet alone: no runtime, the computer does not join a fleet |
--no-service | -NoService | Registers nothing that starts the runtime. You run bodylet-runtime run yourself, for example in a container |
Exit codes#
Scripts can rely on these. bodylet exec otherwise exits with the exit code of the command.
| Code | Meaning |
|---|
| 0 | Success |
| 11 | No token stored, or the token was refused |
| 12 | Not allowed: by the token, or by the machine's policy (a port, a folder, a capability) |
| 13 | Not found: no such machine, job or file for this token, or no machine meets what was asked. A forward that ended |
| 15 | The machine cannot take it now: offline, paused, busy |
| 16 | Bodylet cannot be reached, or is busy. Try again |
| 17 | A problem on this computer |
| 18 | Not available in this version, or not for this token |
| 23 | A job is lost: its outcome is unknown |
| 28 | requirements: a role does not meet its requirements |
| 29 | requirements: a role could not be checked |
| 45 | A copy did not complete: its checksum did not match, or its time ran out. Run it again |
| 46 | requirements apply: a package manager failed |
| 47 | files transfer: a name in the folder cannot be written on the destination's system. Nothing was written |
| 30, 31 | connect: refused in the browser, or the code expired |
| 33, 34 | An approval is needed first, or it was denied |