Setup scripts and env
A setup script runs once, on the VM’s first boot, as the default user agentcloud, with each --env variable exported.
cat setup.sh | ssh turm.dev new --name=demo --setup-script /dev/stdin --env API_TOKEN=abc123For a short script, pass it inline:
ssh turm.dev new --setup-script '"#!/bin/sh\ntouch ~/ready"'A default script for every VM
Section titled “A default script for every VM”Save a script once and every new runs it:
cat setup.sh | ssh turm.dev defaults write new.setup-script /dev/stdinssh turm.dev new --name=demo # runs setup.sh, plus any --env you passssh turm.dev new --name=other --setup-script '"echo just this one"' # replaces the defaultssh turm.dev new --name=bare --no-setup-script # skips itdefaults read new.setup-script prints the saved script, and defaults delete new.setup-script removes it. The script is kept with your account rather than on one server, so it applies wherever the VM is placed. Changing it doesn’t affect VMs that already exist.
Check the result
Section titled “Check the result”ls shows setup: pending, ok or failed (exit N). The output is in ~/.agentcloud/setup.log. SSH sessions land as root, so use the full path:
ssh vm+demo@turm.dev cat /home/agentcloud/.agentcloud/setup.logDetails
Section titled “Details”- The script’s
$HOMEis/home/agentcloud. Write there or to/tmp; it can’t write to/root. - Go, Postgres and temp directories: Building in a VM.
- Scripts are capped at 64 KiB. For something bigger, have the script download it.
- The
--envvariables are also saved to~/.agentcloud/env(mode 600), which login shells source.