Title: feat(cli): render generated commands as human tables, not raw JSON by ysyneu · Pull Request #46 · flashcatcloud/flashduty-cli · GitHub
Open Graph Title: feat(cli): render generated commands as human tables, not raw JSON by ysyneu · Pull Request #46 · flashcatcloud/flashduty-cli
X Title: feat(cli): render generated commands as human tables, not raw JSON by ysyneu · Pull Request #46 · flashcatcloud/flashduty-cli
Description: What Generated commands carried no hand-written column set, so in human (table) mode they fell back to indented JSON. This adds a generic, reflection-based table renderer so every generated command renders an aligned table: a paginated list envelope ({Items:[...], Total, ...}) or a top-level row array → aligned table a single object → vertical FIELD/VALUE table anything else → indented JSON (never empty) Columns come from a display-only seed (display_columns.go), lifted from the curated commands' hand-written column sets, with a reflective heuristic (first N scalar/timestamp fields) for unmapped row types. The seed is display-only: it never touches flags or machine output, so a wrong entry degrades one column at worst — it can't cause a functional error. A reflection test (TestDisplayColumns_FieldsResolve) fails the build if any seeded field name doesn't resolve on its SDK type. Machine modes (--output-format json/toon) are untouched — the renderer is reached only in table mode; structured output still marshals the full typed response (test asserts byte-identical to the direct printer). Why Keystone for converging the CLI on generated commands as the single source of truth: human tables no longer require hand-written commands, so curated "shadow" commands (which freeze a flag subset and hide server-side filters — root cause of the channel list --team-ids gap) can be removed later without losing readable output. Test plan go build/vet ./..., go test ./internal/... — green; gofumpt clean. Unit: list-envelope / top-level-array / detail-vertical / empty / heuristic / structured-unchanged (json+toon) / display-columns field-resolution. Live E2E against a real backend (fduty built from this branch): role list (table) → aligned table from real rows (was raw JSON); --output-format json/toon → unchanged structured. role info (table) → vertical FIELD/VALUE table. Full e2e/ suite (-tags=e2e) → all pass except 4 pre-existing TestStatusPage* failures (unknown command "statuspage" — naming drift on the base branch, unrelated to rendering; confirmed identical on origin/feat/ai-sre). Follow-ups (separate PRs) Drop curated shadows group-by-group, migrating the agent skill-doc corpus + scan.sh in lockstep. Unshadow insight team/channel/responder to expose their server-side filters (severities/*_ids/fields/labels). Push value into the API so generated commands inherit it: team_name/creator_name on channel list; a short-id (num) param on incident info.
Open Graph Description: What Generated commands carried no hand-written column set, so in human (table) mode they fell back to indented JSON. This adds a generic, reflection-based table renderer so every generated command...
X Description: What Generated commands carried no hand-written column set, so in human (table) mode they fell back to indented JSON. This adds a generic, reflection-based table renderer so every generated command...
Opengraph URL: https://github.com/flashcatcloud/flashduty-cli/pull/46
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:321fc8b8-8869-f440-9768-3b7924c48088 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9DA0:5105D:290C0F4:3878330:6A4EF92E |
| html-safe-nonce | f13e0590e2c1731cbdabfde736082ae77d52c8e9d2dff370f6ea068429514674 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5REEwOjUxMDVEOjI5MEMwRjQ6Mzg3ODMzMDo2QTRFRjkyRSIsInZpc2l0b3JfaWQiOiI5MDM2NDE4ODQ2NzUyMTc2NDMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | e0eb921b3aa176c7f6d1443efba57e05fb00dff25c802af1a1e7681d9d7f80ea |
| hovercard-subject-tag | pull_request:3866028622 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/flashcatcloud/flashduty-cli/pull/46/files |
| twitter:image | https://avatars.githubusercontent.com/u/9045284?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/9045284?s=400&v=4 |
| og:image:alt | What Generated commands carried no hand-written column set, so in human (table) mode they fell back to indented JSON. This adds a generic, reflection-based table renderer so every generated command... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | b92d11c0aa4a77d54ef4af1078b6a15fb5a70a215b30c4ecf28889d5a8e656d9 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/flashcatcloud/flashduty-cli git https://github.com/flashcatcloud/flashduty-cli.git |
| octolytics-dimension-user_id | 90465697 |
| octolytics-dimension-user_login | flashcatcloud |
| octolytics-dimension-repository_id | 1209147161 |
| octolytics-dimension-repository_nwo | flashcatcloud/flashduty-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1209147161 |
| octolytics-dimension-repository_network_root_nwo | flashcatcloud/flashduty-cli |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 2b8f23afb982271f1b22258a94aede67a6b77760 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width