Foundational Compute

CLI reference

The main fdtn commands and options. fdtn --help lists all commands. fdtn <command> --help shows the options of one command.

Install and update

Needs Node.js 22.19 or newer. The install line checks Node.js and the file checksum.

$ curl -fsSL https://compute.fdtn.dev/install | sh
$ fdtn auth

The CLI updates itself once a day. fdtn with no arguments shows a home screen.

Rules for all commands

NamesWhere a command takes a sandbox ID, you can give @name (from fdtn create --name). A name has 1 to 64 letters, digits, - or _. A new name can take a few seconds to appear.
OutputCommands that print data take --json. Commands marked [format] also take -f, --format <pretty|json>. JSON keeps every API field; times are ISO 8601 UTC.
Lifetimeexec, cp, files, process, each and connect make the time left at least 5 minutes.
KeyFrom FDTN_API_KEY, then ~/.fdtn/key. A key file that other users can read is refused (fix: chmod 600 ~/.fdtn/key).
Exit codes0 worked. 1 failed or bad input. 128+N: signal N (Ctrl-C gives 130). exec, create, connect and claude return the command's or shell's own code.
EnvironmentFDTN_API_KEY (wins over the key file), FDTN_DEBUG=1 (full error text), NO_COLOR=1.

Setup

CommandWhat it does
fdtn authAsks for the key, saves it in ~/.fdtn/key (mode 600) and checks it. --replace saves a new key over a working one. From a pipe (fdtn auth < key.txt) it saves with no check.
fdtn doctorChecks key, DNS, TLS and API access, and shows the fix for the first failure. --create also runs echo ok in a new sandbox. --json. Troubleshooting
fdtn envPrints shell lines that point other tools at your workspace. The output never contains the key. --shell bash|zsh|fish|powershell (default from $SHELL), --json.
fdtn updateInstalls the newest fdtn now.
fdtn versionPrints the version. Same as fdtn -V.
$ fdtn auth
$ fdtn doctor --create
$ eval "$(fdtn env)"              # or: fdtn env --shell fish | source

Sandboxes

These commands also exist under fdtn sandbox (short fdtn sbx), with info, logs, metrics, timeout, refresh and network.

fdtn create [template]

Starts a sandbox (default base) and opens a terminal in it. On exit the sandbox stops, unless you set --timeout. Alias: cr.

OptionDefaultWhat it does
-d, --detachoffPrint the ID and return. No terminal. Use this in scripts.
--name <name>noneName for @name. With --count 3: name-1 to name-3.
-m, --metadata <pairs>noneSuch as project=demo,run=eval-1.
--count <n>1Start several, five at a time. Needs --detach. Maximum 100.
--jsonoffWith --detach: one JSON result per line.
--timeout <seconds>noneLifetime after you leave. 30 to 86400.
--lifecycle.ontimeout <action>killpause or kill when the lifetime ends.
--publicoffOpen ports without a token.
--trustedoffRun only on machines that Foundational Compute owns.
-e, --env <KEY=VALUE>noneEnvironment variable. Repeatable.
-u, --user, -c, --cwdsandbox user, homeTerminal user and folder. Not with --detach.
$ fdtn create                                        # a terminal in a base sandbox
$ fdtn create base -d --name worker --timeout 3600   # start only, print the ID
$ fdtn create base -d --count 10 --metadata run=eval-1 --json

fdtn claude

Opens Claude Code in a claude sandbox on a machine that Foundational Compute owns. A local ANTHROPIC_API_KEY goes into the sandbox environment only. --keep keeps the sandbox after you leave, for --timeout seconds (default 3600). --secret <name> uses a saved secret: the sandbox gets a placeholder, never the key.

$ fdtn claude --keep --timeout 7200
$ fdtn claude --secret anthropic

fdtn ls [format]

OptionDefaultWhat it does
-s, --staterunningrunning, paused or running,paused.
-m, --metadatanoneFilter by metadata.
-t, --templatenoneFilter by template name or ID.
--started-after <date>noneISO 8601 time, such as 2026-01-01T00:00:00Z.
-o, --orderascBy start time: asc or desc.
-l, --limit10000 shows all.
--watch, --interval <s>off, 3Refresh every 1 to 3600 seconds until Ctrl-C.
$ fdtn ls -s running,paused -m run=eval-1 --watch

fdtn connect <sandboxID>

Opens a terminal in a sandbox. A paused sandbox resumes. Options: -u, -c, -e (as for create). Alias: cn.

$ fdtn connect @worker

fdtn exec <sandboxID> <command...>

Runs a command and returns its output and exit code. Put fdtn options before the ID. Standard input goes to the command. Use fdtn cp for binary data. Alias: ex.

OptionWhat it does
-b, --backgroundPrint the process ID and return at once. --json prints both IDs.
-c, --cwd, -u, --userFolder and user. Default: home folder, sandbox user.
-e, --env <KEY=VALUE>Environment variable. Repeatable.
$ fdtn exec -c /app -e DEBUG=1 @worker npm test
$ echo hello | fdtn exec @worker cat
$ fdtn exec -b @worker node server.js       # prints the process ID

A command that starts with a dash cannot run directly. Run it with sh -c.

fdtn each -m <pairs> -- <command...>

Runs one command in each running or paused sandbox with the metadata. One failure does not stop the others; exit 1 if any failed. --concurrency (default 5, maximum 20), -c, --cwd, --json.

$ fdtn each --metadata run=eval-1 --json -- python /app/eval.py

fdtn pause, fdtn resume, fdtn kill

