feat(cli): pretty-print run-now outcome, drop Debug dump#2
Merged
Conversation
run-now was printing the OrchestratedOutcome via {:?}, so users saw
the raw Rust struct with escaped \n inside stderr, exit code buried
in the middle of prose, and no signal of failure. Issue #1.
New crates/dotagent/src/commands/output.rs renders a status line
(icon + color when TTY, NO_COLOR respected) with stdout and stderr
indented and split on real newlines. The runner now tracks how many
lines were dropped from each tail so the renderer can point at the
full log. Added --json for scripting and a CLAUDE.md rule forbidding
{:?} in user-facing output.
fixed: #1
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR improves dotagent run-now UX by replacing user-facing Debug dumps of OrchestratedOutcome with a dedicated renderer that supports human-friendly formatting and a --json mode for scripting, while also tracking truncated output line counts in the runner.
Changes:
- Add
commands::outputrenderer to pretty-print run outcomes (human + JSON). - Extend
RunOutcometo include counts of truncated stdout/stderr lines. - Add
--jsonflag torun-nowand document the “no{:?}in CLI output” convention inCLAUDE.md.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/dotagent/src/main.rs | Adds --json flag to run-now and selects output format. |
| crates/dotagent/src/commands/utility.rs | Routes run-now output through the new outcome renderer. |
| crates/dotagent/src/commands/output.rs | Implements human/JSON renderers, TTY/NO_COLOR styling, and truncation notices; adds unit tests. |
| crates/dotagent/src/commands/mod.rs | Exposes the new output module. |
| crates/dotagent-runner/src/lib.rs | Tracks stdout/stderr truncated line counts when tailing output. |
| CLAUDE.md | Documents the rule to avoid {:?} in user-facing CLI output and to use the renderer. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Avelino <31996+avelino@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.
run-now was printing the OrchestratedOutcome via {:?}, so users saw the raw Rust struct with escaped \n inside stderr, exit code buried in the middle of prose, and no signal of failure
New crates/dotagent/src/commands/output.rs renders a status line (icon + color when TTY, NO_COLOR respected) with stdout and stderr indented and split on real newlines. The runner now tracks how many lines were dropped from each tail so the renderer can point at the full log. Added --json for scripting and a CLAUDE.md rule forbidding {:?} in user-facing output.
fixed: #1