tdx auth#
Sign in with the browser or a token, and manage saved profiles.
login signs in with the browser, approving a code in the dashboard for a personal access token, or validates and saves a token you supply; profiles are host-bound and saved locally. status reads fresh public identity, permissions and expiry, preferring ephemeral TOKEDEX_TOKEN. logout removes the selected saved profile, revoking a token that browser sign-in issued for it. methods reads the gateway's public sign-in configuration and sends no credential. POSIX permissions are local protection, not encryption. Dashboard-only commands stay dashboard-only: a browser sign-in issues a token, never a dashboard session.
Every command also takes the global flags and reads the environment variables that the command reference lists once.
Commands#
| Command | Description | Type |
|---|---|---|
| tdx auth login | Sign in with the browser or save a token. | Write |
| tdx auth status | Inspect credential source and permissions without secrets. | Read |
| tdx auth logout | Sign out: remove the saved profile and revoke a browser sign-in's token. | Write |
| tdx auth methods | Read the public sign-in configuration. | Read |
tdx auth login#
Sign in with the browser or save a token.
Writes a local profile
Browser sign-in (--method browser, the default when no token is supplied): prints a code, opens the gateway's /cli-sign-in page, and waits while you approve the code there from your own dashboard sign-in, confirming it's you if you signed in more than ten minutes ago. Only enter a code your own terminal shows you. The gateway then issues a personal access token that acts as you, with what you may do at each use and never more, minus the dashboard-only actions; it ends when it expires (--expires-in, default 30d, at most 90d), when you sign out everywhere or change your password, and when it is revoked under Account → Access tokens or by auth logout. Requires --host, TOKEDEX_HOST or the selected profile's saved origin, and refuses TOKEDEX_TOKEN, --value-file and --value-stdin. Without --method and with no terminal on stderr, nothing is started: pass --method browser or supply a token. The request expires after ten minutes. A denial or an expiry exits 3 (SIGN_IN_DENIED, SIGN_IN_EXPIRED). If the CLI cannot confirm token delivery, it exits 7 (SIGN_IN_DELIVERY_UNCONFIRMED) and keeps the profile as it was. Revoke any token issued by that sign-in under Account → Access tokens before trying again. The token is saved to the selected profile like a token login's, and signing in again into that profile revokes the token its previous browser sign-in issued. Token login (--method token): supply exactly one of --value-file, --value-stdin or TOKEDEX_TOKEN; existing credentials are never login inputs. File/stdin accept one UTF-8 token and at most one final newline (8194 bytes); stdin is limited to 3 seconds. Files must be owner-owned mode 0600 regular files with no symlinks or unsafe writable ancestors. Validate with GET /control/v1/me before saving or replacing the selected bearer profile. An explicit supplied token may intentionally rebind that profile to a new origin; the old saved credential survives a failed validation or a save that fails before it commits. TOKEDEX_TOKEN requires --host or TOKEDEX_HOST and never uses a saved profile origin. File/stdin host: --host, TOKEDEX_HOST, selected profile origin; profile: --profile, TOKEDEX_PROFILE, default. No remote default. XDG_CONFIG_HOME must already exist; it and its ancestors are never created. When unset, HOME must already exist; only HOME/.config (0700) and the profile files below it may be created. Missing required roots fail without creating a partial tree; create the root manually or set XDG_CONFIG_HOME to an existing directory. Profiles use owner-owned POSIX directory 0700 and files 0600 under the profile root, with exclusive nonsecret per-profile locks and atomic replacement. Every default-root write syncs HOME, then .config and the profile files before publication, even when .config already exists; nothing above HOME is synced. Explicit-root writes sync only from XDG_CONFIG_HOME down to the profile files, never its ancestors or a separate HOME. Required pre-publication sync failures refuse the write; post-publication failures report committed-but-uncertain durability, not rollback. Insecure existing state is refused, not repaired. Local protection is not encryption and does not protect against the same OS user or root; crash-abandoned locks require manual inspection. Master keys receive a break-glass warning, never an escalation fallback. --dry-run reads no saved profile, secret file or stdin, sends no request and creates nothing; it reports an unavailable basis, unchecked by the gateway, and may not show the saved origin. Dry-run requires no credential source; TOKEDEX_TOKEN, when set, is used only to mask the token preview. See Masked read output. A masking failure saves no bearer profile.
# POST /control/v1/cli-sign-in/start
# POST /control/v1/cli-sign-in/redeem
# GET /control/v1/me
# POST /control/v1/me/revoke
tdx auth login [flags]Optional flags
| Flag | Type | Default | Description |
|---|---|---|---|
--method | one of browser, token | Browser (the default when no token is supplied) or token. | |
--name | string | Browser sign-in: the token's name in Account → Access tokens (default: <command> on <hostname>). | |
--expires-in | one of 1d, 7d, 30d, 90d | Browser sign-in: how long the token lasts (default 30d). | |
--no-browser | boolean | false | Browser sign-in: print the sign-in page's address instead of opening it. |
--value-file | path | Read a credential only from this file. | |
--value-stdin | boolean | false | Read a credential from standard input. |
Constraints
- At most one of
--value-file,--value-stdin
Output fields (inside data)
| Field | Type | Description |
|---|---|---|
profile | public-profile | Selected name and canonical origin only; origin may be unobserved during dry-run. |
principal | public-principal|null | Fresh validated kind, public id and name; null during dry-run. |
breakGlass | boolean|null | Validated break-glass status; null during dry-run. |
expiresAt | string|null | When the saved token expires; null when it never does, and during dry-run. |
warning | string|null | A master-key break-glass warning, or a previous browser sign-in's token left unrevoked; never a credential. |
preview | write-preview|null | Requested replacement only, with an unavailable basis; no secret input or saved profile is read. |
Examples
Sign in with the browser:
tdx auth login --host https://gateway.example.testSign in from another machine's browser, for a week:
tdx auth login --host https://gateway.example.test --no-browser --expires-in 7dValidate and protect a redirected bearer token:
tdx auth login --method token --host https://gateway.example.test --value-stdin --jsonPreview the requested replacement without reading a saved profile or secret input:
tdx auth login --method token --profile staging --dry-run --jsontdx auth status#
Inspect credential source and permissions without secrets.
Reads
Read fresh GET /control/v1/me using ephemeral TOKEDEX_TOKEN first, otherwise the selected protected bearer profile. Explicit invalid or refused environment input never falls back. TOKEDEX_TOKEN requires --host or TOKEDEX_HOST and never uses a saved profile origin. Stored-token host: --host, TOKEDEX_HOST, selected profile canonical origin; no remote default. Profile: --profile, TOKEDEX_PROFILE, default (an explicit default wins). A supplied host differing in scheme, name or port from the saved profile's is refused before its credential is sent. Environment bearers never persist implicitly. With an explicit or environment host and token, the saved profile is not opened. The credential's expiry (expiresAt) and whether browser sign-in issued it (source.browserSignIn) are reported; a browser sign-in issues a token, never a dashboard session. HTTPS is required except exact localhost, 127.0.0.1 or [::1] HTTP origins. Redirects and retries are refused; the whole request is limited to 3 seconds and the response to 1 MiB. Only public principal fields and permissions are returned, never grants, CSRF, tokens or cookies. This read still reaches the gateway with --dry-run and may record read usage; it does not preview writes. See Masked read output.
# GET /control/v1/me
tdx auth status [flags]Output fields (inside data)
| Field | Type | Description |
|---|---|---|
principal | public-principal | Route-derived kind, public id and display name only. |
permissions | string[] | Public permission names reported by the gateway. |
installPermissions | string[] | Public install-wide permission names reported by the gateway. |
breakGlass | boolean | Whether the gateway identifies this credential as break-glass. |
expiresAt | string|null | When the token expires, as the gateway reports it; null when it never does. |
source | bearer-source | Canonical origin, profile label, resolution sources and whether browser sign-in issued the credential; never the credential. |
Examples
Inspect TOKEDEX_TOKEN without reading or saving a profile:
tdx auth status --host https://gateway.example.test --jsonRead fresh public fields with the saved profile when TOKEDEX_TOKEN is unset:
tdx auth status --profile staging --json=principal,permissionstdx auth logout#
Sign out: remove the saved profile and revoke a browser sign-in's token.
Writes a local profile
Remove only the named local bearer profile selected by --profile, TOKEDEX_PROFILE, default. TOKEDEX_TOKEN, including invalid input, never selects or changes the selected saved profile; when set, it is used only to mask output. A supplied --host or TOKEDEX_HOST must still match the saved canonical origin. A token that browser sign-in issued for this profile is revoked on the gateway first (POST /control/v1/me/revoke, with the token itself); the profile is removed even when the gateway does not confirm it, and a warning says the token stays valid until it expires or is revoked under Account → Access tokens. A token you supplied with token login is not revoked, since it may be in use elsewhere: logout only removes it from this machine. POSIX ownership, 0700 directory, 0600 regular file, no-symlink and exclusive-lock checks still apply; insecure state is not repaired. A missing profile fails explicitly. --dry-run reads no saved profile or secret files, creates no parents/locks/tempfiles and reports only requested local removal with unavailable basis, never remote revocation. Real logout masks its output with the saved token and TOKEDEX_TOKEN (when set); a mask-limit refusal (OUTPUT_MASK_LIMIT, exit 7) happens before removal and leaves the profile in place.
# POST /control/v1/me/revoke
tdx auth logout [flags]Output fields (inside data)
| Field | Type | Description |
|---|---|---|
profile | public-profile | Selected name and canonical origin only; origin may be unobserved during dry-run. |
removed | boolean | Whether the selected local bearer profile was removed; false during dry-run. |
remoteRevoked | boolean | Whether the gateway revoked a token browser sign-in issued; false for a token login's token and during dry-run. |
warning | string|null | Set when a browser sign-in's token could not be revoked on the gateway. |
preview | write-preview|null | Requested local removal only; null after execution. |
Examples
Remove the selected saved profile, revoking a browser sign-in's token:
tdx auth logout --profile staging --jsonPreview the requested local removal without reading the saved profile:
tdx auth logout --profile staging --dry-run --jsontdx auth methods#
Read the public sign-in configuration.
Reads
Reads the public GET /auth/v1/config, which needs no credential: the sign-in methods the gateway offers, whether single sign-on is required, whether this is a first run, browser session settings and the issued credential prefixes. No Authorization header or credential is sent. Host: --host, TOKEDEX_HOST, otherwise the selected local connection profile's saved origin; that profile's credential is used only to mask output, never sent. Without --host or TOKEDEX_HOST the selected profile's file-safety checks apply (an unsafe profile refuses with PROFILE_UNSAFE); --host or TOKEDEX_HOST skips any profile read. A 401 or 403 keeps its usual code and exit but says no credential was sent. Renamed for name safety: session.cookie is session.browserBound, session.csrfHeader is session.antiForgeryHeader and tokenPrefixes is issuedPrefixes. Every printed value comes from one fail-closed masking pass over the request, the whole gateway reply (including fields the CLI drops) and the CLI's projection, before selection/jq; █ marks masked values. Each method type (oidc, password or bearer) is printed as the CLI's own validated literal. A reply that cannot be masked within the fixed limits fails with OUTPUT_MASK_LIMIT (exit 7) and no values; a malformed reply fails with INVALID_RESPONSE (exit 7). --dry-run still performs this read.
# GET /auth/v1/config
tdx auth methods [flags]Output fields (inside data)
| Field | Type | Description |
|---|---|---|
methods | auth-method[] | Type oidc with id and displayName; type password with breakGlassOnly and minLength; type bearer with accepts. |
ssoRequired | boolean | Whether single sign-on is required. |
firstRun | boolean | Whether no gateway account exists yet. |
session | auth-session | BrowserBound: sessions ride a browser cookie; antiForgeryHeader: the request header name the dashboard sends. |
issuedPrefixes | issued-prefixes | Public prefixes of issued inference and management credentials. |
Examples
Read the masked public projection as versioned JSON:
tdx auth methods --host https://gateway.example.test --jsonSelect declared output fields:
tdx auth methods --host https://gateway.example.test --json=methods,ssoRequiredSee also: tdx auth login, tdx profile show