Agents and CI
The CLI gives agents and CI jobs shell-native access to BCTRL without an API client. The patterns below keep runs reproducible and machine-readable.
Authentication
Set BCTRL_API_KEY instead of running bctrl auth login. It takes precedence over stored credentials, so the run uses exactly the key you passed:
Verify the key resolves before running real work:
Prefer JSON
Pass --json so output is structured and stable across CLI versions:
Pull a single field out with --jq:
Reach for --template when you need fixed custom text rather than JSON:
Error handling
v1 API errors include stable fields:
The CLI surfaces the error code, request ID, and a suggested next command when one is available. When an agent reports a failure, pass through the command that failed, the error code, and the request ID so the run can be traced.
Destructive commands
Delete and archive commands require a confirmation flag such as --yes, so they never fire by accident in a non-interactive shell. An agent should not delete, revoke, archive, or stop a resource unless the user asked for it.

