Authentication
hscli authenticates with Help Scout over OAuth 2.0 and stores your tokens in the
operating-system keychain — never in plaintext on disk. One hscli auth login and every
command is ready to run.
Logging in
Section titled “Logging in”Run the interactive login. hscli opens your browser, completes the OAuth flow, and writes the resulting token to your keychain (Keychain on macOS, Credential Manager on Windows, libsecret on Linux).
$ hscli auth login# → opens https://secure.helpscout.net/authentication/oauth ...✓ Authenticated as jordan@acme.io (Acme Support)✓ Token stored in keychainBringing your own Help Scout OAuth app? Run hscli auth setup once (or set HSCLI_APP_ID
and HSCLI_APP_SECRET) to register its credentials.
Non-interactive auth (CI & servers)
Section titled “Non-interactive auth (CI & servers)”For headless environments, use the client-credentials grant with your app's credentials. hscli reads them from the environment and authenticates with no browser:
export HSCLI_APP_ID="$HELPSCOUT_APP_ID"export HSCLI_APP_SECRET="$HELPSCOUT_APP_SECRET"hscli auth login --client-credentialshscli conv list --status active --output jsonEnvironment variables
Section titled “Environment variables”| Variable | Description | Default |
|---|---|---|
HSCLI_APP_ID | OAuth app client ID (for --client-credentials / setup). | — |
HSCLI_APP_SECRET | OAuth app client secret. | — |
HSCLI_PROFILE | Named profile to use for multi-account setups. | default |
NO_COLOR | Disable ANSI colors (standard convention). | — |
Multiple accounts
Section titled “Multiple accounts”Manage several Help Scout accounts with named profiles. Each profile keeps its own
keychain entry; switch with --profile or the HSCLI_PROFILE variable.
$ hscli auth login --profile staging$ hscli conv list --profile staging$ hscli auth statusdefault jordan@acme.io ✓ validstaging bot@acme-test.io ✓ validUsing with agents
Section titled “Using with agents”Because hscli is fully self-describing, an AI agent can discover the entire surface from
hscli --help and operate it safely. Three properties make this reliable:
- Deterministic exit codes —
0success,77not authenticated,75rate-limited, and so on. The agent always knows what happened. - Structured output —
--output jsongives the agent machine-readable data with no scraping. - A locked escape hatch —
hscli apireaches any endpoint, but only on the Help Scout host, so a hallucinated URL can't exfiltrate the token.