tollgate validate
Validates atollgate.yaml configuration file for syntax errors, schema compliance, and common issues.
Usage
Arguments
| Argument | Description | Default |
|---|---|---|
path | Path to tollgate.yaml config file | ./tollgate.yaml |
Options
| Option | Description | Default |
|---|---|---|
-s, --server <name> | Only validate a specific server | - |
--json | Output results as JSON | - |
-q, --quiet | Only output errors (no warnings or info) | - |
Examples
Basic Validation
Selective Validation
CI/CD Integration
Validation Checks
The validator checks for:Schema Validation
- Valid YAML syntax
- Required fields present (
version,servers) - Correct data types
- Valid action values (
allow,deny,prompt)
Server Configuration
- Command is specified
- Environment variables reference existing vars
- Tool patterns are valid glob patterns
Policy Validation
- Catch-all pattern exists (
"*") - Analyzer types are valid
- No conflicting rules
Output
Success
Warnings
Errors
Best Practices
-
Always validate before deploying:
-
Add to CI/CD pipeline:
-
Use JSON output for programmatic checks: