Skip to main content

sentrix auth

Sign in and verify API authentication and connectivity.

sentrix auth

Sign in to Sentrix, test authentication, and verify connectivity to the Sentrix API.

Subcommands#

sentrix auth login#

Start browser OAuth login and store the resulting session in your local Sentrix secret store.

Usage#

bash
sentrix auth login [--port <port>] [--timeout <seconds>]

Options#

FlagTypeDefaultDescription
--portintegerfrom config, default 17483Local callback port used by the browser OAuth redirect.
--timeoutintegerfrom configSeconds to wait for the browser callback before failing.

WSL browser setup#

On Windows WSL (Ubuntu), browser login opens a Windows browser and waits for the callback in WSL. Install wslu and xdg-utils so the CLI can delegate browser opening to Windows:

bash
sudo apt update
sudo apt install -y wslu xdg-utils

command -v wslview
wslview https://api.sentrix.ai

command -v wslview should print a path, and wslview https://api.sentrix.ai should open your Windows browser.

Examples#

Start browser login:

bash
sentrix auth login

Use a longer callback timeout:

bash
sentrix auth login --timeout 300

The CLI prints a local callback URL such as http://127.0.0.1:17483/callback; do not open that callback URL directly. Complete the login in the browser window opened by the CLI.

sentrix auth test#

Verify that your stored credentials are valid and the CLI can reach the Sentrix API.

Usage#

bash
sentrix auth test [--method <auto|api-key|oauth>] [--url <url>] [--key <key>] [--verbose]

Options#

FlagTypeDefaultDescription
--methodstringautoAuthentication method. Values: auto, api-key, or oauth. auto prefers a stored OAuth session when present and falls back to API-key authentication.
--urlstringfrom configOverride the API base URL for this test only.
--keystringfrom configOverride the API key for this test only. Applies to API-key authentication.
--verboseboolfalsePrint the request URL and response time to stderr.

Examples#

Test with your configured credentials:

bash
sentrix auth test

Test with verbose output:

bash
sentrix auth test --verbose

Test your stored browser OAuth session:

bash
sentrix auth test --method oauth

Test a specific API key before saving it to your config:

bash
sentrix auth test --key sk-your-new-key

Test against a different API endpoint:

bash
sentrix auth test --url https://api.staging.sentrix.ai --key sk-staging-key