Skip to content

feat: cobra CLI skeleton, validate subcommand - #2

Merged
tannevaled merged 1 commit into
mainfrom
cli-skeleton-validate
Nov 10, 2026
Merged

tannevaled merged 1 commit into
mainfrom
cli-skeleton-validate

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

Summary

Second piece of the automation layer. cmd/webtest/main.go holds RootCmd()/osExit, matching go-compressions/lz4c's own convention (SetArgs/SetOut/SetErr-testable, SilenceUsage: true) — the CLI model named in CLAUDE.md.

validate <scenario.hcl>: parses and schema-checks a scenario file with no render and no network — the fast check a scenario author or CI runs before ever pointing one at a real page. Prints hcl.Diagnostics to stderr and exits non-zero on anything invalid.

The run subcommand (actually driving a page) and the security guardrails (session/dry-run/pin-enforcement/audit-log/bounds/anti-bot) are not implemented yet — tracked separately in the plan file, since they need go-webengine/engine's driver wiring first.

Test plan

  • TestValidateValidScenario/TestValidateInvalidScenario/TestValidateMissingFile/TestValidateRequiresExactlyOneArg
  • go build/go vet/gofmt -l/govulncheck ./... clean
  • go test ./... green (both hclscenario and cmd/webtest)

🤖 Generated with Claude Code

cmd/webtest/main.go: RootCmd()/osExit, matching go-compressions/lz4c's
own convention (SetArgs/SetOut/SetErr-testable, SilenceUsage: true).

validate <scenario.hcl>: parses and schema-checks a scenario file with
no render and no network — the fast check a scenario author or CI runs
before ever pointing one at a real page. Prints hcl.Diagnostics to
stderr and exits non-zero on anything invalid.

The run subcommand (actually driving a page) and the security
guardrails (session/dry-run/pin/audit-log/bounds/anti-bot) are not
implemented yet — tracked separately in the plan file.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit dd97f28 into main Nov 10, 2026
1 check passed
@tannevaled
tannevaled deleted the cli-skeleton-validate branch November 10, 2026 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant