Skip to main content
The sail CLI manages Sailboxes and apps from the terminal. It is a single native binary with no runtime dependencies. Run sail --help or sail <command> --help for the same information at the prompt, and see the Sailboxes guide for what you can do with it.

Install

Installs the latest sail into ~/.sail/bin. If that directory is not on your PATH, the installer adds it to your shell startup files and prints the line to run in the current shell.
To pin a version, set SAIL_CLI_VERSION for the installer, substituting the release you want for X.Y.Z:
SAIL_HOME relocates sail’s home directory, and SAIL_INSTALL_DIR installs a copy at an exact path for provisioning scripts.

Update

Downloads the latest release and replaces the binary you ran. Sail warns when your CLI version is nearing the end of its support window, and rejects one past it with an update error before any operation runs. Upgrading a Sailbox is a different operation: sail box upgrade <sailbox>.

Interactive shell

For interactive use, sail shell is usually the most convenient option. It opens a REPL on your machine that accepts every command below without the leading sail (so box list, box create ...), and adds features the one-shot commands lack: line editing and history, a picker menu when you omit a Sailbox id, and confirmation prompts.
The individual sail <command> subcommands take their arguments up front, which suits scripts and agents (add --json for machine-readable output). Mind the naming: sail shell is a shell for managing Sailboxes from your machine. It is not a shell inside a box. To open a shell inside a running Sailbox, use sail box shell (below).

Claude Code

Run sail claude --completion-window balanced for a Claude Code session using Sail. The flag accepts asap or balanced; omitting it uses Sail’s default window. sail claude on saves routing in Claude Code settings, sail claude off removes it, and sail claude env prints the environment settings. See Claude Code for window selection and replacing a saved Flex setting.

Authentication

Every command reads SAIL_API_KEY, falling back to the credential stored by sail auth login. Add --json to any command for machine-readable output. See Configuration. If the stored key is still valid and tied to your own account, sail auth login reports that login and returns without opening the browser. To log in as a different organization or user, run sail auth logout first. A key passed with --api-key or piped to stdin always replaces the stored key.

Apps

Sailbox lifecycle

Checkpoints

sail checkpoint list shows the checkpoints a Sailbox can still be started from. sail checkpoint delete makes a checkpoint unusable for new Sailboxes; Sailboxes already started from it keep running.

sail box create

sail box list

sail box top

Run commands and connect

sail box exec

Run a command in a Sailbox, streaming its output.

sail box run

Create an ephemeral Sailbox, run a command, then terminate it. A shortcut for create + exec + terminate. For workflows that reuse a Sailbox, use those directly.
Takes the same create flags (--arch, sizing, --port) plus --name (default run-<hex>), --cwd, --timeout, --env, --user, --auto-sleep (as on create, for use with --keep), the egress policy flags (--no-egress, --no-network, --egress-allow-only, --egress-block-host, --egress-policy, and --egress-policy-file, as on create), and --keep (leave the Sailbox running instead of terminating it). An exposed port is reachable while the command runs, and after it ends only with --keep.

sail box shell

Open an interactive shell inside a running Sailbox. This is the simplest and preferred way in: it runs a PTY over exec, so it does not open a port and does not count against your org’s raw-TCP endpoint limit. (Not to be confused with sail shell, the local REPL for managing boxes.) The session runs as the image’s USER, or as root when the image sets none: the same identity sail box exec uses. --user opens it as someone else (a name or numeric uid, optionally with a group after a colon, like alice, 1000, or alice:staff). --user 0:0 forces root. --env K=V (or -e, repeatable) adds environment variables to the session, as on sail box exec. While the shell is open, the session forwards to your machine:
  • Browser opens. When a program in the box opens a browser, the page opens in your local browser instead. This covers logins like claude login, codex login, and gh auth login. A login that redirects to a localhost callback completes end to end.
  • Localhost servers. A server the box starts on localhost (say a dev server on port 3000) becomes reachable at http://localhost:3000 on your machine. The same port is used on your machine, so if it is already in use locally that server is not forwarded.
  • Paste and drag-and-drop. Files dragged onto the terminal upload to /tmp/sail-drops in the box and paste as their guest paths. Press Ctrl+V to forward your clipboard. On devbox images an image or text is placed on the box’s clipboard, so pasting a screenshot into claude or codex works as it does locally, and text copied inside the box is copied back to yours. On other images a Ctrl+V image uploads as a file and pastes its path, while text uses your terminal’s own paste. Large uploads show a progress line. Press Esc to cancel one.
