Skip to content

feat(cli): pretty-print run-now outcome, drop Debug dump#2

Merged
avelino merged 2 commits into
mainfrom
avelino/issue-1
May 20, 2026
Merged

feat(cli): pretty-print run-now outcome, drop Debug dump#2
avelino merged 2 commits into
mainfrom
avelino/issue-1

Conversation

@avelino
Copy link
Copy Markdown
Owner

@avelino avelino commented May 20, 2026

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

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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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::output renderer to pretty-print run outcomes (human + JSON).
  • Extend RunOutcome to include counts of truncated stdout/stderr lines.
  • Add --json flag to run-now and document the “no {:?} in CLI output” convention in CLAUDE.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.

Comment thread crates/dotagent/src/commands/output.rs
Comment thread crates/dotagent/src/commands/output.rs Outdated
Comment thread crates/dotagent/src/commands/output.rs Outdated
Comment thread crates/dotagent/src/commands/output.rs Outdated
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
@avelino avelino merged commit 999fbaf into main May 20, 2026
3 checks passed
@avelino avelino deleted the avelino/issue-1 branch May 20, 2026 18:09
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.

CLI commands print raw Debug dump — unreadable on failure

2 participants