Skip to content

Conversation

@adolago
Copy link
Owner

@adolago adolago commented Feb 10, 2026

Improved the list-tasks command to support proper JSON output and enhanced the text output with colors for better readability.

Changes:

  • Refactored ListTasksArgs::execute in src/cli/commands/inventory.rs to gather data into PlayListing and TaskListing structs.
  • Added support for serde_json output when ctx.output.is_json() is true.
  • Added colored output for human-readable mode, making it easier to distinguish plays, tasks, and modules.
  • Added a unit test to verify serialization.

UX Improvements:

  • JSON Mode: Now produces valid JSON instead of a mix of text headers and task lists.
  • Text Mode: Uses colors to create a visual hierarchy (Blue for Plays, Bold/White for Tasks, Cyan/Dimmed for Modules, Yellow for Tags/Conditions).

Verification:

  • Verified with manual testing using a dummy playbook.
  • ran cargo test --bin rustible cli::commands::inventory (all passed).
  • Checked for clippy errors in the modified file (none found).

PR created automatically by Jules for task 18357645187385738565 started by @dolagoartur

- Refactor `list-tasks` command to collect structured data before output
- Implement valid JSON output for `list-tasks` when using `--output json`
- Enhance text output with colors for better readability (Play names in Blue, Task names in Bold, Module names in Cyan)
- Add unit test for PlayListing serialization
- Fix issue where text output was interleaved with JSON structure

This aligns with the Palette UX initiative to improve CLI scannability and structured output reliability.

Co-authored-by: dolagoartur <146357947+dolagoartur@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 11fa5aa055

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

// Colored header: Play #1: Play Name
// We construct the string first to handle the formatting properly
println!("\n{} {}: {}",
"Play".blue().bold(),

Choose a reason for hiding this comment

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

P2 Badge Respect --no-color in list-tasks output

The new human-readable rendering applies colored styles directly (e.g., .blue().bold()) without checking the formatter’s color setting, so rustible --no-color list-tasks ... can still emit ANSI escapes in interactive terminals. This regresses the CLI contract where CommandContext::new configures color behavior from !cli.no_color, and it affects users piping/logging output that must remain plain text.

Useful? React with 👍 / 👎.

@adolago adolago merged commit bf63e73 into main Feb 11, 2026
20 of 23 checks passed
@adolago adolago deleted the palette-list-tasks-improvements-18357645187385738565 branch February 11, 2026 08:51
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