CommandWhat it does
fdtn pause [id]Keeps memory and files; stops the vCPU and memory charge. Give an ID, @name or -m <pairs>. Alias: ps. Paused limits
fdtn resume [id]Starts a paused sandbox again. Give an ID, @name or -m <pairs>. Alias: rs.
fdtn kill [ids...]Stops sandboxes and deletes their files. -a, --all with optional -s <state> and -m <pairs>.

All three take --json: one result per sandbox per line.

$ fdtn pause @worker
$ fdtn resume --metadata run=eval-1 --json
$ fdtn kill --all --state running,paused --metadata run=eval-1

fdtn sandbox subcommands

CommandWhat it does
info <id> [format]State, size, times, lifecycle, network, metadata. Alias: in.
logs <id> [format]What started, ran and failed. Kept some days after the end. --level (default info), -f, --follow, --loggers. Alias: lg.
metrics <id> [format]CPU, memory and disk, a sample about every 5 seconds. -f, --follow. Alias: mt.
timeout <id> <seconds>Sets the time left from now, shorter or longer. Maximum 86400.
refresh <id> <seconds>Makes the time left at least this long. Never shortens it. 1 to 3600.
network <id> --input <file|->Replaces outbound rules from JSON: allow_internet_access, allowOut, denyOut.
$ fdtn sandbox logs @worker --follow --level debug
$ fdtn sandbox timeout @worker 1800
$ echo '{"allow_internet_access":false}' | fdtn sandbox network @worker --input -

fdtn process ls|wait|kill

SubcommandWhat it does
process ls <sandbox> [format]Running commands with PID, command and folder.
process wait <sandbox> <pid>Follows the output of an exec -b command and returns its exit code.
process kill <sandbox> <pid>Stops one command.
$ pid=$(fdtn exec -b @worker python train.py)
$ fdtn process wait @worker "$pid"

Files

fdtn cp <source> <destination> [format]

Copies between this computer and a sandbox. Write the sandbox side as ID:path or @name:path. -r copies a folder; --force replaces files.

$ fdtn cp ./input.json @worker:/app/input.json
$ fdtn cp -r @worker:/app/results ./results

A local path through a symbolic link fails. On macOS, write /private/tmp, not /tmp. For a local path with a colon, use fdtn files push or pull.

fdtn files ... [format]

Each subcommand takes the sandbox ID or @name first.

SubcommandWhat it does
ls [path]Lists a folder (default .).
pull <src> <dest>, push <src> <dest>Download or upload. Take -r and --force.
info, mkdir, remove <path>Details, new folder, delete.
move <src> <dest>Moves or renames.
$ fdtn files push @worker ./data /app/data -r

fdtn collect [format]

Downloads one result folder from each sandbox in a group into --destination, with a manifest.json of SHA-256 checksums.

OptionWhat it does
--destination <local>Required. Folder for results and the manifest.
-m, --metadata, --path <remote>New collection: which sandboxes, and which folder in each.
--retry-failedRetry failed downloads and keep finished ones.
$ fdtn collect --metadata run=eval-1 --path /app/results --destination ./results-1
$ fdtn collect --retry-failed --destination ./results-1

Templates

Short form: fdtn tpl. Guide: Templates.

fdtn template create <name>

Builds a template from a Dockerfile, new or again, and prints the log. A build is free. At a spending limit, new builds stop. Alias: ct.

OptionDefaultWhat it does
-p, --pathcurrent folderBuild context folder.
-d, --dockerfilefdtn.Dockerfile, then DockerfileDockerfile to build.
--cpu-count2vCPUs per sandbox, up to 16.
--memory-mb1024MiB per sandbox, an even number up to 32768. Rounded up to 512 MiB blocks.
--min-free-disk-mbserviceFree disk after the build. At most 5120, 10240 or 20480, by memory size.
-c, --cmd, --ready-cmdnoneStart command, and a command that exits 0 when ready. --cmd needs --ready-cmd.
--no-cachecache onBuild every step again.
$ fdtn template create my-env --cpu-count 4 --memory-mb 4096
$ fdtn create my-env

Other template commands

CommandWhat it does
template list [format]Name, ID, status, size, age. Alias: ls.
template delete [names...]Deletes templates. -y skips the question; -s picks from a list. Alias: dl.
template initWrites starter build files. -n <name>, -l typescript|python-sync|python-async, -p <path>. Alias: it.
template resolve <alias>Shows a template name if it exists.
template tags ls|add|removels <template-id>; add <name:tag> <tags...>; remove <name> <tags...>.
template build status|logs <template-id> <build-id>Build status or log. Give the template ID, not the name.
$ fdtn template delete old-env other-env --yes
$ fdtn template tags add my-env:default stable

Snapshots

fdtn snapshot create <sandbox> --name <name> saves a sandbox as a template that new sandboxes start from. Always give --name: you start from it and delete by it. --trusted and claude sandboxes cannot make one. Snapshots

$ fdtn snapshot create @worker --name worker-ready
$ fdtn create worker-ready -d
$ fdtn snapshot delete worker-ready

Secrets

Values come from a JSON file or stdin, never from a command-line argument. Secrets

$ fdtn secrets create --input anthropic.json
$ fdtn secrets ls
$ fdtn secrets info <id>
$ fdtn secrets rotate <id> --input new.json
$ fdtn secrets delete <id>

Utilities

fdtn api <path>

Calls an HTTP API path with your saved key and prints the JSON. -X <method> (default GET), --input <file|-> for a JSON body, --include for the next page token.

$ echo '{"timeout":600}' | fdtn api /sandboxes/i3k9.../timeout -X POST --input -

fdtn harbor [arguments...]

Runs Harbor with your key and Foundational Compute as the sandbox service. Do not give Harbor an environment option. Evals with Harbor

$ fdtn harbor run -d terminal-bench@2.0 -a oracle -n 2

Next