stalecontext/forgejo-cli-plus
2
4
Fork
You've already forked forgejo-cli-plus
1

Console output overhaul: tabular lists, colored confirmations, --json mode #18

Closed
opened 2026年03月15日 19:21:53 +01:00 by stalecontext · 0 comments

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).

## 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)
stalecontext 2026年03月16日 18:16:29 +01:00
Sign in to join this conversation.
No Branch/Tag specified
main
feature/issue-batch-2026-07
upstream-sync/2026-07-02
feat/repo-create-org
projects
v2.0.0
upstream-reviewed/2026-07-02
v1.1.0
upstream-reviewed/2026-03-31
v1.0.0
upstream-reviewed/2026-03-16
v0.4.0
v0.3.0
v0.2.0
v0.1.1
v0.1.0
v0.0.4
v0.0.3
v0.0.2
v0.0.1
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
stalecontext/forgejo-cli-plus#18
Reference in a new issue
stalecontext/forgejo-cli-plus
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?