Skip to main content
The CLI uses the same pbk_ user API Tokens as the Public API and SDK. Create a Token from Settings → Public API, restrict it to the required Workspaces, and select only the scopes used by your commands.

Interactive login

The CLI reads the Token through a hidden terminal prompt, validates it by calling GET /public/v1/workspaces, and saves it to:
The directory is created with mode 0700 and the credentials file with mode 0600.
auth:logout removes only the local credentials file. Revoke a compromised or unused Token from the PostlyBee dashboard as well.

Environment variables

Environment variables take priority over saved configuration and are recommended for CI:
The global --token, --workspace, and --base-url options override environment variables for one command.
Avoid putting a Token directly in a shell command because it may be saved in shell history or visible in the process list. Prefer auth:login or a masked environment variable.

Required scopes

Scopes restrict a Token but never grant Workspace membership. If the Token owner stops managing a Workspace, CLI access ends immediately.

Self-hosted installations

Save the custom URL during auth:login, or set POSTLYBEE_API_URL for every command.
Last modified on August 26, 2026