Skip to main content
The sentry-options-cli is a Rust-based command-line tool that validates schema definitions, validates option values against schemas, and generates deployment artifacts (JSON files or Kubernetes ConfigMaps).

Installation

The CLI is distributed as a standalone binary. Install it using one of these methods:
# Install from source (requires Rust)
cargo install --path sentry-options-cli

# Or build locally
cd sentry-options-cli
cargo build --release
./target/release/sentry-options-cli --help

Commands

The CLI provides several commands for different stages of the workflow:
CommandPurpose
fetch-schemasFetch schemas from multiple repos via git sparse checkout
validate-schemaValidate schema definitions in a directory
validate-valuesValidate option values against schemas
writeValidate and convert YAML values to JSON or ConfigMap
validate-schema-changesValidate schema changes between two git SHAs
check-option-usageCheck usage of deleted options in values

Global options

--quiet
boolean
Suppress output messages. When set, the CLI will only output errors and the final artifact (for commands that generate output).
--help
boolean
Display help information for the CLI or a specific command.
--version
boolean
Display the CLI version.

Exit codes

The CLI uses standard exit codes:
  • 0 - Success
  • 1 - Error (validation failure, I/O error, etc.)

Environment variables

SENTRY_OPTIONS_DIR
string
Directory containing sentry-options schemas and values. Used by validate-schema-changes command.Defaults to ~/.sentry-options.

Common workflows

CI: Fetch and validate schemas

# Fetch schemas from repos.json
sentry-options-cli fetch-schemas \
  --config repos.json \
  --out schemas/

# Validate values against fetched schemas
sentry-options-cli validate-values \
  --schemas schemas/ \
  --root option-values/

CD: Generate ConfigMaps

# Generate ConfigMap for specific namespace/target
sentry-options-cli write \
  --schemas schemas/ \
  --root option-values/ \
  --output-format configmap \
  --namespace seer \
  --target us \
  --commit-sha "$COMMIT_SHA" \
  --commit-timestamp "$(date -u +%Y-%m-%dT%H:%M:%SZ)"

Local development: Generate JSON

# Generate JSON files for all namespace/target combinations
sentry-options-cli write \
  --schemas schemas/ \
  --root option-values/ \
  --output-format json \
  --out dist/

Error messages

The CLI provides detailed error messages for common issues:
  • Validation errors - Schema validation failures with option name and error details
  • Duplicate keys - Reports which files contain duplicate option keys
  • Missing targets - Reports namespaces missing the required default target
  • Unknown namespaces - Reports namespaces in values that don’t have schemas
  • Invalid directory structure - Reports files that don’t follow the namespace/target/file.yaml pattern

See also

Build docs developers (and LLMs) love