fix(output): prefix pagination next_actions with the binary name - #86
Merged
Conversation
The suggested next-page command in `next_actions` started at the noun/verb path (e.g. `list --limit 2 --offset 2`), which isn't directly runnable — a user has to know to prepend their own binary name before pasting it. `pagination_command_base` now takes the CLI's configured binary name and leads with it, so the suggestion is copy-pastable as-is (e.g. `my-cli list --limit 2 --offset 2`). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR improves pagination UX in the cli_engine crate by making the “next page” suggestion (next_actions[].command) directly runnable: it now prefixes the reconstructed command fragment with the CLI binary name (CliConfig::name) instead of starting at the noun/verb path.
Changes:
- Prefix paginated
next_actionscommand suggestions with the configured binary name. - Update pagination documentation/comments to reflect the new copy-pastable behavior.
- Update exact-match pagination integration tests to expect the binary name prefix.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| cli-engine/src/cli.rs | Prefixes pagination next-action command reconstruction with CliConfig::name. |
| cli-engine/tests/pagination.rs | Adjusts expected next_actions[].command strings (and human output assertions) to include the binary prefix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Copilot review: pagination_command_base prefixed the suggested next-page command with CliConfig::name unquoted, while every other token in the suggestion goes through quote_pagination_value. A binary name containing whitespace or shell metacharacters (CliConfig::new doesn't validate name) would produce a suggestion that isn't actually copy-pastable, defeating the point of this fix. Route the binary name through the same quoting helper and add a regression test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
rts1-godaddy
approved these changes
Aug 5, 2026
Merged
jpage-godaddy
pushed a commit
that referenced
this pull request
Aug 5, 2026
🤖 I have created a release *beep* *boop* --- <details><summary>cli-engine: 0.8.1</summary> ## [0.8.1](cli-engine-v0.8.0...cli-engine-v0.8.1) (2026-08-05) ### Bug Fixes * **auth:** retry ExecProvider spawn on transient ETXTBSY ([#84](#84)) ([b2be4f3](b2be4f3)) * **output:** prefix pagination next_actions with the binary name ([#86](#86)) ([f65ae91](f65ae91)) </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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
next_actions(surfaced whenever a paginated command's response has more data) started at the noun/verb path — e.g.list --limit 2 --offset 2— which isn't directly runnable as-is.pagination_command_basenow takes the CLI's configured binary name (CliConfig::name) and leads with it, so the suggestion is copy-pastable, e.g.my-cli list --limit 2 --offset 2.quote_pagination_value. SinceCliConfig::newdoesn't validatename, a binary name with whitespace or shell metacharacters would have produced a suggestion that wasn't actually copy-pastable. Routed the binary name through the same quoting helper and added a regression test.cli-engine/tests/pagination.rsand addednext_page_action_quotes_a_binary_name_with_whitespace.Test plan
cargo fmt --all --checkcargo clippy --all-targets -- -D warningsRUSTDOCFLAGS='-D warnings' cargo doc --no-depscargo test --all-targets(all suites pass, including the fullpagination.rssuite — 22 tests)🤖 Generated with Claude Code