Repository navigation
Closed
Labels
enhancementNew feature or request
Description
Problem
Flag conventions have drifted across spawn's command surface — surfaced while building the Tier 0 integration suite, which had to special-case several commands. Two clear inconsistency classes:
1. JSON output: root -o/--output json vs per-command --json
The root persistent flag is the canonical selector:
cmd/root.go:58 rootCmd.PersistentFlags().StringVarP(&spawnOutputFormat, "output", "o", "table", "Output format (table, json)")
…but 8 commands define their own local --json bool that duplicates (and can shadow/diverge from) it:
bot.go list.go list_amis.go list-sweeps.go pipeline.go plugin.go sweepgroup.go status.go
Result: spawn list -o json works, but spawn list-sweeps -o json does not — list-sweeps only honors --json. A wrapper/CI script can't assume one convention. (Tier 0 had to remember which commands take which.)
2. Confirmation flags: --yes/-y vs --yes (no shorthand) vs --confirm vs none
launch.go:293 --yes / -y (BoolVarP)
terminate.go:45 --yes / -y (BoolVarP)
slurm.go:113 --yes / -y (BoolVarP)
fsx.go:60 --yes (BoolVar — NO -y shorthand)
bot.go:1047 --confirm (different name; dry-run-by-default semantics)
team.go (delete) (no confirmation flag at all — deletes immediately)
So spawn fsx delete --yes works but -y doesn't; spawn team delete <id> has no guard; bot ... destroy uses --confirm. Destructive commands should be consistent and uniformly guarded.
Proposed work
- Audit every command's flags (spawn, and the same pass for truffle/lagotto since they share conventions and the i18n/output layers).
- JSON output: standardize on the root
-o/--output json. Make every command that emits structured data honor it; deprecate the local--jsonbools (keep as hidden aliases for one release with a deprecation notice, then remove). - Confirmation: standardize on
--yes/-yeverywhere a command mutates/destroys; ensure all destructive commands (notablyteam delete) actually prompt without it. Decide whetherbot destroy's--confirm/dry-run-by-default stays special or converts. - Guard against regressions: add a Tier 0 test asserting the JSON-output and confirmation conventions hold across the command tree (Tier 0 already exercises much of this surface, e.g.
TestTier0_JSONOutputMatrix,TestTier0_TerminateRequiresConfirmation). - Document the conventions in CONTRIBUTING / a flags style note so new commands follow them.
Notes
- This is partly user-facing (flag deprecation), so the
--jsonaliases should warn for a release before removal. - Consider a small shared helper / lint to enforce "no per-command
--json; use root-o" going forward. - Found via the Tier 0 CLI-against-substrate suite; that suite is the natural place to lock the normalized conventions in.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity
test(e2e): pass -y to team delete now that it prompts (#40)
feat: normalize CLI flag conventions (#40) (#42)
refactor(spored): convert hand-rolled CLI to cobra (#40) (#43)
feat(cmd): spawn footprint — report the control plane, delete nothing (…