sysand auth whoami#

Show who the index API identifies you as.

Usage#

sysand auth whoami [OPTIONS] [INDEX_URL]

Description#

Sends one authenticated request to the index API (v1/whoami) with the credential sysand would use for that index, and prints the identity the API reports: the subject (a user, a project, or a trusted publisher), the token’s name and display prefix, and its expiry. The command is query-only: nothing is stored or refreshed, and the credential itself is never printed.

The credential is selected the way every request selects one: SYSAND_CRED_* environment credentials take precedence over stored credentials. The output names the source used, a SYSAND_CRED_* variable or a stored credential, so a rejection points at the right credential to fix. An ambiguous match is an error here, not a warning: if two credentials from the same source match with different tokens, the command names them and asks you to refine their patterns. Several patterns carrying the same token collapse to one and are fine.

Without [INDEX_URL], the command targets the default index, echoing the resolved index and erroring if the default-index chain is ambiguous.

The index must advertise an API root in its discovery configuration; an index without one (for example a static index) has no identity endpoint, and the command errors saying so. The exit code is 0 only when the API accepted the credential; a rejected credential, an unreachable API, and a missing API are distinct errors.

Arguments#

  • [INDEX_URL]: Index URL to query (e.g. https://sysand.com). URL templates are accepted. Defaults to the default index.

Global options#

  • -v, --verbose: Use verbose output

  • -q, --quiet: Do not output log messages

  • --no-config: Disable discovery of configuration files [env: SYSAND_NO_CONFIG]

  • --config-file <CONFIG_FILE>: Give path to sysand.toml to use for configuration [env: SYSAND_CONFIG_FILE]

  • -h, --help: Print help

Examples#

A stored credential that the index accepts:

$ sysand auth whoami https://sysand.com
    Checking identity on index `https://sysand.com/`
       Using stored credential for `https://sysand.com/`
     Subject user alice
  Token name laptop
Token prefix sysand_u_1a2b3c4d
     Expires 2026-10-01 00:00:00 UTC (expires in 73 days)

A rejected environment credential, with the remediation naming its source:

$ sysand auth whoami https://sysand.com
    Checking identity on index `https://sysand.com/`
       Using credential from `SYSAND_CRED_INDEX`
error: the index API (`https://sysand.com/api/v1/whoami`) rejected the credential (HTTP 401); rotate or unset `SYSAND_CRED_INDEX_BEARER_TOKEN`

See also#