Skip to main content
The Tinfoil CLI lets you manage deployments and individual containers, along with secrets, SSH keys, registry credentials, and custom domains. This page walks through the full container lifecycle from the terminal.

Prerequisites

Install the CLI:
Or download a binary from the releases page. A Docker image is published at 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 from the dashboard’s Admin tab by following Getting a Tinfoil admin key, then run:
Credentials are written to ~/.tinfoil/config.json with mode 0600. Two environment variables override the saved values for one-off invocations:
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

Pass -o json to get machine-readable output suitable for scripting:
Deployments can be referenced by repository name (owner/repo) or deployment UUID. Containers can be referenced by name or container UUID. If you have a debug-mode and a production-mode container with the same name, pass --debug-mode to disambiguate.

Publishing a config release

Before a tag can be deployed, the config repo must publish a measured release. The CLI uses the GitHub App connected to your Tinfoil organization, so you do not need a GitHub token or the gh CLI. Fetch the current config, then open a pull request with your local version:
Use --file - to read the config from stdin, and --body to add a pull request description. Repository commands also support -o json. Check whether the pull request has been merged:
After it is merged, inspect the suggested version and trigger the Tinfoil Release workflow:
The command prints the GitHub Actions URL. Follow it and wait for both release workflow phases to finish before deploying the tag. See Updating & lifecycle for the dashboard and direct GitHub alternatives.

Deploying a container

Once you have a measured release in your config repo (see quickstart for the GitHub setup), deploy it:
The command returns once the deployment is queued. Poll for readiness with tinfoil container get my-app.

Managing deployments

One deployment contains all container instances in your organization that use the same GitHub repository. Inspect its aggregate status and instance counts with:
Set whether new instances and deployment-wide updates use staging mode by default:
Update all eligible instances to one release:
To update only selected instances, repeat --instance with each container UUID:
Pass --staging true or --staging false to override the deployment’s default for one update. Only running or failed instances are eligible. An instance is skipped if it is in any other state or already has an update in progress. Results are reported per instance, and the command exits non-zero if any instance is skipped or fails.

Lifecycle

start and relaunch support --tag, --variable, --secret, --ssh-key, --debug, --staging, --custom-domain, and --host. Any override you pass replaces the stored value entirely. For example, --secret A --secret B sets the secrets list to [A, B], not [A, B, ...existing].
tinfoil container delete permanently removes the container, its secret bindings, and its DNS records. There is no undo.

Managing in-progress updates

Updates triggered by relaunch go through a blue-green window. While the new version is booting, you can inspect or cancel it:
Staging containers always wait for update accept; production containers promote automatically once the candidate is ready.

Secrets

Manage organization secrets with tinfoil secret:
Manage secrets available only to one repository with tinfoil repo secret:
The same secret name can have different values in different repositories. An organization secret and a repository secret cannot share a name within the same organization. --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: Choose one of the supported input forms:
Reference keys at deploy time with --ssh-key NAME on tinfoil container create (or relaunch / start).

Registry credentials

For private images, set credentials per registry. Tinfoil supports ghcr, gcr, and dockerhub:

Custom domains

Once a domain is verified, deploy a container against it with 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> (the standalone proxy CLI) but without copy-pasting either value:
The proxy binds to 127.0.0.1 by default. Pass --bind <ADDRESS> to use another interface:
Only bind beyond localhost on a trusted network because other hosts may then send requests through the proxy. In another terminal, send requests to http://localhost:3301 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).
Debug-mode containers do not pass attestation, so connect (and any other SecureClient flow) will refuse to use them. SSH into debug containers directly via ssh -p <port> [email protected] — the dashboard shows the exact command on the container’s card.

Resource metrics

Returns CPU, GPU, and memory utilization buckets as JSON. Useful for piping into jq or a chart tool.

Scripting tips

  • -o json is 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 running tinfoil login.
  • --verbose and --trace increase log verbosity for debugging connectivity issues.