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
| Names | Where 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. |
|---|---|
| Output | Commands that print data take --json. Commands marked [format] also take -f, --format <pretty|json>. JSON keeps every API field; times are ISO 8601 UTC. |
| Lifetime | exec, cp, files, process, each and connect make the time left at least 5 minutes. |
| Key | From FDTN_API_KEY, then ~/.fdtn/key. A key file that other users can read is refused (fix: chmod 600 ~/.fdtn/key). |
| Exit codes | 0 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. |
| Environment | FDTN_API_KEY (wins over the key file), FDTN_DEBUG=1 (full error text), NO_COLOR=1. |
Setup
| Command | What it does |
|---|---|
fdtn auth | Asks 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 doctor | Checks 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 env | Prints 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 update | Installs the newest fdtn now. |
fdtn version | Prints 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.
| Option | Default | What it does |
|---|---|---|
-d, --detach | off | Print the ID and return. No terminal. Use this in scripts. |
--name <name> | none | Name for @name. With --count 3: name-1 to name-3. |
-m, --metadata <pairs> | none | Such as project=demo,run=eval-1. |
--count <n> | 1 | Start several, five at a time. Needs --detach. Maximum 100. |
--json | off | With --detach: one JSON result per line. |
--timeout <seconds> | none | Lifetime after you leave. 30 to 86400. |
--lifecycle.ontimeout <action> | kill | pause or kill when the lifetime ends. |
--public | off | Open ports without a token. |
--trusted | off | Run only on machines that Foundational Compute owns. |
-e, --env <KEY=VALUE> | none | Environment variable. Repeatable. |
-u, --user, -c, --cwd | sandbox user, home | Terminal 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]
| Option | Default | What it does |
|---|---|---|
-s, --state | running | running, paused or running,paused. |
-m, --metadata | none | Filter by metadata. |
-t, --template | none | Filter by template name or ID. |
--started-after <date> | none | ISO 8601 time, such as 2026-01-01T00:00:00Z. |
-o, --order | asc | By start time: asc or desc. |
-l, --limit | 1000 | 0 shows all. |
--watch, --interval <s> | off, 3 | Refresh every 1 to 3600 seconds until Ctrl-C. |
$ fdtn ls -s running,paused -m run=eval-1 --watchfdtn connect <sandboxID>
Opens a terminal in a sandbox. A paused sandbox resumes. Options: -u, -c, -e (as for create). Alias: cn.
$ fdtn connect @workerfdtn 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.
| Option | What it does |
|---|---|
-b, --background | Print the process ID and return at once. --json prints both IDs. |
-c, --cwd, -u, --user | Folder 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.pyfdtn pause, fdtn resume, fdtn kill
| Command | What 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
| Command | What 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
| Subcommand | What 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.
| Subcommand | What 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 -rfdtn collect [format]
Downloads one result folder from each sandbox in a group into --destination, with a manifest.json of SHA-256 checksums.
| Option | What 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-failed | Retry 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.
| Option | Default | What it does |
|---|---|---|
-p, --path | current folder | Build context folder. |
-d, --dockerfile | fdtn.Dockerfile, then Dockerfile | Dockerfile to build. |
--cpu-count | 2 | vCPUs per sandbox, up to 16. |
--memory-mb | 1024 | MiB per sandbox, an even number up to 32768. Rounded up to 512 MiB blocks. |
--min-free-disk-mb | service | Free disk after the build. At most 5120, 10240 or 20480, by memory size. |
-c, --cmd, --ready-cmd | none | Start command, and a command that exits 0 when ready. --cmd needs --ready-cmd. |
--no-cache | cache on | Build every step again. |
$ fdtn template create my-env --cpu-count 4 --memory-mb 4096 $ fdtn create my-env
Other template commands
| Command | What 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 init | Writes 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|remove | ls <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