sail CLI reference
The CLI ships with @sprintsail/cli as the binary sail. Run it via npx sail <command> or add an alias.
Global behavior
- The current working directory must contain
sail.config.ts(or.js/.mjs) andinfra.ts(or.js/.mjs). - All commands accept
--cwd <dir>to point at a different project root. - Destructive commands (
deploy,destroy,migrate) default to dry run. Add--yes(or-y) to apply. - Target is
provider:locator(e.g.aws:us-east-1,sprintsail-runtime:my-cluster). Defaults tosail.config.ts'sdefaultTarget.
sail deploy
Provision + deploy the current project to the chosen target. Idempotent.
sail deploy [--target <target>] [--yes] [--cwd <dir>]
| Flag | Default | What it does |
|---|---|---|
--target <provider:locator> | defaultTarget from config | Where to deploy. |
--yes, -y | dry-run | Apply changes. Without this, prints the plan and exits. |
--cwd <dir> | cwd | Project root. |
Walks project.all() in declaration order. For each primitive:
- Asks the provider to provision (idempotent — adopts existing resources).
- Threads the new
ProvisionResultinto downstream primitives' bindings.
After all primitives provision, if the provider implements deploy() (e.g. AWS, for Function code-push), runs that phase.
Saves state under .sail/state.<provider>.<locator>.json.
sail destroy
Tear down a previously-deployed project.
sail destroy [--target <target>] [--yes] [--cwd <dir>]
Walks primitives in reverse order and calls each provider's destroy(). Removes the state file on success. Safe-destroy guards apply per primitive (e.g. non-empty buckets refuse to delete; see Bucket).
sail migrate
Move a deployed app between two targets.
sail migrate --from <source> --to <destination> [--yes] [--cwd <dir>]
| Flag | Required | What it does |
|---|---|---|
--from <target> | yes | Source target. Must have an existing state file. |
--to <target> | yes | Destination target. State will be created if missing. |
--yes, -y | no | Apply. Without this, prints the plan only. |
After migration, generates .sail/cutover-<timestamp>.sh — a checklist of every URL/endpoint that changed.
sail target
Inspect available targets and capabilities.
sail target list
sail target capabilities <target-or-provider>
list shows every provider currently importable, plus their default locator (if any).
capabilities aws (or sprintsail-runtime) prints the per-primitive support matrix for that provider — categorised, with the underlying mapping and any notes. The output is the source of truth for the Capability Matrix.
sail logs
Tail logs from a deployed primitive.
sail logs <primitive-name> [--target <target>] [--follow] [--since <duration>]
Currently implemented for AWS (CloudWatch Logs). Runtime support follows in v1.1.
sail state
Inspect / manipulate state directly. Power-user.
sail state show [--target <target>]
sail state import <urn> <id> [--target <target>]
sail state rm <urn> [--target <target>]
show pretty-prints the state file. import adopts an external resource into state without re-running provision. rm removes a primitive from state without destroying it (use this to break adoption-on-re-deploy).
sail dev
Local emulator for fast iteration. Planned for v1.1 — not in v1.0. The contract: spin up Postgres, MinIO, RabbitMQ in Docker; install a mock runtime adapter pointed at them; live-reload the handler.
sail init
Scaffold a new project.
sail init [project-name]
Writes sail.config.ts, infra.ts, src/index.ts, package.json. Picks aws:us-east-1 as the default target unless --target is given.
sail config
Inspect the resolved config and project.
sail config show
Prints the loaded sail.config.ts, the parsed default target, the discovered primitives, and the state-backend resolution.
Exit codes
| Code | Meaning |
|---|---|
| 0 | Success (or dry run, no changes). |
| 1 | Generic failure (provider error, build failure, network). |
| 2 | Bad CLI usage (missing required flag, bad target string). |
| 3 | State conflict (a primitive in state doesn't match what the provider sees). |