Skip to content

Compact CLI output defaults#32

Open
andrei-hasna wants to merge 2 commits into
mainfrom
compact-cli-output-disclosure
Open

Compact CLI output defaults#32
andrei-hasna wants to merge 2 commits into
mainfrom
compact-cli-output-disclosure

Conversation

@andrei-hasna

Copy link
Copy Markdown
Contributor

Summary

  • Make human CLI output compact by default for noisy task list/detail/history/search paths: truncated text, 50-row human pages, totals, and explicit next-step hints.
  • Add gradual disclosure paths via --limit, --cursor/--offset, --verbose, show/inspect, and preserve script-oriented --json/CSV behavior unless a limit is explicitly requested.
  • Compact MCP list_tasks output by default, add cursor continuation, and reject invalid cursors instead of silently replaying or ending pagination.
  • Update README/agent/help docs and add CLI/MCP regression tests for compact defaults and compatibility paths.

Before / After

Before, a noisy task database could make todos list --all dump every long row into the terminal with no paging/detail hint. A 55-task example printed all 55 long rows.

After, the same shape of data starts with a compact page:

50 of 55 task(s):

52af353e pending     medium   Example noisy task 54 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
51454ce3 pending     medium   Example noisy task 53 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
...

Showing 50 of 55. Use --cursor <cursor>, --limit, or --verbose for more. Use `todos show <id>` or `todos inspect <id> --verbose` for details.

Adversarial Review Reconciliation

A read-only adversarial reviewer focused on CLI compatibility, output ergonomics, and token bloat found four issues; all are fixed here:

  • Sorted/post-filtered task lists no longer emit incompatible DB cursors; they use --offset, and --cursor is rejected with those modes.
  • CSV output is not silently capped by the human compact default.
  • search --json keeps uncapped machine-readable behavior unless --limit is explicit.
  • Invalid task cursors now produce visible CLI/MCP errors instead of silent first-page/empty-page behavior.

Validation

  • bun run typecheck
  • bun test src/mcp/mcp.test.ts --timeout 30000
  • bun test src/cli/cli.test.ts --timeout 30000
  • git diff --check
  • bun run build
  • timeout 300s bun test was attempted; it hit the 300s cap without reporting a failure. Focused CLI/MCP suites above pass and cover this change.

Changed Files

  • src/cli/commands/task-commands.ts
  • src/cli/commands/project-commands.ts
  • src/cli/helpers.ts
  • src/db/task-crud.ts
  • src/mcp/token-utils.ts
  • src/mcp/tools/task-crud.ts
  • src/cli/cli.test.ts
  • src/mcp/mcp.test.ts
  • README.md, AGENTS.md, src/lib/cli-reference.ts, src/lib/cli-manpage.ts

Local State Note

The branch was created after a safe git fetch --prune with main aligned to origin/main. The worktree already had unrelated uncommitted release/SDK/server/public-release changes and untracked SDK files; those were left uncommitted and are not part of this PR.

andrei-hasna and others added 2 commits June 24, 2026 09:05
Preserve reviewed non-risky working tree changes before fleet repo redistribution. Risky local-only paths, if any, were left uncommitted.
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