Skip to content

Conversation

@zharinov
Copy link
Member

@zharinov zharinov commented Jan 4, 2026

Summary

  • Migrate CLI from clap derive to builder API for per-command flag visibility control
  • All 5 query commands (check, dump, infer, exec, trace) now accept the same flags
  • Irrelevant flags are hidden from --help but silently accepted at runtime

Why

When debugging queries, users frequently switch between trace, exec, dump, etc. Previously this required manually removing command-specific flags:

plotnik trace query.ptk app.js --fuel 500 -vv
plotnik dump query.ptk app.js --fuel 500 -vv  # ERROR: unknown flags

Now all commands accept the union of all flags, so you can switch freely without editing the command line.

Unified Flags Matrix

Flag check dump infer exec trace
SOURCE hidden hidden hidden visible visible
--compact hidden hidden hidden visible hidden
--verbose-nodes hidden hidden visible visible hidden
--entry hidden hidden hidden visible visible
-v hidden hidden hidden hidden visible
--fuel hidden hidden hidden hidden visible

Notes

  • 39 tests verify flag acceptance and help visibility
  • Helper functions (with_hidden_*_args) centralize the unified flags logic
  • tree and langs commands unchanged (different domain)

@zharinov zharinov force-pushed the feat/unified-cli-flags branch from 00bb8de to cb1042f Compare January 4, 2026 20:39
@zharinov zharinov merged commit 23daa8b into master Jan 4, 2026
4 checks passed
@zharinov zharinov deleted the feat/unified-cli-flags branch January 4, 2026 20:45
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.

2 participants