Pass --no-forward to turn all of it off, for example for an untrusted or automated session. sail box exec --tty forwards the same way and takes the same flag. A dropped connection does not end the session. The shell prints a notice, keeps reconnecting, and redraws the screen once the Sailbox is reachable again. If the Sailbox goes to sleep, the next key you press wakes it and resumes the same session. If it is paused, the shell says so when you press a key and sends your keys once the Sailbox is resumed. To leave while disconnected or paused, press Ctrl-D. The session ends if the Sailbox is terminated. sail box exec --tty reconnects the same way.

sail box cp

Copy a file or directory to or from a Sailbox. <id>:<path> denotes the remote side. Uploaded files belong to the image’s USER, or to root when the image sets none: the same identity sail box exec runs commands as. --user names a different owner for the file and any directories the upload creates (a name or numeric uid, optionally with a group after a colon, like alice, 1000, or alice:staff). --user 0:0 forces root. --user applies to uploads only. Downloaded files are owned by whoever runs the CLI. Pass --recursive (-r) to copy a directory: the source directory’s contents are copied into the destination directory, which is created if needed. Copying a directory requires the flag. With --recursive, --user sets the owner of the copied entries, the destination directory, and any missing parents the copy creates.

Networking

--tcp exposes raw TCP instead of HTTP. --allowlist restricts sources to an address or a range (e.g. 203.0.113.0/24), or, for HTTP listeners, a Sail app name. Re-exposing a port replaces its whole list. Omitting --allowlist reopens the port. See Access Control for the full model.

Secrets and egress policies

Store a secret for your organization, save an egress policy whose rules use it, then give that policy to a Sailbox. See Egress policy for the policy document and Credential injection for a complete example.
set replaces the Sailbox’s whole policy and clear removes it. A change applies to connections opened after it. --no-network is refused while the Sailbox exposes ports or SSH.

Cron jobs

sail box cron runs a shell command in a Sailbox on a schedule, waking the Sailbox when a run is due.
See Run a command on a schedule for the schedule format and how runs behave.

Custom domains

sail box domain serves a Sailbox HTTP listener on a hostname you own, with TLS certificates obtained and renewed for you.
attach requires --port naming an exposed HTTP listener, and checks that your DNS record points at your target first. See Custom domains for the DNS setup, apex-domain options, and certificate behavior.

SSH

sail box ssh sets up SSH access so you can reach a box as ssh <name>.sail. For a quick interactive shell, prefer sail box shell: it does not need an open port. Use SSH when you need a real SSH endpoint rather than a PTY over exec, such as for scp/rsync, an editor’s remote mode, or a devbox you work in day to day. Enabling it exposes port 22 as a TCP ingress port, which counts against your org’s raw-TCP endpoint limit.
  • enable: turn on SSH for a box (expose port 22, install your org’s CA, start sshd), certify your key on this machine, and add the <name>.sail shortcut. --allowlist <addr> restricts the sources allowed to reach port 22 to an address or a range (repeatable). Passing --allowlist replaces the port’s current restriction. Omitting it on a first enable leaves port 22 open to any source. On a re-enable it keeps the existing restriction.
  • alias: add ssh <name>.sail shortcuts for boxes already SSH-enabled elsewhere (e.g. from the SDK), without waking them.
  • disable: stop SSH on a box and drop its local shortcut.
Only the public half of your key is certified. The private key is referenced in your SSH config, never read.

Devboxes

sail box devbox creates and manages devboxes: Sailboxes set up for development, with SSH, coding-agent CLIs, and your local Python version. See Devboxes for the full guide, including ~/.sail/devbox.toml.

sail box devbox up

up creates the devbox with the given name (default devbox), or sets it up again if you already set it up from this machine. For a shared devbox, include --shared each time. Pass a Sailbox id to set up an existing Sailbox instead. It keeps its own name, app, architecture, and image. The built-in agents are claude, codex, cursor-agent, and opencode. --app, --arch, and --shared apply only to a devbox given by name. list shows the devboxes you set up from this machine with your current API key. --all also shows deleted devboxes, and ones Sail can’t find in your current organization. show reports one devbox’s state and, while it runs, its agents. down permanently deletes a devbox and its <name>.sail shortcut after asking you to confirm, which --yes skips.

Configuration

Manage ~/.sail/config.toml.