Skip to content

chore(admin-cli): tidy mlx command output (sink, CSV, YAML, wording) #2954

Description

@chet

While realigning the admin CLI onto the Dispatch + Run traits (#2951),
CodeRabbit surfaced four pre-existing rough edges in mlx command output. Each
is a behavior change, so they were deliberately kept out of that
no-behavior-change refactor -- this is the follow-up to tidy them up.

What this involves

  • Honor the configured output sink. The mlx config commands
    (query/set/sync/compare) print via println!/printstd() and bypass
    ctx.output_file. Thread &mut ctx.output_file through and use the async
    write helpers so JSON/YAML/table output respects the selected destination.
    (Heads up: most of mlx prints directly today, so decide how far to take this
    -- it may be a broader pass than just config.) -- mlx/config/cmds.rs
  • Error on unsupported CSV. mlx config query prints CSV not supported yet
    and exits 0 for --format csv; return a CarbideCliError so automation sees a
    non-zero exit. -- mlx/config/cmds.rs
  • Safe YAML for profile list. The OutputFormat::Yaml arm hand-prints
    scalars (println!(" - profile_name: {}", ...)), which can misrender values
    needing escaping. Serialize through serde_yaml like the other YAML paths. --
    mlx/profile/cmds.rs
  • Fix the machine-report error wording. InfoMachineCommand's handler says
    no device report found for device -- should read ...for machine. --
    mlx/info/cmds.rs

All four are pre-existing on main (not introduced by #2951); they were found
via CodeRabbit on PR #2953.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No fields configured for Task.

Projects

Status
Triage

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions