Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/check-cli-surface.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ fi

# Capture root persistent flags once — these are available on every subcommand
# but --help --agent only reports them on the root command itself.
ROOT_FLAGS=$("$BINARY" --help --agent 2>/dev/null | jq -c '[.flags // [] | .[] | {name, type}]')
# Use a child command's inherited_flags to get only persistent flags, excluding
# local-only root flags like --version that Cobra does not propagate.
_first_sub=$("$BINARY" --help --agent 2>/dev/null | jq -r '.subcommands[0].name')
ROOT_FLAGS=$("$BINARY" "${_first_sub}" --help --agent 2>/dev/null | jq -c '[.inherited_flags // [] | .[] | {name, type}]')
Comment on lines +18 to +21

walk_commands() {
local cmd_path="$1"
Expand Down