Context
Every subcommand in src/commands.rs calls output::emit(mode, label, value) with the result, and src/output.rs chooses between Mode::Json and Mode::Human. But the global --human flag only enables pretty-printing — it does not pretty-print JSON itself. Agents consuming JSON from stdout and humans debugging in a terminal both benefit from the jq-style indented variant.
Scope
- In
src/output.rs:
- Add
Mode::JsonPretty variant.
- Update
emit:
Mode::Json → serde_json::to_string(value) (compact — existing behavior).
Mode::JsonPretty → serde_json::to_string_pretty(value).
Mode::Human → existing pretty colored output.
- In
src/main.rs:
- Add
--pretty global flag. Mutually exclusive with --human.
- If
--pretty is set, use Mode::JsonPretty.
- Update README's example outputs to include
--pretty examples.
Acceptance criteria
arbitrum-cli block latest → single-line JSON (unchanged).
arbitrum-cli block latest --pretty → indented JSON.
arbitrum-cli block latest --human → colored table (unchanged).
--human --pretty exits non-zero with a clear clap error.
- All existing tests pass.
Reference: src/output.rs::emit is 30 lines; PR #2 (feat: agent-deposit command + GitHub Actions CI) for CI/test expectations.
Estimated effort
S (1–2 hours)
— kcolbchain / Abhishek Krishna
Context
Every subcommand in
src/commands.rscallsoutput::emit(mode, label, value)with the result, andsrc/output.rschooses betweenMode::JsonandMode::Human. But the global--humanflag only enables pretty-printing — it does not pretty-print JSON itself. Agents consuming JSON from stdout and humans debugging in a terminal both benefit from thejq-style indented variant.Scope
src/output.rs:Mode::JsonPrettyvariant.emit:Mode::Json→serde_json::to_string(value)(compact — existing behavior).Mode::JsonPretty→serde_json::to_string_pretty(value).Mode::Human→ existing pretty colored output.src/main.rs:--prettyglobal flag. Mutually exclusive with--human.--prettyis set, useMode::JsonPretty.--prettyexamples.Acceptance criteria
arbitrum-cli block latest→ single-line JSON (unchanged).arbitrum-cli block latest --pretty→ indented JSON.arbitrum-cli block latest --human→ colored table (unchanged).--human --prettyexits non-zero with a clear clap error.Reference:
src/output.rs::emitis 30 lines; PR #2 (feat: agent-deposit command + GitHub Actions CI) for CI/test expectations.Estimated effort
S (1–2 hours)
— kcolbchain / Abhishek Krishna