Skip to content
Bodylet AIBodylet AI
All pages

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#

CommandWhat it does
bodylet connect --server https://bodylet.sanstour.com --machineThis machine joins your fleet, after you approve the code in your browser
bodylet connect --server https://bodylet.sanstour.com --client claude-codeGives Claude Code access (or --client codex), after you approve
bodylet connect --server https://bodylet.sanstour.com --agentStores a token for the bodylet command only
bodylet agent login --server https://bodylet.sanstour.comStores a token you created in the dashboard. It asks for it without showing it
bodylet agent add --client claude-codeAdds the entry bodylet to Claude Code or Codex. --dry-run shows it first, --replace replaces a different entry
bodylet agent checkChecks that the stored token works, and how many machines it sees
bodylet agent remove --client claude-codeRemoves the entry and deletes the stored token
bodylet agent logoutDeletes the stored address and token
bodylet whoamiShows the account, the token and what it may do
bodylet profiles, bodylet profiles use NAMELists stored profiles (one per server or token), chooses one

Machines and commands#

CommandWhat it does
bodylet machinesLists the machines the token sees. Filters: --status, --os, --tag, --capability
bodylet machine NAMEOne 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 jobsRecent jobs. --machine, --status, --running, --done
bodylet job IDThe state of one job. --wait waits for its end
bodylet logs IDIts output. --follow keeps reading
bodylet cancel IDStops 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#

CommandWhat 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 listShows sessions
bodylet session close IDEnds 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#

CommandWhat it does
bodylet files ls NAME [PATH]The folders opened to agents, or one folder. --hidden shows hidden files
bodylet files cat NAME PATHPrints 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 PATHCopies 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:PATHCopies 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.

CommandWhat it does
bodylet preview open NAME --port NOpens a private preview of a port. Needs Open previews on the token
bodylet preview list, bodylet preview close IDLists 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.

CommandWhat it does
bodylet requirements check FILE|SESSIONOpens 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.

CommandWhat it does
bodylet desktop list, screenshot NAME -o FILE, observe NAMELooks at a desktop
bodylet desktop click, type, key, scroll, focus, launch, releaseDrives it
bodylet provision templates, create TEMPLATE, list, show NAME, destroy NAMEMachines 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.

CommandWhat 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 IDLists, creates and revokes agent tokens
bodylet auditReads the activity log
bodylet approvals, approvals approve ID, approvals deny IDLists 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.

CommandWhat it does
bodylet statusConnected or not, name, server, pause, what the policy allows
bodylet pause [REASON]Stops running jobs and refuses all agent work
bodylet resumeAllows it again
bodylet policy showWhat agents may do here
bodylet policy allow terminal.exec, deny terminal.execCommands
bodylet policy allow files.read FOLDER [--write], deny files.read FOLDERFolders
bodylet policy deny files.write, deny files.readStop 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_accountsPreviews of other accounts' servers
bodylet policy allow desktop.observe, allow desktop.controlDesktop
bodylet policy approval desktop.control never|sessionApprovals for the desktop
bodylet policy approval ports.preview never|first_use|alwaysApprovals for previews
bodylet policy approval machines.provision never|first_use|alwaysApprovals 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_accountsForwards to servers of other accounts
bodylet policy approval ports.forward never|first_use|alwaysApprovals for forwards
bodylet policy allow apps.check, allow apps.installApplication checks and installs
bodylet policy approval apps.install never|first_use|alwaysApprovals 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-installsLinux, 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-stdinJoins a fleet with a pairing code from the dashboard
bodylet-runtime desktop driver installInstalls the desktop driver
bodylet-runtime desktop takeover, handback, stopTakes the desktop back from an agent, gives it back, or ends the agent's session
bodylet-runtime uninstallRemoves everything Bodylet installed
bodylet versionThe version installed

The installer's options#

With a pipe, pass options after sh -s --. On Windows, call the script as shown.

Terminal
curl --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, LinuxWindowsWhat it does
--dry-run-DryRunChanges nothing. Prints the plan: version, files, service, how to uninstall
--yes-YesInstalls without asking Install? [y/N]
--no-connect-NoConnectDoes not connect the machine at the end
--client-only-ClientOnlyInstalls bodylet alone: no runtime, the computer does not join a fleet
--no-service-NoServiceRegisters 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.

CodeMeaning
0Success
11No token stored, or the token was refused
12Not allowed: by the token, or by the machine's policy (a port, a folder, a capability)
13Not found: no such machine, job or file for this token, or no machine meets what was asked. A forward that ended
15The machine cannot take it now: offline, paused, busy
16Bodylet cannot be reached, or is busy. Try again
17A problem on this computer
18Not available in this version, or not for this token
23A job is lost: its outcome is unknown
28requirements: a role does not meet its requirements
29requirements: a role could not be checked
45A copy did not complete: its checksum did not match, or its time ran out. Run it again
46requirements apply: a package manager failed
47files transfer: a name in the folder cannot be written on the destination's system. Nothing was written
30, 31connect: refused in the browser, or the code expired
33, 34An approval is needed first, or it was denied