Agent Infra CLI
infra is a command-line client built on agent-infra-sdk. Infra services use
the Agent Infra Gateway. File and command operations go through Environment
Computer and Space APIs.
Install
Since 0.3.0 the CLI follows the SDK's Environment-only boundary: use infra computer,
infra space, and infra evaluate. Removed infra workspace commands are not
remapped to legacy routes.
The default Gateway is http://127.0.0.1:5200. Persist a remote Gateway once:
Resolution order is --gateway > SKY_GATEWAY_URL > saved config > local
default. Override the config path with --config or AGENT_INFRA_CONFIG.
The default path is:
- macOS:
~/Library/Application Support/agent-infra/config.json - Linux:
${XDG_CONFIG_HOME:-~/.config}/agent-infra/config.json - Windows:
%APPDATA%\agent-infra\config.json
Environment configuration remains supported:
Do not put a long-lived token directly on the command line in shared shell environments; process arguments and shell history may be visible to others. The config file stores only the Gateway URL, never credentials.
Sky credentials
Credential resolution order is --token > SKY_GATEWAY_TOKEN > a directly
readable local ~/.sky/credentials token. Inspect discovery without printing
secrets:
Modern sky login credentials use an ENCv1 encrypted store. Infra detects
that login state but deliberately does not decrypt another CLI's credential
file. In that case, issue a scoped Sky user API token and expose it as
SKY_GATEWAY_TOKEN. infra auth status reports this as
sky_login_encrypted and provides the same guidance.
Examples
# Health and discovery
# Agent Registry
# Runtime Identity lifecycle
# Agents are configurations bound to Runtime IDs; reverse lookup stays here
# Durable context; append accepts an array of ConversationRecord objects
# Langfuse-backed trace metrics (repeat --project-id to query multiple projects)
# Allocate/query Langfuse projects through the Trace admin API
# Runtime Langfuse binding (product path; not Admin)
# Environment computers, spaces, and snapshots
# Deploy runtime templates and bound repositories
# Initialize a runtime, agent, repo, trace binding, context, and default model
# OpenAI-compatible Model Infra JSON APIs; '-' means stdin
|
Complex write requests are supplied as JSON files or standard input so the CLI
stays aligned with the SDK's contract types as those contracts evolve. JSON
field names use the contracts' camelCase wire format.
infra deploy repo init clones the bound GitLab repository with the operator's
local Git credentials and writes a gitignored .env.local containing
RREPO_ID, REPOSITORY_URL, and optional AGENT_ID / RUNTIME_ID. Pass
--dir to choose the checkout path and --no-clone to write the env file
without cloning. JSON stdout remains the repository record; the checkout path
is printed on stderr. Tokens are never written to .env.local.
infra runtime create prints the complete CreateRuntimeIdentityResponse.
On the first successful create this includes the one-time bootstrapToken;
treat stdout as secret-bearing output and do not write it to shared logs.
After permissions are installed and the identity is active,
runtime bootstrap-credential exchanges that proof through the public Gateway
bootstrap endpoint. Its JSON output also contains a secret workload token.
The common create path takes a mutable name directly and defaults kind to
code. The service derives a deterministic idempotency key from the normalized
creation name, so callers normally do not pass one:
infra agent create --name weather --runtime-id rti_01K... is the common Agent
path. The Registry derives an idempotency key from the normalized name unless
--idempotency-key is passed. Creation still requires at least one Runtime ID.
The --file form remains available for extra relations.
runtime_id remains stable when the name changes:
Use --idempotency-key only to control an exceptional retry scope. The
advanced --file form remains available for a complete request document:
Lifecycle commands (activate, suspend, resume, and revoke) accept a
TransitionIdentityRequest document: