CLI and automation
Temps exposes two operator command lines. The Rust temps command runs and repairs a self-hosted installation. The application CLI manages projects and platform resources through the HTTP API. Both support guided use and repeatable jobs through explicit targets, structured output, protected secrets, and status read-back. The Rust CLI also provides a one-shot CI build runner, unattended setup, and guarded recovery, while the application API supports common source-map upload tools and telemetry clients. This page complements developer workflows.
Command-line entrypoints
Rust platform CLI
The Rust CLI is the server operator's entrypoint. It starts the control plane and proxy, prepares the database, manages domains and deployments, joins worker nodes, runs diagnostics, performs backup and upgrade work, and can run one authenticated CI build.
Its command groups follow the platform life cycle:
- Run the platform:
serveandproxy. - Prepare and change an installation:
setup,migrate,upgrade, anddoctor. - Deliver applications:
build,deploy,domain, andservices. - Operate nodes and networks:
join,agent,node, andnetwork. - Manage isolated work:
sandbox,firecracker,microsandbox, andedge. - Move or repair data:
backup,backfill, and schema-upgrade safeguards. - Run trusted build work:
runnerclaims and completes one CI build.
The Rust command is also a library entrypoint. An embedding binary can reuse the same parser and dispatch while adding plugins or a replacement console bundle. Sensitive values such as database URLs, pairing secrets, OTLP credentials, and join tokens are kept out of process argument listings when the platform supports argument scrubbing.
References: crates/…/Cargo.toml• L13-22 crates/…/lib.rs• L25-106 crates/…/lib.rs• L300-368 crates/…/mod.rs• L4-75
Server roles and profiles
temps serve separates listener ownership from workload ownership. A role decides whether one process runs the console and proxy together or whether a console process works beside a separate temps proxy. A profile decides whether that process runs local containers, builds, managed services, sandboxes, and local backups.
| Choice | Purpose |
|---|---|
--role=all | Run the console and proxy in one control-plane process. |
--role=console | Run only the console and forward traffic through a sibling proxy. |
--profile=full | Run local workloads on this host. |
--profile=control-plane | Run control-plane features while workers run applications. |
Split console mode needs stable console and proxy addresses. The process can also separate admin routes from public callback and ingest routes. The running feature set is reported to clients, so a caller can distinguish an unavailable feature from a failed endpoint. Optional Docker-backed features do not prevent core HTTP serving when Docker is unavailable. The proxy owns the public traffic path, including DNS bootstrap and on-demand certificate work when enabled.
The server keeps startup and shutdown as operator-visible boundaries. It waits for a briefly unavailable database, applies the configured migration safety policy, and reports startup failures. On Ctrl+C it cancels running deployments, cleans local resources, and flushes trace data within a bounded cleanup period.
References: crates/…/mod.rs• L129-240 crates/…/mod.rs• L290-387 crates/…/mod.rs• L409-549 crates/…/proxy.rs• L161-180 crates/…/shutdown.rs• L27-165
Worker enrollment and mesh operation
Worker use has two stages. temps join enrolls a machine and saves the identity needed by the worker. temps agent then runs the worker service, accepts control-plane work, builds and runs containers, and reports node state.
An enrolled agent can run under systemd so it survives logout and reboot. The service uses the joined agent data and keeps its credentials in the owner-only data directory. Its dry-run mode lets an operator inspect the unit before installation.
Enrollment supports direct private networking, pairing, or an operator-run relay for WireGuard key exchange. The join flow can pin the cluster certificate authority and provisions trust and mTLS material when required. It stores the resulting identity with owner-only access. The agent rejects invalid or all-interface addresses and binds published workload ports to the registered private address.
The application CLI adds node capability, pairing, mesh diagnosis, and SSH enrollment views. Draining moves normal application work away from a node. Sandbox eviction is still required before node removal can finish.
References: crates/…/join.rs• L4-16 crates/…/agent.rs• L19-113 crates/…/agent_service.rs• L4-25 apps/…/index.ts• L304-405 crates/…/mesh.rs• L33-70
Setup, diagnostics, and upgrades
Setup creates a usable installation. It can run with text or JSON output and can take its database, admin, provider, Git, DNS, certificate, and external URL inputs from flags or environment values. --auto supplies zero-prompt defaults for unattended installation. In this mode it can generate the administrator credentials and use an sslip.io wildcard based on the detected server address when no domain setup is supplied. Non-interactive setup still needs the values required by the selected features. TLS can remain under Temps control or be declared external when a reverse proxy or tunnel owns it.
Setup stores the ACME contact when one is supplied. Certificate issuance does not use an implicit contact, so an installer that enables TLS must provide a real email. External TLS requires the public wildcard domain and external URL, while a supplied certificate requires its matching private key. Setup reports its result as structured JSON when requested.
temps doctor is read-only and checks the data directory, secrets, Docker endpoint, database, migrations, application settings, connectivity, worker networking, and mesh. temps migrate is the explicit production upgrade path. It shows a plan, supports dry runs and newline-delimited JSON progress, can take a pre-migration backup, and applies schema work before restart. An interrupted migration cancels the active database work before the command reports that it is safe to retry. temps serve keeps automatic migration for simple installs.
temps upgrade checks or installs a signed release. Stable is the default. Beta and nightly channels need an explicit choice, and a pinned version overrides the channel. The command verifies the checksum before replacing the binary and does not restart services. Split topology therefore needs a manual console restart while the proxy remains running. The server's API self-update path records a pending attempt and reports its result after the next boot; without a supervisor it installs the binary but keeps the old process running.
References: crates/…/setup.rs• L64-259 crates/…/setup.rs• L1644-1720 crates/…/setup.rs• L3140-3228 crates/…/doctor.rs• L25-45 crates/…/migrate.rs• L4-36 crates/…/migrate.rs• L322-480 crates/…/upgrade.rs• L31-61 crates/…/upgrade.rs• L125-159 crates/…/upgrade.rs• L251-463 crates/…/self_update.rs• L4-28
CI build runner
The Rust runner command is a short-lived worker for one CI build. It obtains a one-use OIDC identity from the CI system or a supplied token file, claims the build from the control plane, receives the build work, and returns a verified image result.
The runner keeps the build scoped to a lease. It streams build logs, downloads and safely extracts the source context, builds with local Docker, checks the requested platform, pushes the image, and reports its digest. A lease loss, timeout, cancellation, or build error reports failure and does not leave the one-build token as a reusable credential.
The runner and control plane use a small lifecycle:
sequenceDiagram
participant C as CI runner
participant P as Control plane
participant D as Docker and registry
C->>P: Claim build with one-use OIDC identity
P-->>C: Work, lease token, and build limits
C->>P: Request build context
C->>D: Build and push image
C->>P: Stream logs and renew lease
C->>P: Submit digest and image result
P-->>C: Accept verified result and revoke token
References: crates/…/runner.rs• L4-14 crates/…/runner.rs• L17-151 crates/…/runner.rs• L167-330 apps/…/openapi.json• L93459-93738 apps/…/types.gen.ts• L22782-22810
Cloud and recovery operations
The application CLI manages both the operator's Cloud account and the Cloud link for one self-hosted instance. Console access through Cloud is an explicit switch. Cloud telemetry reports requested and effective delivery state so queued spans, retries, losses, gaps, and fallback are visible.
Rust backfill commands move historical observability data to ClickHouse or historical spans to Cloud. They are scoped, dry-run-first, batched, resumable, and safe to repeat. ClickHouse backfill covers events plus proxy logs, traces, metrics, and cross-project trace references. Cloud backfill records shared progress and audit state and must not run beside temps serve because both use the same link state.
Restore commands read service capabilities before offering in-place, clone, or point-in-time recovery. Whole-install backup restore selects a recovery set from S3, authenticates its manifest, checks completeness and artifact digests, and validates the target before restoring PostgreSQL and external services. It supports temporary S3 session credentials. Stateless recovery needs the original external secrets, and the command checks the restored installation mode before writing local recovery secrets. Database URLs, encryption keys, and S3 credentials come from hidden environment or option inputs rather than visible process arguments.
References: crates/…/backfill.rs• L4-31 crates/…/backfill.rs• L55-181 crates/…/ch_backfill_domains.rs• L4-31 crates/…/cloud_telemetry_backfill.rs• L4-31 crates/…/backup.rs• L86-188 crates/…/backup.rs• L378-543 crates/…/backup.rs• L674-749 crates/…/backup.rs• L1076-1233
Application CLI capabilities
Application command model
The application CLI is the workstation interface for projects and platform resources. It authenticates to a Temps server, registers the command tree, maps commands to the HTTP API, and supports human or machine output. --target-context validates a named server before a command runs. --json suppresses terminal decoration for machine consumers.
The command tree covers project delivery, environments, domains, services, nodes, backups, sandboxes, status pages, templates, AI tools, observability, source-map workflows, and platform settings. Project secrets are kept distinct from environment variables: the former are mounted into deployed workloads as protected files and the latter provide environment-scoped values. Feature maturity notices are informational and come from the target server. They are best-effort and do not stop a command when an older server does not provide them.
The checked-in CLI reference is generated in Markdown and MDX from the live command tree. It is the detailed option guide, while this page describes the system-level contracts.
References: apps/…/CLI.md• L1-37 apps/…/CLI.md• L38-65 apps/…/CLI.mdx• L1-39 apps/…/cli.ts• L4-12 apps/…/cli.ts• L114-177 apps/…/cli.ts• L179-268 apps/…/feature-maturity.ts• L12-33 apps/…/feature-maturity.ts• L88-126
Authentication and identity
Login supports two operator paths. Interactive login uses browser device authorization, so passwords stay in the web login. Headless login accepts a pre-minted API key and validates it against the named server before saving the key and context. whoami reads the current user and active context, and its JSON form exposes identity and context data for scripts.
The login flow treats the target URL as part of the credential check. A bad URL, a non-Temps response, and a rejected key produce different errors, so automation does not mistake a console page or proxy response for an invalid credential. Debug request details go to standard error.
References: apps/…/login.ts• L118-165 apps/…/login.ts• L495-603 apps/…/whoami.ts• L21-87 apps/…/api-client.ts• L38-86
Project, group, and deployment workflows
A service is one deployable app. A project group is a set of services that ship together and share a repository, environment values, and path routes. This keeps projects commands separate from services commands for databases, caches, and storage.
Project creation supports Git-backed services, manual Docker or static deployment, and external hosting where the app runs elsewhere and Temps receives telemetry only. Project secrets are delivered to deployed workloads as protected files, while environment variables provide environment-scoped configuration. Deployment selects the source type, environment, branch, and optional commit. Public repositories can deploy without a saved provider connection; private repositories need one.
Project groups support monorepo repository settings, app import, shared variables, and environment route mappings. The CLI reports partial service updates rather than hiding them. Its normal flow is:
- Authenticate to the intended server.
- Create or link the service or project group.
- Choose Git, static, image, or external hosting.
- Deploy with
temps upor a specific deploy command. - Read the deployment, environment, and group state.
- Poll when the remote action must be proven complete.
References: apps/…/CLI.md• L36-60 apps/…/CLI.md• L61-121 apps/…/index.ts• L16-61 apps/…/list.ts• L18-47 apps/…/create.ts• L121-164 apps/…/deploy.ts• L89-112 apps/…/deploy.ts• L114-205 apps/…/index.ts• L4-10 apps/…/index.ts• L345-450
Templates and server-side instantiations
Templates package a repeatable application or starter with its services, data needs, shared values, and routes. temps templates validate checks a native catalog offline. Creating a template starts one server-side instantiation, which is a tracked multi-step creation or import.
The CLI can create or link databases, assign service names and variables, fork starter code, use an idempotency key, wait for completion, or return immediately. A failed instantiation can retry from its failed step. Scripts must use the tracked status rather than infer completion from the start response.
References: apps/…/index.ts• L15-73 apps/…/create.ts• L53-179 apps/…/index.ts• L32-124 apps/…/index.ts• L153-185
Managed service workflows
The services commands manage database, cache, object storage, and other managed service lifecycles. The server supplies a parameter schema for each service type. Interactive use turns that schema into prompts, while automation uses --set key=value and dedicated S3 backend or bucket options. The CLI validates parameter syntax and type values before it sends the request.
Service workflows also cover project links, environment variables, logs, metrics, alerts, upgrades, restores, and data imports. Restore and import actions report server state for later inspection. A service operation can need an explicit confirmation because it may replace data or restart a database.
References: apps/…/index.ts• L53-189 apps/…/index.ts• L262-276 apps/…/index.test.ts• L20-88
AI provider workflows
The ai commands report whether a project can use AI features and guide provider sign-in. Readiness shows unmet prerequisites before a chat request reaches a server-side gate.
Provider login prints a verification link or device code, accepts a code without echoing it, polls the sign-in state, resumes an already-running sign-in, and cancels on interruption. With --json, progress goes to standard error and the final session goes to standard output.
References: apps/…/index.ts• L35-114 apps/…/index.ts• L164-224 apps/…/provider-login.ts• L13-31 apps/…/provider-login.ts• L137-224
Backup schedule workflows
The application CLI manages recurring backup schedules and S3-compatible sources. Operators can create full or incremental schedules, inspect runs, trigger service backups, preview retention cleanup, and delete expired terminal backups after confirmation.
Automation supplies required schedule values with --yes. Cleanup first returns a candidate report, then deletes the expected batch and reports deleted and failed items. A service backup that may restart PostgreSQL requires explicit consent or a clear interactive answer.
References: apps/…/index.ts• L73-89 apps/…/index.ts• L141-168 apps/…/index.ts• L170-343 apps/…/index.ts• L951-995 apps/…/index.ts• L1115-1200
Status-page and domain workflows
Status-page commands turn selected monitors into a public page that can stay in draft until an operator publishes it. Each monitor needs a public display name. A custom hostname remains inactive until ownership and certificate checks complete.
The public boundary is explicit. Draft pages return no public content, an unconfigured public address is reported as such, and domain status explains the next DNS or renewal action. DNS-01 certificates need an operator-led renewal step.
References: apps/…/index.ts• L65-124 apps/…/index.ts• L136-169 apps/…/index.ts• L258-404 apps/…/index.test.ts• L14-110 apps/…/index.ts• L127-239 crates/…/domain.rs• L26-63
Network access workflows
The ip-access commands manage instance-wide rules and project or environment policies. A project policy can be disabled, allow only listed CIDR ranges, or deny listed ranges. An environment without its own policy follows the project policy.
The CLI offers show, set, clear, and test operations in JSON or human output. It rejects an empty allow list before sending it. Applying a list that would block the caller needs explicit lockout acknowledgement, and changes reach the proxy after a short delay.
References: apps/…/index.ts• L70-125 apps/…/project.ts• L105-139 apps/…/project.ts• L175-222
Sandbox terminal workflows
Sandbox commands provide isolated environments for commands and source code. temps sandbox exec is suited to scripted commands. temps sandbox shell is an interactive terminal that can reattach to a named tab after a network drop or terminal close.
Sandboxes can be placed on the control plane or a worker, or left for server placement. Node placement commands can allow or deny nodes and evict sandboxes before node removal. The CLI reports when a worker does not support an operation and gives the control-plane alternative. The shell keeps the remote process alive when the operator detaches, but stopping or expiring the sandbox removes the terminal state. The access token stays in the authorization header.
References: apps/…/index.ts• L40-125 apps/…/index.ts• L174-219 apps/…/placement-commands.test.ts• L122-193 apps/…/placement-commands.test.ts• L284-368 apps/…/shell.ts• L4-23 apps/…/shell.ts• L213-247 apps/…/shell.ts• L385-447 crates/…/firecracker.rs• L4-19 crates/…/microsandbox.rs• L4-23
DNS, delivery, and external services
The CLI manages DNS providers, owned records, traffic delivery profiles, external databases, caches, and storage. DNS ownership checks and explicit import prevent changes to unmanaged records. Delivery uses a plan-then-apply flow. Provider secrets can come from stdin, and non-interactive mode requires complete input.
External service commands expose parameter schemas, lifecycle state, connection data, logs, metrics, alerts, upgrades, restores, and data imports. Restore commands use reported capabilities. Data imports check availability, protect replacement with exact confirmation, and return a run state for later polling.
References: apps/…/index.ts• L275-358 apps/…/index.ts• L122-176 apps/…/index.ts• L935-995 apps/…/types.gen.ts• L188-240
Source-map and telemetry interfaces
The HTTP API exposes compatibility routes for tools such as sentry-cli. They let external build automation create or finalize a release-shaped record and upload source maps without requiring the tool to know Temps' internal release model. Temps stores the source maps independently of the compatibility release actions. It also exposes an artifact upload path for build tools that need chunked source artifact transfer.
Browser telemetry can use the Sentry envelope route. A supplied DSN can identify the project for tunneled traffic, while same-origin traffic can use the host route. The public route applies shape, credential, origin, and rate checks before expensive body processing. This supports applications that Temps does not deploy without making the public ingest route a general-purpose control-plane endpoint.
References: apps/…/sdk.gen.ts• L42-107 apps/…/sdk.gen.ts• L121-181 apps/…/openapi.json• L51572-51660 apps/…/openapi.json• L65906-66156 apps/…/openapi.json• L66274-66328 apps/…/types.gen.ts• L23888-23900 apps/…/types.gen.ts• L30698-31002
Configuration and target selection
Server contexts
A context is a named server URL and credential set. Contexts let one workstation use several Temps servers. --target-context selects one invocation and validates the name before the command runs.
| Value | Resolution order |
|---|---|
| Server URL | TEMPS_API_URL, selected context, legacy saved configuration |
| Credential | TEMPS_TOKEN, TEMPS_API_TOKEN, TEMPS_API_KEY, selected context, legacy saved secret |
| Context | --target-context, TEMPS_CONTEXT, saved active context |
Cloud credentials are stored separately from self-hosted credentials. Browser device login supports interactive use. API keys and environment values support headless use. A missing TEMPS_CONTEXT target does not fall back to another server. Login stores the normalized /api URL only after the server validates the credential.
References: apps/…/cli.ts• L114-177 apps/…/contexts.ts• L4-31 apps/…/store.ts• L11-44 apps/…/login.ts• L510-603
Project and environment targets
The CLI uses a project and environment to define where a project command acts. A project link is stored in .temps/config.json and is found from the current directory upward. A command flag can override that link. An environment flag or selection then narrows the action to a deployment target.
Automation should pass project, environment, and context values explicitly. Environment synchronization keeps write-only secrets out of pulled .env files.
References: apps/…/group.ts• L25-61 apps/…/index.ts• L27-61 apps/…/setup-wizard.ts• L382-398 apps/…/index.ts• L262-276
Installation data directories
The Rust CLI uses a shared data directory for installation keys, worker identity, runtime state, and recovery data. It defaults to ~/.temps and can be set with TEMPS_DATA_DIR or a command option.
Firecracker and microsandbox setup resolve the directory from an explicit option first, then from the running temps serve process, then from the known install layout. This prevents a shell command from provisioning a directory that the server never reads. Both setup commands support a read-only readiness check, and a successful first setup needs a server restart before the backend is registered.
References: crates/…/data_dir_discovery.rs• L4-12 crates/…/data_dir_discovery.rs• L47-119 crates/…/firecracker.rs• L73-100 crates/…/microsandbox.rs• L59-86
Docker endpoint and first-boot inputs
The Rust CLI uses DOCKER_HOST when set. Otherwise it can adopt the active local Docker context when that context points to an existing Unix socket. Remote Docker contexts are not adopted.
The server supports one-shot Cloud enrollment and first-boot OIDC inputs for unattended provisioning. These inputs become bootstrap actions. The server does not re-read them as normal settings. Enrollment is best effort and leaves the server able to start when Cloud is unavailable; the OIDC bootstrap is applied before console access is exposed.
References: crates/…/doctor.rs• L19-23 crates/…/console.rs• L29-35 crates/…/console.rs• L848-1025 crates/…/console.rs• L1117-1229
Automation interfaces
Machine-readable output
Commands that support --json return a structured result on standard output. Spinners, colors, tables, prompts, and warnings do not belong in that stream. Warnings and progress go to standard error. Rust migration adds newline-delimited JSON progress for parent processes. Rust setup also offers a JSON result for scripted first-boot work.
Automation should use the exit status as the first success signal and JSON as the result. An empty list, partial result, cursor, omitted capability, or still-running status is meaningful state. The API client also rejects an HTML page or an empty untyped GET that returns with success status, so a wrong server address does not look like an empty result.
References: apps/…/cli.ts• L168-173 apps/…/prompts.ts• L23-29 apps/…/prompts.ts• L85-104 apps/…/api-client.ts• L99-156 apps/…/api-client-response.test.ts• L57-149 apps/…/provider-login.ts• L80-90 crates/…/setup.rs• L64-72 crates/…/setup.rs• L3140-3228 crates/…/migrate.rs• L91-108 crates/…/migrate.rs• L395-480
Non-interactive changes
State-changing commands use --yes, --force, or an explicit no-wait choice where needed. These flags remove prompts. They do not choose a server, project, environment, provider, or destructive target for the caller.
Credential-bearing commands prefer stdin, files, or hidden prompts for secrets. Commands reject conflicting inputs, incomplete provider values, missing SSH host-key confirmation, and missing destructive target confirmation. Read-before-write behavior protects settings whose server contract replaces a whole document. A confirmation prompt fails when standard input is not a terminal instead of silently doing nothing.
References: apps/…/prompts.ts• L70-104 apps/…/project.ts• L175-222 apps/…/index.ts• L300-327 apps/…/create.ts• L82-179 apps/…/index.ts• L385-453 crates/…/setup.rs• L185-259 crates/…/backup.rs• L144-245
Asynchronous operations
The CLI is an interface to server state. Deployments, restores, template creation, node enrollment, certificate actions, snapshots, backups, telemetry transfers, and CI builds may continue after the initial request returns.
Use the command's status or run identifier as the read-back contract:
flowchart LR
A[Select context] --> B[Set project and environment]
B --> C[Submit change]
C --> D[Read JSON status]
D --> E{Terminal desired state?}
E -->|No| D
E -->|Yes| F[Report result]
The interactive watcher is a progress view. A status or show command is the stable script interface. A wait timeout means that the server may still be working.
References: apps/…/deploy.ts• L396-486 apps/…/index.ts• L91-124 apps/…/index.ts• L305-328 apps/…/create.ts• L181-204 crates/…/runner.rs• L83-151
API contract generation
The application CLI shares an OpenAPI contract with the server. The committed spec is the reviewable snapshot. Generated operations and TypeScript types give commands a shared request and response shape.
An API change crosses the server contract, openapi.json, generated SDK operations and types, and the command or external tool that presents the result. The generated surface includes CI runner operations, chunked artifact upload, source-map compatibility routes, source-map storage, and telemetry routes. Canonical-shape checks prevent a bad fetch from deleting the client contract.
References: apps/…/openapi.json• L1-40 apps/…/openapi.json• L51572-51660 apps/…/openapi.json• L93459-93738 apps/…/index.ts• L1-7 apps/…/sdk.gen.ts• L1-107 apps/…/types.gen.ts• L1-10 apps/…/types.gen.ts• L30929-31252 apps/…/api-client.ts• L69-86
Generated command documentation
temps docs builds the operator reference from the registered Commander tree. It can write Markdown, MDX, or JSON. Hidden commands stay runnable for compatibility but do not appear in generated documentation until they have a real implementation.
The generated reference is the detailed option guide. A registration guard and command-shape tests keep it aligned with the live command tree. The package build also produces the executable entrypoint and routes the command reference into the operator skill documentation.
References: apps/…/package.json• L12-26 apps/…/CLI.md• L1-37 apps/…/CLI.mdx• L1-39 apps/…/docs.ts• L30-75 apps/…/docs.ts• L83-145 apps/…/docs.ts• L148-322 apps/…/docs.test.ts• L20-63
Local development tools
Development cluster and checks
The local development cluster gives engineers a control plane and worker nodes without real servers. It is intended for multi-node, worker, overlay, and high-availability work that a single local process cannot model. A normal stop keeps state. A reset creates a new control plane and worker enrollment.
Local scripts cover Rust formatting, workspace checks, Clippy, security checks, and generated artifact checks. The application CLI mock API tests request shapes, output streams, exit codes, and compatibility behavior without contacting a real server. Service and sandbox tests also check that command inputs map to the expected API requests and that safety messages stay separate from JSON output.
References: tools/…/README.md• L1-8 tools/…/README.md• L50-131 apps/…/mock-api.ts• L4-9 apps/…/mock-api.ts• L31-107 apps/…/api-client-response.test.ts• L20-287 apps/…/index.test.ts• L20-250 apps/…/placement-commands.test.ts• L122-368
MicroVM sandbox setup
temps firecracker setup and temps microsandbox setup prepare experimental microVM backends. They check host virtualization support, install a pinned runtime, run a smoke VM when enabled, and report readiness without claiming a partial install is usable. --check reports readiness without changing the host.
After first setup, restart temps serve so it registers the backend. A build without the required runtime support cannot install the backend. Microsandbox setup can stage the guest terminal agent; without it, sandboxes can run but interactive shells are unavailable.
References: crates/…/firecracker.rs• L4-19 crates/…/firecracker.rs• L64-100 crates/…/microsandbox.rs• L4-22 crates/…/microsandbox.rs• L51-86 crates/…/microsandbox.rs• L103-120
Local network diagnosis
The Rust network tools separate control-plane repair from worker inspection. The application mesh commands provide the matching view for WireGuard state, pairings, links, and hub selection. Together they show whether a failure is local overlay state, peer reachability, or control-plane configuration.
References: crates/…/mod.rs• L21-31 crates/…/mesh.rs• L33-70 apps/…/index.ts• L316-376
Automation boundaries
The CLI submits and observes platform state. It does not replace the control plane, a worker supervisor, a deployment queue, or the CI lease owner. Remote work can outlive the process that submitted it. Jobs must read returned state instead of treating a successful request as proof that every downstream action is complete.
The safest general pattern is explicit target selection, protected secret input, machine-readable output, and a read-back check. CI runners add a short-lived lease and verified image result. Setup and recovery add validation before mutation. The wider developer workflows page places this pattern in the build, deploy, and test life cycle.
Change checklist
When these files or sections are changed, remember to consider these:
- Keep Rust command dispatch, embedding seams, plugin registration, runner registration, and application command registration aligned.
- Keep serve role, serve profile, split addresses, admin and public listener separation, feature reporting, self-update state, startup failure reporting, DNS bootstrap, and on-demand certificate state aligned.
- Keep worker identity, trust, mTLS material, private port binding, public ingress, agent service paths, and mesh state aligned.
- Keep setup defaults, output format, ACME contact, TLS ownership, external URL, certificate pair validation, migration progress, backup policy, release channels, checksum verification, and restart behavior aligned.
- Keep recovery-set authentication, artifact integrity, temporary S3 credentials, stateless secret checks, restore order, and backup paths aligned.
- Keep ClickHouse and Cloud backfill domains, windows, retention warnings, checkpoints, dedupe behavior, progress, and audit state aligned.
- Keep context selection, URL normalization, credential validation,
TEMPS_CONTEXT, target validation, and project or environment resolution aligned. - Keep JSON stdout free of terminal text and preserve warning, progress, prompt, secret, setup, and runner failure handling on other streams.
- Keep project versus project-group terminology, hosting mode, repository source, environment scope, project secrets, inherited variables, and route mappings aligned.
- Keep template validation, immutable images, secret defaults, service names, database choices, idempotency keys, instantiation states, and retry behavior aligned.
- Keep managed-service schemas,
--setcoercion, dedicated S3 flags, lifecycle state, and destructive-operation confirmation aligned. - Keep provider login phases, resume-on-conflict behavior, cancellation, code redaction, and JSON stream separation aligned.
- Keep status-page publish state, public monitor names, public URL status, domain verification, and renewal guidance aligned.
- Keep instance, project, and environment IP policy scopes, CIDR presets, lockout acknowledgement, proxy propagation, and test results aligned.
- Keep sandbox plural routes, placement state, worker capability errors, shell tab lifetime, terminal-agent readiness, and token placement aligned.
- Keep CI claim, one-build OIDC identity, lease renewal, context limits, log batches, image digest verification, failure reporting, and token revocation aligned.
- Keep OpenAPI projection, canonical serialization, generated SDK operations, generated types, artifact upload, compatibility routes, source-map behavior, telemetry admission, and command docs synchronized.
- Keep local state, mock API behavior, prompt output streams, data-directory discovery, and microVM readiness aligned.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| An automation job uses an unknown context or relies on the active context | The command stops or can target the wrong server | Use --target-context or TEMPS_CONTEXT and validate it before writes |
| Login validates an API key against an ambient server instead of the named URL | A valid key can be rejected, or credentials can be saved for the wrong target | Resolve and validate the explicit URL before storing the key |
| A script parses human output | Spinners, tables, prompts, or warnings corrupt the result | Use --json and parse standard output only |
| A successful GET returns an HTML page or an empty untyped body | The command can otherwise report an empty result with exit status zero | Keep the API response guard and shape check active |
| A remote action returns before its work ends | The job reports success while the server later fails | Poll the related status or run command to a terminal state |
| A template or instantiation is treated as finished after creation returns | Services or databases may still be incomplete | Read the instantiation state and retry or follow its ID |
| A provider login is interrupted without cancellation | The server-side sign-in can hold the provider slot until timeout | Resume the login or cancel it and read the final phase |
serve --role=console has no stable console or proxy address | The sibling proxy or callbacks cannot reach the console | Set matching console and proxy addresses |
| Public callback traffic shares the admin listener | A restricted request can reach more routes than intended | Use a separate public ingress address and reject listener clashes |
| Setup uses external TLS without the required domain and external URL | The public route and certificate owner remain undefined | Set --tls-mode external with both values, or use auto for Temps-managed TLS |
| Setup enables certificate issuance without an ACME contact | Certificate provisioning does not proceed | Supply --letsencrypt-email or LETSENCRYPT_EMAIL |
| Setup writes to a directory the server does not use | The runtime looks installed but stays unavailable | Use the discovered server directory or exact --data-dir |
| A migration is interrupted without server-side cancellation | PostgreSQL can keep running old DDL after the CLI exits | Verify the reported backend is no longer active before retrying |
A Cloud telemetry backfill runs beside temps serve | Shared link state and counters interleave | Stop temps serve for local-mode backfill |
| A backfill window reaches past ClickHouse retention | Old rows can be dropped at insert time | Read the retention warning and widen retention before applying |
| A DNS record is unmanaged or unsupported | Temps refuses to change it | Check ownership, import explicitly, and use supported record types |
| A restore skips manifest authentication, artifact verification, or dry validation | A bad recovery set can mutate the target or fail after partial work | Use the guarded restore path and require a successful dry run |
| A stateless restore uses new encryption or authentication secrets | The restored control plane cannot read its protected data | Inject the original external secrets before recovery |
| A temporary S3 credential omits its session token | S3 rejects the signed request | Pass S3_SESSION_TOKEN with the hidden recovery inputs |
| A template image is mutable or a secret has a literal default | A published artifact can change or expose a secret | Validate the template and use pinned images and secure input |
| A project allow list has no CIDR, or the caller omits lockout acknowledgement | The policy is rejected or a caller can lock itself out | Provide a CIDR and use --acknowledge-lockout when required |
| A status page lacks a public URL or verified domain | Visitors cannot reach the intended page | Read public URL status and complete ingress and domain verification |
| A sandbox operation uses an unsupported worker feature or the old route shape | The request fails even though the sandbox or worker is healthy | Use the plural sandbox route and place unsupported work on the control plane |
| A sandbox node is evicted while some sandboxes cannot be destroyed | Node removal remains unsafe and cleanup work is left behind | Read the partial eviction report and run its cleanup commands |
| A sandbox shell lacks a guest terminal agent | The terminal cannot open although the sandbox may run | Run matching microVM setup and restart the server |
| A CI runner reuses a build token, loses its lease, or reports an unchecked image | The control plane can accept work from the wrong build or record an unverified image | Use one OIDC claim, renew the lease, check platform and digest, and report failure on every exit |
| A source-map tool assumes Temps implements its release model | Upload automation fails before source maps reach the project | Use the supported compatibility routes and preserve their generated API contract |
| A public telemetry request expands its body before admission checks | An unauthenticated route can spend control-plane resources on rejected input | Keep shape, credential, origin, and rate checks before decompression and storage |
| A local API test has no canned response | The command exposes contract drift as an unexpected request | Use the mock API helper and assert request, body, output, and exit code |
Key files
| File | Why to read it |
|---|---|
| crates/…/Cargo.toml | Rust binary and reusable library boundary |
| crates/…/lib.rs | Rust command registration, embedding seams, dispatch, tracing, and secret scrubbing |
| crates/…/mod.rs | Rust command registration and safety setting parsing |
| crates/…/runner.rs | One-shot CI identity, lease, build, push, and result lifecycle |
| crates/…/mod.rs | Serve roles, profiles, split topology, startup boundaries, and feature selection |
| crates/…/proxy.rs and shutdown.rs | Proxy bootstrap, optional Docker behavior, and graceful shutdown |
| crates/…/on_demand_cert.rs | On-demand certificate wiring |
| crates/…/self_update.rs | API-driven update and restart outcome model |
| crates/…/doctor.rs, setup.rs, and migrate.rs | Installation setup, health checks, machine output, and explicit schema changes |
| crates/…/upgrade.rs | Release tiers, channels, and checksum-checked replacement |
| crates/…/agent_service.rs | Persistent worker-agent service lifecycle |
| crates/…/backup.rs, backfill.rs, and cloud_telemetry_backfill.rs | Recovery and historical data movement |
| crates/…/data_dir_discovery.rs, firecracker.rs, and microsandbox.rs | Server-aligned setup and microVM readiness |
| apps/…/package.json | Application CLI build, API generation, docs, and executable packaging |
| apps/…/CLI.md and apps/…/CLI.mdx | Generated operator command reference |
| apps/…/cli.ts | Application CLI registration, context validation, and JSON mode |
| apps/…/login.ts and auth/whoami.ts | Browser or API-key login and identity read-back |
| apps/…/openapi.json, src/…/index.ts, src/…/sdk.gen.ts, and src/…/types.gen.ts | Canonical API, generated operations, generated types, CI runner, artifact, and compatibility surfaces |
| apps/…/api-client.ts and api-client-response.test.ts | URL setup, credential headers, response guards, and error behavior |
| apps/…/feature-maturity.ts | Server-reported maturity notices |
| apps/…/create.ts, projects/list.ts, deploy/deploy.ts, and up/setup-wizard.ts | Project targeting, listing, creation, and deployment lifecycle |
| apps/…/index.ts | Group repository, variable, route, and import workflows |
| apps/…/index.ts | Managed-service schemas, automation inputs, and lifecycle operations |
| apps/…/index.ts, templates/create.ts, templates/validate.ts, and instantiations/index.ts | Template validation, creation, tracking, and retry |
| apps/…/index.ts and ip-access/project.ts | Instance, project, and environment network policy workflows |
| apps/…/index.ts and ai/provider-login.ts | AI readiness and provider sign-in |
| apps/…/index.ts | Backup schedules, sources, and retention cleanup |
| apps/…/index.ts and sandbox/shell.ts | Public status pages and reattachable terminals |
| apps/…/index.ts | Sandbox API, placement, node eviction, and safety boundaries |
| apps/…/index.ts and crates/…/domain.rs | Domain and certificate operations |
| apps/…/docs.test.ts | Generated command documentation and skill-reference contracts |
| apps/…/prompts.ts | Interactive input and non-terminal prompt safety |
| tools/…/README.md | Local multi-node development topology |