Flag-level filtering API: ExcludeFlags / persistent-flag drop #9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally filed by @coilysiren on 2026-05-13T14:19:48Z - https://github.com/coilysiren/cli-mcp/issues/33
Comparison with njayp/ophis surfaced a gap in cli-mcp's projection filtering surface.
ophis exposes:
ExcludeFlags()- hide named flags (typical use: tokens, secrets, internal toggles)NoFlags- drop persistent inherited flags entirelyAllowCmdsContaining()- opt-in filtercli-mcp today has
Options.SkipPaths,Options.IncludeGroups, and auto-skips hidden commands, but nothing at the flag level. Sensitive-flag stripping is implicitly delegated to cli-guard's argv validation.When cli-mcp is consumed without cli-guard, this is a real gap. A leaf command with a
--tokenflag will surface it in the MCP schema, which agents will then try to fill.Proposal: extend
OptionswithExcludeFlags []string(matched by name or alias) andDropPersistentFlags bool. Keep the cli-guard pathway as the recommended default for full safety, but give standalone users the local knob.Note urfave/cli v3's persistent-flag model is shallower than cobra's, so
DropPersistentFlagsmay have a smaller practical footprint than ophis'sNoFlags. Worth measuring on a real tree before committing to the name.