Skip to content

Compact CLI list output by default#1

Open
andrei-hasna wants to merge 1 commit into
mainfrom
compact-cli-output
Open

Compact CLI list output by default#1
andrei-hasna wants to merge 1 commit into
mainfrom
compact-cli-output

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Summary

  • Add shared compact CLI formatting helpers with a 20-row human default, truncation, readable tables, and concise hints.
  • Add show/inspect, --verbose, --limit, and event --cursor discovery paths across the standalone CLI and embeddable commander adapter.
  • Preserve full machine-readable JSON by default while documenting that explicit filters/limits/cursors select the requested page.
  • Update README and tests for compact defaults, detail paths, cursor pagination, JSON stability, and commander parity.

Before / After

Worst noisy default in this package was an uncapped event history list.

Before, with 25 events:

$ events events list
...
2026-06-24T06:48:03.677Z\t...\taudit\tdemo.21\tinfo
2026-06-24T06:48:03.756Z\t...\taudit\tdemo.22\tinfo
2026-06-24T06:48:03.823Z\t...\taudit\tdemo.23\tinfo
2026-06-24T06:48:03.881Z\t...\taudit\tdemo.24\tinfo
2026-06-24T06:48:03.941Z\t...\taudit\tdemo.25\tinfo
# 25 rows printed, no cap or next-step hint

After:

$ events events list
TIME                      ID                                    SOURCE  TYPE     SEVERITY
...
2026-06-24T06:48:04.883Z  ...                                   audit   demo.22  info
2026-06-24T06:48:04.913Z  ...                                   audit   demo.23  info
2026-06-24T06:48:04.943Z  ...                                   audit   demo.24  info
2026-06-24T06:48:04.989Z  ...                                   audit   demo.25  info
Showing 20 of 25. 5 older omitted. Use --cursor <event-id> for older rows. Use --limit <n>, --verbose, events events show <id>, or events events list --json for more.

Validation

  • bun test src/cli/cli.test.ts src/commander.test.ts
  • bun run typecheck
  • bun test
  • bun run build
  • Manual noisy-data probes for default event list, verbose event list, replay summary, and cursor pagination.

Adversarial Review

Ran a read-only adversarial reviewer focused on CLI compatibility, output ergonomics, and token bloat. Findings were reconciled before this PR:

  • Event cursor pagination now fetches older omitted rows from the default newest page.
  • README/help text now documents that JSON honors explicit filters, limits, and cursors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant