Skip to content

hiveguard auth

The auth command group manages credentials stored in ~/.hiveguard/config.json.

auth configure

Interactive credential setup.

Terminal window
hiveguard auth configure

Prompts:

HiveGuard base URL [http://localhost:8000]:
API key (leave blank to skip): hg_xxxxxxxxxxxxxxxx
Dashboard username: admin
Dashboard password: ****

Security warning: The CLI prints a reminder that dashboard credentials provide admin-level access (including dataset deletion). Store them carefully.

The config file is written with mode 0o600 (owner read/write only). The containing directory is 0o700. This prevents other users on shared machines from reading your API key.

auth show

Display the current config (API key is masked).

Terminal window
hiveguard auth show

Output:

Base URL: http://localhost:8000
API Key: hg_ab••••••••••••••••
Dashboard token: set (admin)
Config file: /root/.hiveguard/config.json

Environment variables

You can skip the config file entirely by setting environment variables:

Terminal window
export HIVEGUARD_BASE_URL=http://localhost:8000
export HIVEGUARD_API_KEY=hg_xxxxxxxxxxxxxxxx
export HIVEGUARD_DASHBOARD_TOKEN=base64(admin:password)

Priority order (highest to lowest): CLI flag → env var → config file → default.