Configuration & Secrets
Manage authentication, config files, environment variables, and tool secrets for the Protobox CLI
The Protobox CLI stores configuration in a local file and supports environment variable overrides. This page covers authentication, config management, tool secrets, and multi-environment workflows.
Config File
CLI configuration lives in ~/.protobox/config.json. The CLI creates it automatically on first use.
protobox config path/Users/you/.protobox/config.jsonWhat's stored
The config file holds your credentials, workspace context, and display preferences. Sensitive values (API key, tokens) are stored in plaintext — protect the file with standard filesystem permissions.
{
"apiKey": "YOUR_API_KEY",
"baseUrl": "https://platform.protobox.ai",
"workspaceId": "ws_abc123",
"defaultFormat": "table"
}Reset config
rm ~/.protobox/config.jsonThe CLI recreates it with defaults on the next command.
Authentication
The CLI supports two methods: browser login and API key.
Browser login opens your default browser for sign-in (Google, Microsoft, or email). Recommended for interactive use.
protobox loginOpening browser for authentication...
If the browser didn't open, visit:
https://app.protobox.ai/cli-auth?port=54321
✓ Authentication successful
User: dean@acme.com
Workspace: ws_abc123
✓ Credentials saved to /Users/you/.protobox/config.jsonIf you belong to multiple workspaces, the CLI prompts you to select one. Browser login stores a JWT and refresh token, and clears any existing API key.
Best for CI/CD, scripts, and headless environments.
protobox login --api-key YOUR_API_KEYThe CLI validates the key against the API before saving it. If validation fails, nothing is stored.
Check auth status
protobox auth statusLog out
protobox logoutLogout removes all stored credentials (API key, JWT, refresh token) and clears the workspace ID.
API Keys
API keys are created in the Protobox dashboard, not from the CLI.
Go to Manage → API Keys (or Connect → MCP) in the Protobox dashboard.
Click Create API Key, name it (e.g. "CI Pipeline"), and select the workspace.
Copy it immediately — it's only shown once.
protobox login --api-key YOUR_API_KEYTo rotate a key, create a new one, update your CLI config or CI secrets, then revoke the old key.
Config Commands
List all config
protobox config listThe Source column shows where each value comes from:
| Source | Meaning |
|---|---|
config | Set in ~/.protobox/config.json |
env | Overridden by an environment variable |
default | Built-in default (not explicitly set) |
Get / set / delete
protobox config get baseUrl
protobox config set defaultFormat json
protobox config delete workspaceIdconfig delete and config unset are aliases.
Switch environment
protobox config use productionFor a custom endpoint, set the base URL directly:
protobox config set baseUrl https://platform.protobox.aiConfig Keys
| Key | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | API key for authentication |
baseUrl | string | https://platform.protobox.ai | Base URL for the Protobox API |
workspaceId | string | — | Default workspace ID for all commands |
defaultFormat | "table" | "json" | table | Default output format |
The jwtToken, refreshToken, and appUrl keys are managed automatically by the browser login flow — you don't set them manually.
Environment Variables
Environment variables override config file values — the recommended approach for CI/CD and containers.
| Variable | Overrides | Description |
|---|---|---|
PROTOBOX_API_KEY | apiKey | API key for authentication |
PROTOBOX_BASE_URL | baseUrl | API base URL |
PROTOBOX_WORKSPACE_ID | workspaceId | Default workspace ID |
PROTOBOX_APP_URL | appUrl | App URL for the browser login flow |
NO_COLOR | — | Disable colored output (any value) |
The legacy CHANL_API_KEY, CHANL_BASE_URL, and CHANL_WORKSPACE_ID variables are still read as a fallback, but prefer the PROTOBOX_* names.
Priority order
Environment variable > Config file > Built-in defaultCI/CD example
steps:
- name: List workspace tools
run: protobox tools list --json
env:
PROTOBOX_API_KEY: ${{ secrets.PROTOBOX_API_KEY }}
PROTOBOX_WORKSPACE_ID: ${{ vars.PROTOBOX_WORKSPACE_ID }}Shell profile example
export PROTOBOX_API_KEY=YOUR_API_KEY
export PROTOBOX_WORKSPACE_ID=ws_abc123Tool Secrets
Tools can reference secrets with the {{secret:name}} syntax in their configuration. Secrets are managed through the dashboard — the CLI does not create or modify them.
How secrets work
{
"name": "weather_api",
"type": "http",
"configuration": {
"http": {
"url": "https://api.weather.com/v1/forecast",
"headers": { "Authorization": "Bearer {{secret:WEATHER_API_KEY}}" }
}
}
}At runtime, the platform resolves {{secret:WEATHER_API_KEY}} to the value stored in the workspace's secret store. The value never appears in logs, API responses, or tool definitions.
Managing secrets
Go to Connect → Secrets in the Protobox dashboard.
Click Add Secret and enter the name (e.g. WEATHER_API_KEY) and value.
Use {{secret:WEATHER_API_KEY}} in the tool's headers, URL, or body.
Secrets are write-only in the UI — you can set and update them, but not read existing values. Store them in a password manager.
Inspect a secret reference from the CLI
You can see which tools reference secrets, but not the resolved values:
protobox tools get <tool-id> --json | jq '.configuration.http.headers'{ "Authorization": "Bearer {{secret:WEATHER_API_KEY}}" }SDK Configuration
When using @protoboxai/sdk directly, pass configuration to the constructor:
import { ProtoboxSDK } from '@protoboxai/sdk';
const client = new ProtoboxSDK({
baseUrl: 'https://platform.protobox.ai',
apiKey: process.env.PROTOBOX_API_KEY,
timeout: 30000,
retry: { maxRetries: 3, retryDelay: 1000, backoffMultiplier: 2 },
});| Option | Type | Default | Description |
|---|---|---|---|
baseUrl | string | — | API base URL (required) |
apiKey | string | — | API key authentication |
jwtToken | string | — | JWT token authentication |
workspaceId | string | — | Workspace context |
timeout | number | 30000 | Request timeout (ms) |
headers | Record<string, string> | — | Custom headers on all requests |
debug | boolean | false | Enable debug logging |
retry.maxRetries | number | 3 | Maximum retry attempts |
retry.retryDelay | number | 1000 | Initial delay between retries (ms) |
retry.backoffMultiplier | number | 2 | Exponential backoff multiplier |
The CLI reads ~/.protobox/config.json and environment variables automatically. The SDK constructor is only needed when building your own application.