Summary
The current console output is bare and uninformative. Lists show minimal info (e.g. bare #42: title (by user) with no state, labels, age, or assignees), mutation confirmations are plain text with inconsistent stdout/stderr targeting, and there is no structured output for scripting or agents.
Goals
- Tabular list output with aligned columns (ID, STATE, TITLE, LABELS, ASSIGNEE, AGE) via
comfy-table, with multi-line wrapping on narrow terminals - Colored mutation confirmations using checkmark/cross symbols (fancy mode) or ok:/error: (minimal mode), all to stderr
--jsonglobal flag for machine-readable output (raw Forgejo API JSON passthrough) to support agentic CLI usage- Consistent stdout/stderr convention: view/list data to stdout (pipeable), mutation confirmations and diagnostics to stderr
- Cross-platform (Linux and Windows)
Design
New src/output.rs module with generic helpers:
print_list<T: Serialize>()for tabular output with automatic --json supportprint_or_json<T: Serialize>()for view commandssuccess(),error(),info()for mutation confirmations to stderrrelative_time(),colored_state()for formatting
New dependency: comfy-table = "7" for table formatting.
All 10 command modules migrated one at a time (issues, prs, milestone, tag, release, repo, org, actions, auth/wiki/user).
Related upstream issues
- forgejo-contrib/forgejo-cli#112 - Better error printing (open)
- forgejo-contrib/forgejo-cli#189 - Optimizing output for non-terminal context / --styles minimal (open)
- forgejo-contrib/forgejo-cli#213 - Structured output / JSON (open)
- forgejo-contrib/forgejo-cli#260 - Agentic CLI patterns with --json, --yes, --verbose (closed, rejected)
## Summary
The current console output is bare and uninformative. Lists show minimal info (e.g. bare `#42: title (by user)` with no state, labels, age, or assignees), mutation confirmations are plain text with inconsistent stdout/stderr targeting, and there is no structured output for scripting or agents.
## Goals
- **Tabular list output** with aligned columns (ID, STATE, TITLE, LABELS, ASSIGNEE, AGE) via `comfy-table`, with multi-line wrapping on narrow terminals
- **Colored mutation confirmations** using checkmark/cross symbols (fancy mode) or ok:/error: (minimal mode), all to stderr
- **`--json` global flag** for machine-readable output (raw Forgejo API JSON passthrough) to support agentic CLI usage
- **Consistent stdout/stderr convention**: view/list data to stdout (pipeable), mutation confirmations and diagnostics to stderr
- **Cross-platform** (Linux and Windows)
## Design
New `src/output.rs` module with generic helpers:
- `print_list<T: Serialize>()` for tabular output with automatic --json support
- `print_or_json<T: Serialize>()` for view commands
- `success()`, `error()`, `info()` for mutation confirmations to stderr
- `relative_time()`, `colored_state()` for formatting
New dependency: `comfy-table = "7"` for table formatting.
All 10 command modules migrated one at a time (issues, prs, milestone, tag, release, repo, org, actions, auth/wiki/user).
## Related upstream issues
- forgejo-contrib/forgejo-cli#112 - Better error printing (open)
- forgejo-contrib/forgejo-cli#189 - Optimizing output for non-terminal context / --styles minimal (open)
- forgejo-contrib/forgejo-cli#213 - Structured output / JSON (open)
- forgejo-contrib/forgejo-cli#260 - Agentic CLI patterns with --json, --yes, --verbose (closed, rejected)