Precedence
Every setting resolves in the same order, checked in this sequence, first non-empty value wins:1
Flag
An explicit
--api-key, --endpoint, --organization-id, or --ca-bundle on the command line.2
Environment variable
BONYA_API_KEY, BONYA_ENDPOINT, BONYA_ORGANIZATION_ID, or BONYA_CA_BUNDLE.3
Saved login
Whatever
bonya login last wrote to the config file. --ca-bundle has no saved-login fallback — only flag and environment variable apply to it.--endpoint and --organization-id are optional at every level — an unset endpoint falls back to https://api.bonya.ai, and an unset organization ID resolves to your personal organization.
Run bonya whoami at any time to see exactly which source (--flag, environment variable, bonya login (saved), or (not set)) each setting is currently resolving from.
Config file
bonya login writes the resolved API key (and, if given, the endpoint and organization id) to a JSON file:
$XDG_CONFIG_HOME/bonya/config.json, ifXDG_CONFIG_HOMEis set- otherwise
<user config dir>/bonya/config.json(Go’sos.UserConfigDir()—~/Library/Application Support/bonya/config.jsonon macOS,~/.config/bonya/config.jsonon Linux)
endpoint and organization_id are omitted from the file entirely when not set. The file is written with 0600 permissions, and its parent directory with 0700, since it holds a live API key. bonya logout deletes the file; deleting an already-absent file is not an error.
bonya org use updates just the organization_id field in this same file, without touching the API key or endpoint.
--json
Pass --json on any command to get machine-readable output instead of tables and key/value text:
--json also disables all interactive prompting (see below), the same as --no-input.
Non-interactive behavior
bonya prompts — with pickers, confirmations, and spinners — only when it’s safe to. Prompting is disabled the instant any of these five conditions hold:
--no-inputis passed--jsonis passed- the
CIenvironment variable is set (to anything) - stdin is not a terminal (piped, redirected, or a CI runner)
- stdout is not a terminal
delete is a special case: on a non-interactive run, there is no confirmation prompt to skip — naming the sandbox on the command line is the confirmation. --force only matters interactively, where it skips the “are you sure” prompt.Color
--no-color disables ANSI color codes; the NO_COLOR environment variable does the same. Color is also automatically suppressed whenever output isn’t a terminal, so piping bonya list to a file or another program never leaks escape codes into it.