ConfigHub CLI Reference: For authoritative command documentation, use
CONFIGHUB_AGENT=1 cub --help-overviewor see docs.confighub.com.
Get quick feedback on ConfigHub CLI commands in your project.
cub CLI before deploying. See LIMITATIONS.md for what this tool cannot do.
curl -fsSL https://raw.githubusercontent.com/monadic/devops-sdk/main/cub-command-analyzer.sh | bash -s -- .This will:
- Download the validator
- Scan all shell scripts in current directory
- Report any invalid
cubcommands - Exit with code 0 (valid) or 1 (invalid)
✅ Command syntax - Entity + verb structure ✅ Required flags - All mandatory flags present ✅ WHERE clauses - EBNF grammar compliance ✅ Common errors - Inline JSON, missing --space, invalid operators ✅ Semantic correctness - Pre/post conditions
Valid commands:
[PASS] All commands are valid!
Summary:
Files analyzed: 12
Commands found: 45
Valid commands: 45
Invalid commands: 0
Invalid commands:
FILE: bin/deploy.sh
LINE 42: cub unit update backend --patch '{"spec":{"replicas":3}}'
SYNTAX VALIDATION:
[FAIL] Invalid syntax
Error: --patch requires one of: --from-stdin, --filename, --restore...
COMMON ERRORS:
- Inline JSON with --patch is invalid
- Missing required --space flag
SUGGESTED FIXES:
For DATA update:
echo '{"spec":{"replicas":3}}' | cub unit update --space dev backend -
For METADATA update:
echo '{"Labels":{"version":"1.0"}}' | cub unit update --patch --space dev backend --from-stdin
# Validate current directory
curl -fsSL https://raw.githubusercontent.com/monadic/devops-sdk/main/cub-command-analyzer.sh | bash -s -- .
# Validate specific directory
curl -fsSL https://raw.githubusercontent.com/monadic/devops-sdk/main/cub-command-analyzer.sh | bash -s -- /path/to/project# Clone SDK
git clone https://github.com/monadic/devops-sdk.git
cd devops-sdk
# Validate any project
./cub-command-analyzer.sh /path/to/your/project# Clone SDK
git clone https://github.com/monadic/devops-sdk.git
cd devops-sdk
# Use enforcement script with better output
./bin/validate-cli /path/to/your/project
# CI mode (no colors)
./bin/validate-cli --ci /path/to/your/project# Copy hook to your project
cp devops-sdk/hooks/pre-commit .git/hooks/
chmod +x .git/hooks/pre-commitNow all commits are automatically validated!
Create .github/workflows/validate-cli.yml:
name: Validate CLI Commands
on: [push, pull_request]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate ConfigHub commands
run: |
curl -fsSL https://raw.githubusercontent.com/monadic/devops-sdk/main/cub-command-analyzer.sh \
-o cub-command-analyzer.sh
chmod +x cub-command-analyzer.sh
./cub-command-analyzer.sh .# In your CI pipeline
curl -fsSL https://raw.githubusercontent.com/monadic/devops-sdk/main/cub-command-analyzer.sh | bash -s -- .
# Check exit code
if [ $? -eq 0 ]; then
echo "✅ All commands valid"
else
echo "❌ Invalid commands found"
exit 1
fiTesting approach (with honest limitations):
- ✅ 39/39 unit tests passing - Validates known patterns (as of 2025-10-12)
- ✅ Integration tests - Compared against real
cubCLI behavior - ✅ Production testing - 154+ commands validated across 3 projects
- ✅ Maintainer feedback - Based on Brian Grant's guidance
⚠️ Known gaps - May miss newer CLI features
Validation results (point-in-time):
- TraderX: 88/88 commands valid (2025-10-12)
- MicroTraderX: 66/66 commands valid (2025-10-12)
- DevOps Examples: 100% validated (2025-10-12)
Important: These results show the linter works for commands as of the sync date. It may be outdated for newer CLI versions.
See Testing & Verification and LIMITATIONS.md for honest assessment.
❌ Wrong:
cub unit update backend --patch '{"spec":{"replicas":3}}'✅ Correct (DATA update):
echo '{"spec":{"replicas":3}}' | cub unit update --space dev backend -✅ Correct (METADATA update):
echo '{"Labels":{"version":"1.0"}}' | cub unit update --patch --space dev backend --from-stdin❌ Wrong:
cub unit apply backend✅ Correct:
cub unit apply backend --space dev❌ Wrong:
cub unit list --where "Slug = 'a' OR Slug = 'b'" # OR not supported✅ Correct:
cub unit list --unit a,b # Use comma-separated names❌ Wrong:
cub unit list --where "Data.spec.replicas > 3" # Data is opaque✅ Correct:
# Data fields cannot be queried in WHERE clauses
# Use metadata fields instead: Slug, Labels, Annotations, etc.
cub unit list --where "Labels.tier = 'critical'"- Full documentation: README.md
- Common errors guide: test/strategies/cub-tests.md
- GitHub issues: https://github.com/monadic/devops-sdk/issues
0- All commands valid ✅1- Invalid commands found ❌2- Validation error (missing tools, etc.)⚠️
Use these in CI/CD to fail builds on invalid commands.