Overview
SBproxy ships as a single binary called sbproxy (aliased as sb). All configuration is done through the config file. The CLI handles starting, validating, and inspecting your setup.
Global Flags
| Flag | Description |
|---|---|
-h, --help | Show help for any command |
-V, --version | Print the version and exit |
sbproxy serve
Start the proxy server. This is the primary command.
sbproxy serve [flags]
| Flag | Env Var | Default | Description |
|---|---|---|---|
-f, --config | SB_CONFIG_FILE | Path to the sb.yml config file. The path must be supplied; the binary does not auto-discover a config in the working directory. A bare positional path also works: sbproxy sb.yml. | |
--log-level | SB_LOG_LEVEL | info | Log filter. Accepts a bare level (debug, info, warn, error) or a per-target filter. |
--request-log-level | SB_REQUEST_LOG_LEVEL | unset | Independent filter for the access log. |
--log-format | SB_LOG_FORMAT | compact | Log output format: compact, pretty, or json. |
--shutdown-grace-ms | SBPROXY_SHUTDOWN_GRACE_MS | 30000 | SIGINT/SIGTERM drain budget in milliseconds. Supersedes the legacy --grace-time / SB_GRACE_TIME. |
--disable-sb-flags | SB_DISABLE_SB_FLAGS | false | Lock off the per-request feature-flag surface (X-Sb-Flags header and _sb.* query params). Recommended for production. |
Examples
# Start with a config file (positional or via -f)
sbproxy sb.yml
sbproxy serve -f /etc/sbproxy/sb.yml
# Debug logging with JSON output
sbproxy serve -f sb.yml --log-level debug --log-format json
# Production: lock off the per-request debug flags
sbproxy serve -f sb.yml --disable-sb-flags
sbproxy validate
Validate the config file without starting the server. Exits with code 0 if the config is valid, or code 1 if errors are found.
sbproxy validate [flags]
Examples
# Validate a config file (exit 0 on success)
sbproxy validate sb.yml
# Diff a config against a baseline before rollout
sbproxy plan -f sb.yml --against baseline.yml
sbproxy version
Print the SBproxy version and exit.
sbproxy --version
Environment Variables
Every CLI flag has a corresponding environment variable. Environment variables take precedence over defaults but are overridden by explicit flags.
| Variable | Equivalent Flag |
|---|---|
SB_CONFIG_FILE | -f, --config |
SB_LOG_LEVEL | --log-level |
SB_REQUEST_LOG_LEVEL | --request-log-level |
SB_LOG_FORMAT | --log-format |
SBPROXY_SHUTDOWN_GRACE_MS | --shutdown-grace-ms |
SB_GRACE_TIME | --grace-time (legacy) |
SB_DISABLE_SB_FLAGS | --disable-sb-flags |