cli-output

Implements stdout/stderr stream conventions, tables, format flags, and TUI progress display for clawker CLI commands.

54|6|Updated Jan 7, 2026
One-click install
npx skills add https://github.com/schmitthub/clawker --skill cli-output-schmitthub
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cli-output
Source: https://github.com/schmitthub/clawker/tree/main/.agents/skills/cli-output
Command: npx skills add https://github.com/schmitthub/clawker --skill cli-output-schmitthub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? CLI commands in the clawker codebase need consistent output behavior: correct stdout/stderr stream placement, styled tables, --format/--json/--quiet flags, interactive prompts, and live progress trees. This Skill encodes those conventions so new or modified commands follow the GitHub CLI (gh) style instead of ad-hoc printing. ## Core Features & Use Cases - Stream and scenario rules: Defines the four output scenarios (static, static-interactive, live-display, live-interactive) with exact stream placement for data, status, warnings, prompts, and errors. - List command recipe: Canonical wiring for Options structs, cmdutil.AddFormatFlags/AddFilterFlags, display row structs, the format dispatch switch, TablePrinter, glob filters, and golden/flag/rendering tests. - TUI and prompts: Covers ColorScheme API, Prompter (String/Confirm/Select), multi-step wizards via TUI.RunWizard, and RunProgress tree display with ProgressStep channels and ProgressDisplayConfig. - Use Case: When adding a volume list command to clawker, use this Skill to register format/filter flags, build display rows, render a styled table, and write flag-parsing and golden-file tests that match existing commands. ## Quick Start Use the cli-output skill to add a new list command with --json, --format, and --filter support following the clawker output conventions.

Frequently Asked Questions about cli-output

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add --format, --json, and --quiet flags to a Go CLI list command?▼

Register them with cmdutil.AddFormatFlags(cmd), which wires --format, --json, and -q/--quiet with PreRunE mutual-exclusivity validation. Then dispatch in the run function: quiet prints IDs, JSON uses cmdutil.WriteJSON, templates use cmdutil.ExecuteTemplate, and the default renders a TablePrinter table.

Should CLI status messages go to stdout or stderr?▼

Data, status, success confirmations, and next steps go to stdout (ios.Out); warnings, errors, diagnostics, and prompts go to stderr (ios.ErrOut). With --format flags, formatted data goes to stdout while status and progress move to stderr.

When should I use a TUI progress tree instead of a spinner?▼

Use RunProgress when work streams multiple named steps asynchronously through a channel with status transitions, such as Docker build stages. Use ios.RunWithSpinner for a single operation of unknown duration, ios.NewProgressBar for measurable byte progress, and plain fmt.Fprintf for one-shot results.

Should commands print errors directly or return them in Cobra?▼

Commands should return errors and never print them directly; Main() renders them centrally via printError to stderr. Use cmdutil.FlagErrorf for flag validation, cmdutil.SilentError when the error was already displayed, and cmdutil.ExitError to propagate container exit codes.

How do interactive prompts behave in non-TTY or CI environments?▼

The Prompter falls back automatically when ios.IsInteractive() is false: String returns its Default, Confirm returns defaultYes, and Select returns defaultIdx. Prompts always render to stderr so they remain visible when stdout is piped.

When should format and filter flags not be added to a command?▼

Do not add them to live-display commands like build, run, or start, which stream progress and use a --progress flag instead. They also do not belong on inspect, logs, remove, prune, or full-screen interactive commands where BubbleTea owns the terminal.