Skip to main content

tritonctl command index

tritonctl is the tenant command line client for Triton Cloud. It calls the customer surface of tritond and never targets the operator /v1/system/* endpoints, which belong to tritonadm.

Your tenant comes from the bearer token you authenticate with. tritonctl never sends a tenant= selector of its own. The global --project flag narrows a request to one project inside that tenant.

Every resource is addressed by UUID. No tritonctl argument accepts a resource name.

Command index

tritonctl has seventeen top-level commands.

CommandSubcommandsPurpose
configureNoneAuthenticate against an endpoint and write the endpoint plus token pair to the config file.
loginNoneRe-authenticate against the configured endpoint and rewrite the stored tokens.
logoutNoneDelete the config file, including the stored credentials.
whoamiNonePrint the resolved endpoint and the identity behind the current credential.
envNonePrint shell export lines for the resolved endpoint and access token.
instancelist, show, create, delete, start, stop, rebootManage instances.
disklist, show, resizeList and show the disks of an instance, and grow a disk.
vpclist, show, create, deleteManage VPCs.
subnetlist, show, create, deleteManage subnets inside a VPC.
floating-iplist, show, create, delete, attach, detachAllocate floating IPs and bind them to a NIC.
firewall-rulelist, show, create, deleteManage firewall rules on a VPC.
nat-gatewaylist, show, create, deleteManage NAT gateways on a VPC.
route-tablelist, show, create, deleteManage route tables inside a VPC.
routelist, show, create, deleteManage routes inside a route table.
imagelist, showRead the image catalog.
ssh-keylist, show, create, deleteManage the SSH keys owned by your user.
metalist, get, set, unset, realizedRead and write project and instance metadata.

There is no console, ssh, project, tenant, user, snapshot, or migration command in tritonctl.

Global flags

All of these are declared global, so they are accepted before or after a subcommand.

FlagValueBehavior
--endpointURLCluster endpoint. Falls back to TRITONCTL_ENDPOINT, then the config file.
--api-keyToken stringBearer credential to send. Falls back to TRITONCTL_API_KEY.
--projectUUIDProject to scope tenant resources to. Reads TRITONCTL_PROJECT when the flag is absent.
-o, --outputtable, wide, json, yamlOutput format. See Output formats.
--no-headersFlagOmit the table header row. Table output only.
-h, --helpFlagPrint help.
-V, --versionFlagPrint the version.

Output formats

-o accepts four values. When you do not pass -o, tritonctl selects table if stdout is a terminal and json when stdout is piped or redirected.

ValueRendering
tableBorderless column layout with a header row, unless --no-headers is set.
wideAccepted by the flag. No tritonctl subcommand adds columns for it, so it renders the same columns as table.
jsonPretty-printed JSON of the full server record.
yamlYAML of the full server record.

JSON is the stable interface. Table column layout is human-facing and carries no stability guarantee.

Enums are rendered through their serde wire form rather than a Rust debug name. LifecycleState is an adjacently tagged enum, so the STATE column of tritonctl instance list and the lifecycle: line of tritonctl instance show render a JSON object, not a bare string:

{"state":"running"}

Configuration file

tritonctl keeps one endpoint and, when you are logged in, one token pair in a single JSON file. The file holds an endpoint string and an optional tokens object with access_token, refresh_token, access_expires_at, and refresh_expires_at.

The path is the platform user configuration directory joined with triton/tritonctl/config.json. The source documents this as ~/.config/triton/tritonctl/config.json. tritonctl configure prints the resolved path after writing.

On Unix the file is created with mode 0600 and moved into place with an atomic rename, so the token bytes never sit on disk world-readable.

There are no named profiles. One config file holds exactly one endpoint and one token pair. To work against a second cluster, pass --endpoint, set TRITONCTL_ENDPOINT, or point TRITONCTL_CONFIG_DIR at a different directory.

Environment variables

VariableEffect
TRITONCTL_ENDPOINTEndpoint used when --endpoint is absent.
TRITONCTL_API_KEYBearer credential used when --api-key is absent.
TRITONCTL_ACCESS_TOKENBearer credential used when no API key is set. Never auto-refreshed.
TRITONCTL_CONFIG_DIRReplaces the default config directory. The config file becomes $TRITONCTL_CONFIG_DIR/config.json.
TRITONCTL_PROJECTDefault value for --project.
RUST_LOGtracing filter for diagnostics on stderr. Defaults to warn.

tritonctl env emits TRITONCTL_ENDPOINT and, when a bearer is resolved, TRITONCTL_ACCESS_TOKEN as shell exports, followed by a comment line:

# eval "$(tritonctl env)" to load these into the current shell

Endpoint resolution

tritonctl resolves the endpoint in this order, highest priority first:

  1. The --endpoint flag.
  2. The TRITONCTL_ENDPOINT environment variable.
  3. The endpoint field in the config file.

With none of the three, the command fails with:

no endpoint configured: pass --endpoint, set TRITONCTL_ENDPOINT, or run `tritonctl configure`

Credential resolution

tritonctl resolves the bearer credential in this order, highest priority first:

  1. The --api-key flag.
  2. The TRITONCTL_API_KEY environment variable.
  3. The TRITONCTL_ACCESS_TOKEN environment variable. This value is sent as-is and is never refreshed.
  4. The token pair in the config file.

The first three short-circuit the stored-token path entirely. When none is present, tritonctl sends no Authorization header.

A resolved bearer is attached as Authorization: Bearer on every request. The HTTPS client bundles the Mozilla webpki-roots trust store instead of reading a system CA bundle, because the illumos global zone ships none.

Token refresh

When the credential comes from the config file, tritonctl inspects access_expires_at before each command. Inside 60 seconds of expiry it POSTs the refresh token to /v1/auth/refresh, writes the new pair back to the config file, and uses the new access token for the command. Outside that window it uses the stored access token unchanged.

If the refresh token has itself expired, the command fails with:

refresh token has expired; run `tritonctl login` to re-authenticate

configure and login both obtain a pair by POSTing a username and password to /v1/auth/login on the resolved endpoint. When --username is omitted, both prompt for it. The password is read from stdin with --password-stdin and prompted for otherwise. configure additionally prompts for the endpoint, with http://localhost:8080 as the default value.

Identity output

tritonctl whoami prints the resolved endpoint, then one identity line. For a bearer that parses as a three-part JWT it prints identityd token followed by whichever of the claims sub, tenant_id, realm_scope, scope, and exp are present. The payload is base64-decoded for display only, with no signature verification. For any other bearer it prints API key.

With no credential resolved, the identity line is:

auth: not authenticated (run `tritonctl login`)

Scope requirements

Some commands need a selector that the flag definitions do not force. The server rejects the request when the selector is missing.

CommandRequirement
instance listNeeds --project or --image. Unscoped, the server returns 400 MissingScope.
instance createThe server requires both tenant= and project=. tritonctl sends project= only, so this returns 400 MissingScope.
instance delete --forceThe server restricts force delete to fleet operators and returns 403 Forbidden otherwise. Non-forced delete requires the instance to be stopped or failed.
disk list--instance is required by both the CLI and the server.
vpc list, vpc createThe server requires both tenant= and project=. tritonctl sends project= only, so these return 400 MissingScope.
subnet list, subnet create--vpc is required by both the CLI and the server.
floating-ip list, floating-ip createThe server requires both tenant= and project=. tritonctl sends project= only, so these return 400 MissingScope.
firewall-rule list--vpc is optional in the CLI. The server requires vpc=.
nat-gateway list--vpc is optional in the CLI. The server requires vpc=.
route-table list--vpc is optional in the CLI. The server requires vpc=.
route list--route-table is optional in the CLI. The server requires route_table=.
image listtritonctl sends scope=tenant. The server implements scope=public only and returns 400 ScopeNotImplemented.
warning

instance create, vpc list, vpc create, floating-ip list, floating-ip create, and image list cannot complete against the current server for the reasons in the table above. instance show, image show, and the per-VPC network commands are unaffected.

See also