Protobox

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.json

What'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.json

The 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 login
Opening 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.json

If 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_KEY

The CLI validates the key against the API before saving it. If validation fails, nothing is stored.

Check auth status

protobox auth status

Log out

protobox logout

Logout 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_KEY

To 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 list

The Source column shows where each value comes from:

SourceMeaning
configSet in ~/.protobox/config.json
envOverridden by an environment variable
defaultBuilt-in default (not explicitly set)

Get / set / delete

protobox config get baseUrl
protobox config set defaultFormat json
protobox config delete workspaceId

config delete and config unset are aliases.

Switch environment

protobox config use production

For a custom endpoint, set the base URL directly:

protobox config set baseUrl https://platform.protobox.ai

Config Keys

KeyTypeDefaultDescription
apiKeystringAPI key for authentication
baseUrlstringhttps://platform.protobox.aiBase URL for the Protobox API
workspaceIdstringDefault workspace ID for all commands
defaultFormat"table" | "json"tableDefault 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.

VariableOverridesDescription
PROTOBOX_API_KEYapiKeyAPI key for authentication
PROTOBOX_BASE_URLbaseUrlAPI base URL
PROTOBOX_WORKSPACE_IDworkspaceIdDefault workspace ID
PROTOBOX_APP_URLappUrlApp URL for the browser login flow
NO_COLORDisable 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 default

CI/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_abc123

Tool 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 },
});
OptionTypeDefaultDescription
baseUrlstringAPI base URL (required)
apiKeystringAPI key authentication
jwtTokenstringJWT token authentication
workspaceIdstringWorkspace context
timeoutnumber30000Request timeout (ms)
headersRecord<string, string>Custom headers on all requests
debugbooleanfalseEnable debug logging
retry.maxRetriesnumber3Maximum retry attempts
retry.retryDelaynumber1000Initial delay between retries (ms)
retry.backoffMultipliernumber2Exponential backoff multiplier

The CLI reads ~/.protobox/config.json and environment variables automatically. The SDK constructor is only needed when building your own application.

Troubleshooting

CLI Overview

Install, authenticate, and explore all commands

MCP Integration

Connect Claude, Cursor, and other clients

SDK Reference

Use the SDK in your own applications

API Reference

Full REST API documentation

On this page