Skip to content

Configuration

The CLI uses a layered configuration system with multiple sources. Higher priority sources override lower ones.

  1. Environment variables (highest) - VSB_API_KEY, VSB_BASE_URL, VSB_STRATEGY
  2. Config file (lowest) - ~/.config/vsb/config.yaml

Run the configuration wizard to set up credentials interactively:

Terminal window
vsb config

This prompts for your API key and gateway URL, then saves them to the config file.

Terminal window
# Set API key
vsb config set api-key "your-api-key"
# Set gateway URL
vsb config set base-url "https://your-gateway.vsx.email"
# Set delivery strategy (sse or polling)
vsb config set strategy sse

Running vsb config set strategy without a value opens an interactive selector.

Terminal window
vsb config show

The API key is masked in the output for security. When connected to a server, this also displays server capabilities including spam analysis status and allowed domains.

Example output:

api-key: vsb_*****
base-url: https://your-gateway.vsx.email
strategy: sse
Server capabilities:
spam-analysis: enabled
domains: example.com, test.com

JSON output includes a server object with capability details:

Terminal window
vsb config show -o json
{
"apiKey": "vsb_*****",
"baseUrl": "https://your-gateway.vsx.email",
"strategy": "sse",
"server": {
"spamAnalysisEnabled": true,
"allowedDomains": ["example.com", "test.com"]
}
}

The config file is stored at ~/.config/vsb/config.yaml:

api_key: your-api-key
base_url: https://your-gateway.vsx.email
default_output: pretty
strategy: sse
KeyDescriptionDefault
api_keyYour VaultSandbox API key-
base_urlGateway server URL-
default_outputOutput format (pretty or json)pretty
strategyDelivery strategy (sse or polling)sse

Note: default_output can only be set by editing the config file directly. The vsb config set command supports api-key, base-url, and strategy.

VariableDescription
VSB_API_KEYYour VaultSandbox API key
VSB_BASE_URLGateway URL
VSB_STRATEGYDelivery strategy (sse or polling)
VSB_CONFIG_DIROverride config directory
VSB_OUTPUTDefault output format

Example:

Terminal window
export VSB_API_KEY="your-api-key"
export VSB_BASE_URL="https://your-gateway.vsx.email"
export VSB_STRATEGY="sse"
vsb inbox create

The delivery strategy controls how the CLI receives email updates from the gateway.

StrategyDescription
sseServer-Sent Events for real-time push notifications (default)
pollingPeriodic API calls with exponential backoff

When to use each:

  • SSE (default): Best for most use cases. Provides real-time, low-latency email delivery.
  • Polling: Use when SSE is blocked by firewall/proxy, or in CI environments where long-lived connections are problematic.

These flags work with any command:

FlagDescription
--configSpecify config file path
-o, --outputOutput format: pretty or json

Example:

Terminal window
vsb inbox list --output json

The CLI stores data in ~/.config/vsb/:

FileDescription
config.yamlConfiguration settings
keystore.jsonInbox private keys (base64-encoded)