Documentation
¶
Overview ¶
Package cmdutil provides shared helpers for building SDK-backed CLI commands. Every namespace command follows the same pattern:
- Optional --json flag accepts a raw JSON payload (overrides typed flags)
- Optional --output flag (json | ndjson | text)
- Optional --dry-run flag prints the request and exits
- Results are written to an io.Writer for testability
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunCommand ¶
func RunCommand(ctx context.Context, w io.Writer, reqBody any, dryRun bool, outputFormat string, runFn RunFunc) error
RunCommand executes a SDK-backed command with standard --json / --output / --dry-run handling. reqBody is the request that WOULD be sent (shown on --dry-run). runFn is the actual SDK call, only invoked when dryRun is false.
Types ¶
Click to show internal directories.
Click to hide internal directories.