The Tinfoil CLI ships with the same container management surface as the dashboard. Anything you can do in the Tinfoil Containers UI — create, start/stop, update, manage secrets, SSH keys, registry credentials, and custom domains — has a CLI equivalent. This page walks through the full container lifecycle from the terminal.Documentation Index
Fetch the complete documentation index at: https://docs.tinfoil.sh/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Install the CLI:ghcr.io/tinfoilsh/tinfoil-cli.
You also need a Tinfoil organization with Containers enabled, the same prerequisite as the quickstart.
Authenticating
Container management endpoints accept an admin API key scoped to a single organization. Create one in the Tinfoil Dashboard under Settings → API Keys → Admin keys, then run:~/.tinfoil/config.json with mode 0600. Two environment variables override the saved values for one-off invocations:
| Variable | Purpose |
|---|---|
TINFOIL_API_KEY | Admin key (admin_...) |
TINFOIL_CONTROLPLANE_URL | Controlplane URL (defaults to https://api.tinfoil.sh) |
Admin keys carry the organization ID, so the CLI never asks for an org. To act on a different org, log out and log in with that org’s admin key.
Inspecting your organization
-o json to get machine-readable output suitable for scripting:
--debug-mode to disambiguate.
Deploying a container
Once you have a measured release in your config repo (see quickstart for the GitHub setup), deploy it:| Flag | What it does |
|---|---|
--repo | GitHub owner/repo containing tinfoil-config.yml (required) |
--tag | Release tag to deploy (required) |
--variable KEY=VALUE | Environment variable; repeatable |
--secret NAME | Org secret to mount; repeatable |
--ssh-key NAME | Org SSH key (debug containers only); repeatable |
--debug | Deploy in debug mode |
--staging | Deploy in staging mode |
--custom-domain | Use a verified custom domain |
--host | Pin to a specific host (see tinfoil container hosts) |
--replace ID | Atomically replace an existing container (frees its GPUs first) |
tinfoil container get my-app.
Lifecycle
relaunch and start accept the same overrides as create. Any flag you pass replaces the stored value entirely — for example, --secret A followed by --secret B sets the container’s secrets list to [A, B], not [A, B, ...existing].
Managing in-progress updates
Updates triggered byrelaunch, start, or auto-update on tag push go through a blue-green window. While the new version is booting, you can inspect or cancel it:
update accept; production containers promote automatically once the candidate is ready.
Auto-update
For GitHub-connected containers, you can have Tinfoil deploy every new release tag automatically:Secrets
--value-file accepts - for stdin, which is the recommended way to set secrets — it avoids leaking the value via shell history or process listings. See secrets and env vars for the underlying model.
SSH keys
Debug-mode containers authorize SSH access using public keys registered at the org level:--ssh-key NAME on tinfoil container create (or relaunch / start).
Registry credentials
For private images, set credentials per registry. Tinfoil supportsghcr, gcr, and dockerhub:
Custom domains
tinfoil container create ... --custom-domain api.example.com. See custom domains for the DNS record details and troubleshooting.
Connecting to a deployed container
tinfoil container connect <name> resolves a container’s enclave domain and source repo, then runs a verified local proxy — equivalent to tinfoil proxy -e <domain> -r <repo> but without copy-pasting either value:
http://localhost:8080 exactly as you would to your container’s domain. The proxy verifies attestation on startup and pins the TLS certificate for subsequent requests. See connecting for the full client story (SDKs, raw tinfoil http).
Resource metrics
jq or a chart tool.
Scripting tips
-o jsonis supported on every list/get command.- Exit codes are non-zero on failure, with the controlplane error message printed to stderr.
- All commands respect
TINFOIL_API_KEY/TINFOIL_CONTROLPLANE_URL, so the CLI is safe to use from CI — store the admin key as a secret and pass it through the environment instead of runningtinfoil login. --verboseand--traceincrease log verbosity for debugging connectivity issues.

