Skip to content

fix(cli): resolve all five HIGH UX issues from CLI audit#73

Merged
deveshctl merged 8 commits into
mainfrom
fix/cli-ux-hardening
Jul 8, 2026
Merged

fix(cli): resolve all five HIGH UX issues from CLI audit#73
deveshctl merged 8 commits into
mainfrom
fix/cli-ux-hardening

Conversation

@deveshctl

Copy link
Copy Markdown
Owner

Summary

  • HIGH-1/docs: Remove broken --platform per-argument compare example from README and migrating-from-dive.md--platform is a single-value flag and the example implied per-image pinning that doesn't exist
  • HIGH-2/docs: Fix jq examples in README that referenced nonexistent snake_case fields (wasted_bytes) — replaced with correct camelCase field paths (efficiency.score, layers[].size, efficiency.wastedFiles[].totalWasted)
  • HIGH-3/fix: Demote --json from PersistentFlags to local Flags on rootCmd and ciCmd; compareCmd never registers it so passing --json compare now fails at parse time with "unknown flag" instead of at runtime — adds TestCompareCmd_JSONFlag_UnknownAtParseTime
  • HIGH-4/fix: completeImageRefs now calls engineBinaryForCompletion(engineFlag) instead of hardcoding docker, so Podman users get correct tab completions — adds cmd/completion_test.go
  • HIGH-5/fix: Add warnCIThresholdFlagsIgnored helper that scans raw os.Args and emits a warning: to stderr when CI=true is active and a threshold flag name is present; also documents the limitation in the root --help Long description

Note: HIGH-3 Part B (JSON output on compare) is a new feature and is deferred to a separate branch. All five HIGH items are marked ✓ DONE in internal-docs/Revamp_cli.md.

Test Plan

  • go test ./cmd/... — all existing tests pass; new tests: TestCompareCmd_JSONFlag_UnknownAtParseTime, TestCompletionEngineBinary_*, TestCompleteImageRefs_*, TestWarnCIThresholdFlagsIgnored_*
  • layerx compare --json out.json img:a img:b → "unknown flag: --json" at parse time (not "not supported")
  • layerx --engine podman completion bash — tab completions query podman images instead of docker images
  • CI=true layerx --help — Long description mentions threshold flag limitation

@deveshctl deveshctl merged commit 27dfd15 into main Jul 8, 2026
13 checks passed
@deveshctl deveshctl deleted the fix/cli-ux-hardening branch July 8, 2026 07:11
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