feat: surface next_actions as a "Next steps" footer in human output#36
Merged
Conversation
Human/terminal output dropped an envelope's `next_actions` entirely — they appeared only in JSON/TOON — so commands that suggest follow-up steps gave no on-screen guidance. `render_human_with_view` now appends a "Next steps:" footer listing each action's command template (placeholders like `<domain>` shown as-is) with its description. Error envelopes and empty action lists render exactly as before. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR updates the Rust cli_engine human/terminal output renderer to surface Envelope.next_actions as a “Next steps:” footer, bringing the human output feature set in line with the existing JSON/TOON output envelopes.
Changes:
- Append a “Next steps:” footer to human output when
next_actionsis non-empty, and keep error envelopes footer-free. - Refactor the success-path renderer to split data rendering into a
render_data_bodyhelper and footer rendering intorender_next_actions. - Add unit tests covering footer present/absent cases and ensuring error envelopes do not include the footer.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review: render the footer by writing directly into the data body instead of `format!`-ing a new string. The no-footer path now leaves the body untouched (no realloc/copy), and each action is pushed straight into the buffer (no per-action temporaries). Output is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jbrooks2-godaddy
approved these changes
Jul 1, 2026
jbrooks2-godaddy
left a comment
Collaborator
There was a problem hiding this comment.
One qq on custom output registered, lgtm
| return format!("Error: {}\n", error.message); | ||
| } | ||
| if let Some(data) = &envelope.data | ||
| && let Some(custom) = registry.custom(schema_id) |
Collaborator
There was a problem hiding this comment.
This skips the extra next action footer if we have custom human output, I think that's reasonable?
jpage-godaddy
pushed a commit
that referenced
this pull request
Jul 2, 2026
🤖 I have created a release *beep* *boop* --- ## [0.3.5](cli-engine-v0.3.4...cli-engine-v0.3.5) (2026-07-01) ### Features * surface next_actions as a "Next steps" footer in human output ([#36](#36)) ([2408910](2408910)) --- 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.
What
next_actions(the suggested follow-up commands anEnvelopecan carry) wereonly rendered in
--output json/toon. The human/terminal renderer(
render_human_with_view) ignored the field entirely, so commands that suggestnext steps gave the user no on-screen guidance.
This adds a "Next steps:" footer to human output, built from the envelope's
next_actions:Details
render_human_with_viewnow renders the data body (unchanged) and then appendsthe footer when
next_actionsis non-empty. The data rendering was factoredinto a small
render_data_bodyhelper so the footer is appended once acrossboth the column-view and plain paths.
next_actionsadds nothing, so existing human output is byte-for-byte identical.
<domain>are displayedliterally, matching the JSON representation).
Note: a command that registers a custom human-view renderer
(
register_func) bypassesrender_human_with_viewand so won't get the footer;the default and column-view paths (what commands use in practice) are covered.
Tests
Added unit tests in
src/output/human.rs: footer present with actions, absentwithout, and never on error envelopes.
cargo fmt --check,clippy --workspace --all-targets -D warnings, and the fullcargo test --workspacesuite pass.🤖 Generated with Claude Code