Privasys
Privasys CLI

Scripting and configuration

JSON output, stable exit codes, named configurations, and environment overrides.

Output

Every command takes --format json (and yaml), and output auto-switches to JSON when stdout is not a TTY, so pipes and agents always get machine-readable output without asking. --no-input never prompts.

TOKEN=$(privasys auth print-access-token)        # pipe a bearer into curl
privasys apps list --format json | jq '.[].name'

Exit codes

Exit codes are stable so scripts and agents can branch on the failure class:

CodeMeaning
0success
1generic error
3not authenticated
4not authorized
5not found

Configuration

Configuration lives at ~/.privasys/config.yaml (named configurations). Global flags: --endpoint, --issuer, --account, --format, --no-input, --quiet.

privasys config set endpoint https://api.developer.privasys.org
privasys config set account <account-id>
privasys config list

Environment overrides

VariableOverrides
PRIVASYS_ENDPOINTplatform API base URL
PRIVASYS_ISSUERidentity provider issuer URL
PRIVASYS_ACCOUNTaccount id to act on
PRIVASYS_FORMAToutput format
PRIVASYS_SERVICE_KEYservice-account key (unattended auth)
PRIVASYS_ACCESS_TOKENa raw bearer, bypassing stored sessions
PRIVASYS_NO_INPUTnever prompt
Edit on GitHub