@boxd/run re-exports the boxd TypeScript SDK as boxd, already authenticated for the machine it runs on. Import it and call it.
What it can reach
The client is scoped like the machine it runs on:
The in-machine
boxd CLI follows the same rule. On a private machine the script acts as the machine’s owner, fenced to that organization. On a shared machine it acts for the org’s shared machines only.
Fan work out to fresh machines
The reason to reach for the SDK from an automation is usually fan-out. Something happens, and you want one clean machine per unit of work instead of doing it all on the machine the script lives on.review-on-pr.run.ts
machines.create({ fromSnapshot }) creates a machine from a snapshot with everything already installed and running, except the snapshot’s automations, which start paused (see below). exec collects stdout, stderr, exitCode and success. An array command is shell-quoted for you, and a string is passed to a shell as is.
Fork the machine you are on
A fork copies a running machine, memory and disk included, in under 200ms. From a script that means “take a copy of exactly this state and try something on it”:fork.pausedAutomations says how many. To scale an automation out, start it on each copy with run restart <id>, for example through exec. See Jobs.
Checkpoint before a risky step
Clean up a fleet on a schedule
Your laptop, through the same object
boxd.local is the laptop bridge: files under your home directory and a Chrome on your laptop, through the client utilities. It is covered in Scripts and Browsers.