Skip to main content

Authentication Modes

The CLI supports two public auth modes:
ModeBest for
OAuth via trigify loginLocal development and interactive usage
API key via TRIGIFY_API_KEY or --api-keyCI, scripts, and headless execution

OAuth Login

Start an interactive login flow:
trigify login
The CLI opens a browser window, completes the OAuth flow, and stores credentials locally for later commands.

Stored Credentials

Credentials are stored in an OS-appropriate config directory:
PlatformPath
macOS and Linux~/.config/trigify/credentials.json
Windows%APPDATA%/trigify/credentials.json
Stored credentials are encrypted at rest and written with restrictive file permissions.

Re-authenticate

Force a fresh login even if a valid session already exists:
trigify login --force

Custom Base URL

Point OAuth at a non-production API base:
trigify login --base-url https://trigify-api-staging.up.railway.app

API Key Authentication

Use an API key for one-off commands:
trigify --api-key trig_your_api_key search list
Or export it once for the current shell session:
export TRIGIFY_API_KEY=trig_your_api_key
trigify search list
API keys are the preferred option for CI and other non-interactive environments.

Environment Variables

VariableDescription
TRIGIFY_API_KEYDefault API key for headless authentication
XDG_CONFIG_HOMEOverride the config root on macOS/Linux
APPDATAWindows config root override
Example:
export TRIGIFY_API_KEY=trig_your_api_key
trigify whoami

Logout

Remove stored OAuth credentials from disk:
trigify logout

Identity And Verification

Check which account and organisation the CLI is currently using:
trigify whoami
This is the fastest way to verify that OAuth or API key authentication is pointing at the expected workspace.

Troubleshooting

Session already exists

If trigify login reports that you are already authenticated, either keep using the current session or run:
trigify login --force

Local session expired

Expired OAuth sessions are refreshed automatically when possible. If refresh fails, re-run:
trigify login

Wrong environment

If commands are returning unexpected data, ensure your API key belongs to the correct organisation.