Profiles
How to use multiple named credential profiles — one credentials.toml file with separate sections for personal and CI keys.
Every optixlog command accepts a --profile NAME flag (default "default"). Profiles let you store multiple API keys in one ~/.optixlog/credentials.toml file — for example a personal user key and a CI service-account key.
How profiles work
~/.optixlog/credentials.toml is a TOML file where each profile is a top-level table keyed by the profile name:
[default]
api_base_url = "https://optixlog.leidos.com"
api_key = "sk-opt-user-xxxxxxxxxxxxxxxxxxxxxxxx"
key_type = "user"
organization_id = "org_abc123"
user_email = "founder@optixlog.com"
[ci]
api_base_url = "https://optixlog.leidos.com"
api_key = "sk-opt-service-yyyyyyyyyyyyyyyy"
key_type = "service"
organization_id = "org_abc123"A profile is only recognized if both api_base_url and api_key are present. The other fields (key_type, organization_id, user_email) are cached from the whoami response at login time.
Creating a profile
Run optixlog login with --profile <name>. Existing profiles in the file are preserved:
# Create or refresh the default profile
optixlog login
# Create or refresh the ci profile
optixlog login --api-key sk-opt-svc-xyz --profile ci --no-inputUsing a profile
Pass --profile <name> to any command:
optixlog whoami --profile ci
optixlog init --profile ci --all --no-input
optixlog generate --profile ciWhen --profile is omitted, the "default" profile is used.
Profile isolation
Each profile stores its own api_base_url, api_key, and cached identity independently. You can point different profiles at different server environments:
[default]
api_base_url = "https://optixlog.leidos.com"
api_key = "sk-opt-prod-xxxx"
key_type = "user"
organization_id = "org_abc123"
user_email = "founder@optixlog.com"
[staging]
api_base_url = "https://staging.optixlog.leidos.com"
api_key = "sk-opt-staging-yyyy"
key_type = "user"
organization_id = "org_abc123"
user_email = "founder@optixlog.com"
[ci]
api_base_url = "https://optixlog.leidos.com"
api_key = "sk-opt-svc-zzzz"
key_type = "service"
organization_id = "org_abc123"# Generate against production
optixlog generate
# Generate against staging
optixlog generate --profile staging
# Check freshness in CI using the service account
optixlog generate --profile ci --checkViewing profiles
Use optixlog whoami to see which credential is active for a profile:
$ optixlog whoami --profile ci
Logged in as org_abc123 [profile: ci]
key type: service
organization: org_abc123
base URL: https://optixlog.leidos.com
api key: sk-opt-…zzzz
credentials: ~/.optixlog/credentials.toml (global)Deleting a profile
The CLI does not have a logout command. To remove a profile, edit ~/.optixlog/credentials.toml directly and delete the corresponding TOML table.
OPTIXLOG_API_KEY overrides any profile
If OPTIXLOG_API_KEY is set in the environment, it overrides the stored API key for every profile. --profile still controls which base URL, key type, organization id, and email are used — only the key itself is overridden.