Recommended for agents and CI
Store the key in the coding-agent host or CI provider’s secret manager asCONTACTBUTTON_TOKEN:
CONTACTBUTTON_API_KEY is accepted as a compatibility alias. If both are set, CONTACTBUTTON_TOKEN wins.
Never paste the key into a prompt, commit it to a repository, or pass it as a CLI argument. The CLI deliberately has no --token or --api-key flag.
Local interactive login
For a developer workstation:- macOS and Linux:
${XDG_CONFIG_HOME:-~/.config}/contactbutton/config.json - Windows: the equivalent path beneath the user’s configured home directory
0600 where the operating system supports POSIX permissions.
For an automated local setup that already receives the key through a secure stdin channel:
echo, because it can enter shell history. Prefer a secret-manager command that writes the value to stdin.
Credential precedence
The CLI resolves credentials in this order:CONTACTBUTTON_TOKENCONTACTBUTTON_API_KEY- The local CLI configuration file
contactbutton auth status reports the active source but never prints the secret.
Log out and rotate
Appdev and local APIs
Override the API root when testing:localhost, 127.0.0.1, or ::1. Request paths must remain relative to the configured base URL, preventing a supplied path from redirecting the bearer key to another host.