Skip to content

feat: Add CLI subcommands for AI-native test operations (v4.0.0)#3

Merged
Desperado merged 8 commits intomainfrom
feat/cli-subcommands-v4
Mar 20, 2026
Merged

feat: Add CLI subcommands for AI-native test operations (v4.0.0)#3
Desperado merged 8 commits intomainfrom
feat/cli-subcommands-v4

Conversation

@Desperado
Copy link
Contributor

Summary

  • Add 6 new CLI subcommand groups: test, crawl, repo, import, pr, sast
  • Bump version to 4.0.0 — CLI-first architecture for AI-native workflows
  • Include all review fixes: auth headers, json.Number IDs, timeout unification, input validation

New Commands

qmax test cases/scripts/run/generate/status
qmax crawl start/status/results/jobs
qmax repo list/review/coverage/quality
qmax import repo/doc
qmax pr create
qmax sast verify/install/scan/setup

Test plan

  • go build ./... compiles clean
  • Verify qmax test cases --project-id <id> returns test cases
  • Verify qmax crawl start --project-id <id> --url <url> starts a crawl
  • Verify qmax sast verify checks local tools
  • Verify --test-type invalid is rejected with enum error

🤖 Generated with Claude Code

Desperado and others added 8 commits March 20, 2026 15:44
Phase 1-3 of CLI-first architecture: expose platform test operations
as lean CLI subcommands, reducing AI context overhead by ~90%.

New subcommands:
- qmax test (cases, scripts, run, generate, status)
- qmax crawl (start, status, results, jobs)
- qmax repo (list, review, coverage, quality)
- qmax import (repo, doc)
- qmax pr (create)
- qmax sast (verify, install, scan, setup)

Also includes review fixes:
- Fix auth header in cmd_sast (X-API-Key → Authorization: Bearer)
- Use json.Number for Assignment IDs instead of interface{}
- Unify polling timeouts to 10 minutes across all commands
- Remove duplicate exec.CommandContext in test execution
- Add JSON decode error handling in SAST commands
- Add URL validation, test-type enum validation
- Configurable review suggestions via --max-suggestions/--scope

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Headless CI runner for GitHub Actions / CI pipelines:
- Auth via --token flag or QMAX_TOKEN env var (no browser)
- Runs all or selected scripts with --all/--script-ids
- Polls until completion, generates markdown report
- Writes GitHub Actions outputs and step summary
- Exit 0 on pass, exit 1 on failure (quality gate)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
ScriptID changed from interface{} to json.Number (a string type),
so nil is no longer valid — use empty string instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Suppress filepath.Walk return value (errcheck)
- Remove ineffectual browser assignment (ineffassign)
- Check fs.Parse return values in cmd_ci.go and cmd_crawl.go (errcheck)
- Remove unnecessary fmt.Sprintf in cmd_ci.go (gosimple S1039)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Fix fs.Parse unchecked returns in cmd_import, cmd_pr, cmd_repo, cmd_sast, cmd_testing
- Fix empty branch SA9003 in agent.go (restore browser default)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Move activeTests cleanup defer to top of ExecuteTest (before early returns)
- Use numeric IDs in test JSON fixtures (json.Number rejects quoted strings)
- Fix execution_id test value to numeric

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Protect a.running reads/writes with a.mu mutex — heartbeatLoop
reads it from a goroutine while Run() writes it on shutdown.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- .golangci.yml: pin linters matching CI (errcheck, gosimple, etc.)
- Makefile: add lint, vet, test-race, check, setup-hooks targets
- scripts/pre-commit: runs build + vet + lint before each commit
- Install with: make setup-hooks

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Desperado Desperado merged commit 93b335b into main Mar 20, 2026
1 check passed
@Desperado Desperado deleted the feat/cli-subcommands-v4 branch March 20, 2026 20:18
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