Forkspan

CLI reference

Every forkspan command with its options, its exit codes and its settings.

The forkspan executable installs, registers and runs the sandbox service on a sandbox server. Before installation, run it from the directory that holds it, as ./forkspan. The installer then creates the forkspan command link.

On Linux, run each command as root. On macOS, run it as your user:

sudo forkspan status

Commands

CommandEffect
forkspan --versionPrint the version, such as forkspan-cli 0.1.0 (engine opensandbox-server 1.1.1).
forkspan installInstall the service and register the machine. See Install options.
forkspan registerRegister an installed machine with a token from --token-stdin. Add --reregister to replace a registration.
forkspan startStart the service.
forkspan stopStop the service now. Running work stops too.
forkspan drainStop taking new work. Add --wait to wait for current work to finish.
forkspan resumeTake new work again after a drain.
forkspan restartDrain, restart the service and wait until it is ready.
forkspan statusShow the installation, the service, the registration, the engine, the connection and the maintenance state. Add --check to exit 0 only when the machine can accept work.
forkspan doctorCheck the host and the installation. See Doctor options.
forkspan logsPrint the last 200 lines of service logs. Add --follow to stream them.
forkspan diagnosticsWrite one private archive for a support request to the path in --output <path>. Nothing is uploaded.
forkspan config showList the saved settings.
forkspan config set <key> <value>Save one setting. See Settings.
forkspan uninstallRemove the service, the installation and the command link. Add --purge-data to remove the state too.

Install options

forkspan install takes these options. forkspan register takes --token-stdin, --ownership and --reregister.

OptionEffect
--noninteractiveNever prompt. Requires --base-url.
--base-url <url>The address of the Forkspan web app.
--token-stdinRead the registration token from standard input.
--prefix <dir>The installation directory.
--name <name>The machine name. The default is the host name.
--ownership workspaceRequired for a token created for a workspace-owned machine. The default is personal.
--cpu-millicores <n>CPU that Forkspan work can use, in millicores. The default is all cores.
--memory-bytes <n>Memory that Forkspan work can use. The default is all memory.
--disk-bytes <n>Disk that Forkspan work can use. The default is the free space in the state directory.
--bin-dir <dir>Where to create the forkspan command link. The default is /usr/local/bin.
--reregisterReplace an existing registration with the new token.

Doctor options

OptionEffect
--offlineSkip the network checks.
--smokeRun one small, fixed sandbox through the bundled engine.
--jsonWrite one JSON document to stdout. Progress goes to stderr.

forkspan doctor explains each check and option.

Settings

forkspan config show lists the saved settings. forkspan config set <key> <value> saves one change, which the service loads at its next start.

KeyValue
nameThe machine name.
base-urlThe address of the Forkspan web app.
docker-contextThe Docker context the service uses.
docker-hostThe Docker endpoint the service uses.
cpu-millicoresCPU that Forkspan work can use.
memory-bytesMemory that Forkspan work can use.
disk-bytesDisk that Forkspan work can use.

A capacity value above what the machine has is refused.

The machine takes one run per CPU core at most, within its CPU, memory and disk. To run fewer at once, set Simultaneous attempts on the machine's Capacity tab in the app.

You cannot move a registered machine to another Forkspan address with config set base-url. The stored credential belongs to the original address. Register the machine again instead.

Exit codes

Every forkspan command uses the same exit codes.

CodeMeaning
0Success.
2Usage error: a missing or unknown option.
3Refused: a requirement or an authorization is missing.
4The operation failed.

Some commands give these codes a narrower meaning:

  • forkspan doctor exits 0 when every required check passed. Warnings do not change the exit code. It exits 3 when a required check failed or was not checked.
  • forkspan doctor --offline on an installed machine always exits 3. The API check is required there, and the option skips it.
  • forkspan status exits 0 whenever it can inspect the machine. status --check exits 0 only when the machine can accept work, and 3 otherwise.
  • On Linux, forkspan install without sudo exits 4 when it cannot create the service account or write system directories.

On this page