hscli resolves configuration using standard 12-factor precedence. The first source with a value wins:
- CLI flags --
--mailbox 123,--output json,--profile work - Environment variables --
HSCLI_APP_ID,HSCLI_PROFILE,NO_COLOR - Profile config -- per-profile settings in the config file
- Global config -- top-level settings in the config file
- Built-in defaults -- hardcoded defaults in the CLI
This means a flag always overrides an environment variable, which always overrides a profile config value, and so on.
| Variable | Description | Default |
|---|---|---|
HSCLI_APP_ID |
OAuth App ID for authentication | -- |
HSCLI_APP_SECRET |
OAuth App Secret for authentication | -- |
HSCLI_AUTH_MODE |
Set to client_credentials to use Client Credentials flow |
-- |
HSCLI_PROFILE |
Profile name to use | default |
NO_COLOR |
Disable color output when set to any value | -- |
DEBUG |
Enable debug logging. Use hs:* for all hscli logs, or narrow with hs:auth, hs:client, etc. |
-- |
export HSCLI_APP_ID=your-app-id
export HSCLI_APP_SECRET=your-app-secret
export HSCLI_AUTH_MODE=client_credentials
hscli auth login --client-credentials
hscli conv list --status active --output jsonProfiles let you maintain separate configurations and credentials for different Help Scout accounts.
Each profile has:
- Its own OAuth credentials and tokens (stored in the OS keychain or encrypted file).
- Its own set of config key-value pairs (stored in the config file).
The active profile determines which credentials and config are used by default. It is stored in the global config file.
Profiles are created implicitly when you log in with a profile name:
hscli auth login --profile work
hscli auth login --profile personalhscli profile use workAll subsequent commands use the work profile unless overridden.
hscli profile listOutput marks the active profile with * and shows authentication status.
Any command accepts --profile <name>:
hscli conv list --profile personalOr use the environment variable:
HSCLI_PROFILE=personal hscli conv listSet config values that apply only to a specific profile:
hscli profile use work
hscli config set default_output json
hscli config set page_size 50
hscli profile use personal
hscli config set default_output table
hscli config set page_size 25These keys can be set with hscli config set <key> <value> and read with hscli config get <key>:
| Key | Description | Default |
|---|---|---|
default_output |
Default output format (table or json) |
table in TTY, json when piped |
page_size |
Default number of results per page | 25 |
timeout_ms |
API request timeout in milliseconds | 30000 |
oauth_app_id |
OAuth App ID stored for this profile | -- |
oauth_app_secret |
OAuth App Secret stored for this profile | -- |
auth_mode |
Auth mode for this profile (authorization_code or client_credentials) |
-- |
apiBase |
API base URL (for testing or proxying) | https://api.helpscout.net/v2 |
hscli config set default_output json
hscli config set page_size 50
hscli config set timeout_ms 60000
hscli config listhscli uses the conf library for config storage, which follows platform conventions:
| OS | Config directory |
|---|---|
| macOS | ~/Library/Preferences/hscli-nodejs/ |
| Linux | ~/.config/hscli-nodejs/ (or $XDG_CONFIG_HOME/hscli-nodejs/) |
| Windows | %APPDATA%\hscli-nodejs\ |
The main config file is config.json inside this directory. It stores the active profile name and all per-profile configuration:
{
"activeProfile": "default",
"profiles": {
"default": {
"oauth_app_id": "abc123",
"auth_mode": "client_credentials",
"default_output": "json",
"page_size": 50
},
"work": {
"oauth_app_id": "def456",
"auth_mode": "authorization_code"
}
}
}Tokens and secrets are not stored in the config file. They are stored separately:
- OS Keychain (preferred): macOS Keychain, Windows Credential Vault, or Linux libsecret via
@napi-rs/keyring. - Encrypted file fallback:
credentials.jsonin the same config directory, encrypted by theconflibrary.
Run hscli auth status to see which storage backend is active and hscli doctor to verify the keychain is working.