Skip to content

feat: page list command output and show all entries by default - #286

Open
Ruari-Phipps wants to merge 10 commits into
mainfrom
ruari/feat/add_pager_to_list_commands
Open

feat: page list command output and show all entries by default#286
Ruari-Phipps wants to merge 10 commits into
mainfrom
ruari/feat/add_pager_to_list_commands

Conversation

@Ruari-Phipps

@Ruari-Phipps Ruari-Phipps commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Pages long CLI listings through the system pager, removes the default 10-entry cap on deployments list and branch history, and shows the column headers those two tables were already defining but never rendering.

Motivation

Listings longer than the terminal scrolled past the top, with no way back to the earliest rows short of re-running with --offset. The 10-entry cap that made that bearable also truncated --json, so a script could not tell a project with 10 deployments from one with 500.

Changes

  • Add paged_output() in poly/output/console.py. Output taller than the terminal goes to the system pager; anything shorter prints inline as before. Paging is skipped entirely when stdout is not a TTY, so pipes, redirects, and --json are unaffected.
  • Apply it to deployments list, deployments ab-test list, branch history, conversations list, and testing list.
  • --limit on deployments list and branch history now defaults to showing everything instead of 10. Both slice already-fetched data, so this costs no extra API calls. The commands where --limit is an API request parameter — conversations list, testing list, ab-test list — are unchanged.
  • Render the column headers in print_deployments and print_branch_history, which defined named columns and a header_style but passed show_header=False.

Test strategy

  • Added/updated unit tests
  • Manual CLI testing (poly <command>)
  • Tested against a live Agent Studio project
  • N/A (docs, config, or trivial change)

console_test.py covers the paging decision and the TTY/enabled guards; cli_test.py covers the no-limit and --limit truncation behaviour in both rich and JSON modes.

Checklist

  • ruff check . and ruff format --check . pass
  • pytest passes (1319 passed, 101 subtests)
  • No breaking changes to the poly CLI interface (or migration path documented)
  • Commit messages follow conventional commits

Screenshots / Logs

poly deployments list --json and poly branch history --json now return every entry rather than the most recent 10. Pass --limit explicitly for a bound.

🤖 Generated with Claude Code

@Ruari-Phipps
Ruari-Phipps requested a review from a team August 26, 2026 11:15
@github-actions

This comment has been minimized.

Rich's default pager routes through pydoc, which hardcodes LESS without F
(quit-if-one-screen) or X (stay out of the alternate screen), and overwrites
any LESS the user has set. Short listings opened less, demanded q, and then
vanished on quit.

Decide in Python instead of delegating to less flags, so the behaviour holds
for whichever pager is configured, and default LESS to git's FRX rather than
clobbering it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report

Base (main) PR Change
75.6% 75.6% +0.0% ✅

Changed file coverage

File Coverage Change
poly/cli_commands/testing.py 28.2% -0.3% ⚠️
poly/output/console.py 34.4% +2.0% ✅
poly/cli_commands/branch.py 58.8% +0.1% ✅
poly/cli_commands/deployments.py 84.4% +0.1% ✅
poly/cli_commands/conversations.py 87.9% +0.2% ✅

@linear-code

linear-code Bot commented Aug 26, 2026

Copy link
Copy Markdown

DEVP-621

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