feat(cli): add --format, --columns flags and contextual empty-state messages#925
Merged
feat(cli): add --format, --columns flags and contextual empty-state messages#925
Conversation
nhopeatall
approved these changes
Mar 16, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
Summary
LGTM — Clean, well-structured implementation of flexible output formats for CLI dashboard commands.
The PR correctly:
- Adds
--format(table/json/csv/compact),--columns, and backward-compatible--jsonflags to the base command - Implements RFC-compliant CSV quoting and ANSI-stripping for both CSV and compact formatters
- Preserves original API response objects for JSON output (pagination wrappers, full definition objects) while using processed rows for tabular formats
- Extends spinner suppression to all non-table formats to avoid polluting piped output
- Consistently migrates all 6 list commands with contextual empty-state messages
- Comprehensive test coverage (33 new tests covering all formatters, flag resolution, column filtering, and integration)
No blocking or should-fix issues found.
🕵️ claude-code · claude-opus-4-6 · run details
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements flexible output formats for the CASCADE CLI dashboard commands, enabling scripting and pipeline use cases.
--formatflag added toDashboardCommand.baseFlagswith options:table(default),json,csv,compact--jsonflag preserved as a backward-compatible alias for--format json--columnsflag added for filtering which columns to display (e.g.--columns id,status,agent)printCsv()— outputs header row + comma-separated values with RFC-compliant quoting for commas/quotes/newlinesprintCompact()— outputs one-line-per-row inkey=valueformat for quick scanningoutputFormatted()helper onDashboardCommandthat dispatches to the right formatter based on flagscascade runs trigger --project <id> --agent-type <type>")Files Changed
src/cli/dashboard/_shared/format.ts— addedprintCsv(),printCompact(), updatedprintTable()with optionalemptyMessagesrc/cli/dashboard/_shared/base.ts— addedformat/columnsbase flags,resolveFormat(),filterColumns(),outputFormatted()helperssrc/cli/dashboard/runs/list.ts— migrated tooutputFormattedwith empty-state messagesrc/cli/dashboard/projects/list.ts— migrated tooutputFormattedwith empty-state messagesrc/cli/dashboard/users/list.ts— migrated tooutputFormattedwith empty-state messagesrc/cli/dashboard/agents/list.ts— migrated tooutputFormattedwith empty-state messagesrc/cli/dashboard/definitions/list.ts— migrated tooutputFormattedwith empty-state messagesrc/cli/dashboard/webhooklogs/list.ts— migrated tooutputFormattedwith empty-state messageTest plan
npm test)npm run lint)npm run typecheck)printCsv()(7 tests),printCompact()(5 tests),emptyMessageforprintTable()(1 test),resolveFormat()(6 tests),filterColumns()(5 tests),outputFormatted()(8 tests), spinner suppression for non-table formats (1 test)Trello card
https://trello.com/c/0T4i38Gl/445-as-a-user-i-want-flexible-output-formats-so-that-i-can-use-cli-output-in-scripts-and-pipelines
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details