OptixLog Docs
CLICommands

optixlog whoami

Show the saved login for a credential profile. The API key is always masked. Optionally re-validates the key against the server.

optixlog whoami reads ~/.optixlog/credentials.toml and displays the stored identity for a credential profile. The API key is always masked — the full secret is never printed. The command is read-only and makes no changes to the credentials file.

Synopsis

optixlog whoami [OPTIONS]

Flags

Prop

Type

Behavior

Not logged in

If no credential is saved for the requested profile, the command prints to stderr and exits 1:

Not logged in [profile: default]. Run `optixlog login`.

Logged in

Prints the stored identity, key type, organization, base URL, and the masked API key:

$ optixlog whoami
Logged in as founder@optixlog.com [profile: default]
  key type:     service
  organization: org_leidos_01
  base URL:     https://optixlog.leidos.com
  api key:      sk-opt-…2345
  credentials:  ~/.optixlog/credentials.toml (global)

The organization line is omitted when no organization id is stored. The api key field uses the mask format sk-opt-…<last-4-chars> — the full secret is never shown.

With --validate

Builds the backend from the stored credential and calls whoami() against the server (or fixture). On success, appends:

Key valid.

If the key is rejected or the server is unreachable, the command exits 1 with an error message.

Key masking format

The API key is displayed as sk-opt-…<last-4-chars>. For example, a key sk-opt-xxxx1234abcd2345 is shown as sk-opt-…2345. Keys shorter than 11 characters are shown as ….

Usage examples

# Show the default profile
optixlog whoami

# Show a named profile
optixlog whoami --profile ci

# Re-validate the saved key against the server
optixlog whoami --validate

# Re-validate against a fixture (offline)
optixlog whoami \
  --validate \
  --fixture tests/fixtures/schema.sample.json

Errors

ConditionMessageExit code
No credential saved for profileNot logged in [profile: <p>]. Run \optixlog login`.`1
--validate: key is invaliderror: <server rejection message>1
--validate: server unreachableerror: <network error>1

Read-only command

whoami never modifies the credentials file. To update a stored credential, run optixlog login again for the same profile.

On this page