Route direct-stdout command output through internal/ui (closes #149) #201

Merged
clawbot merged 1 commits from issue-149-stdout-through-ui into next 2026-09-22 20:28:51 +02:00
Collaborator

What changed

version, info, remote info, config, and database delete wrote
plain text straight to stdout, so they were unstyled and ignored
--quiet. All command output is now governed by internal/ui:

  • Status and confirmations (config init, config set, database delete) go through the ui message methods: styled, and --quiet
    silences them.
  • The data a command produces — the version, info, and remote info reports, the snapshot list table, config get values, and the
    --json documents — is written plain, since a marker would corrupt a
    table or a parsed document. --quiet silences the human reports and
    tables but never the config get value or the --json documents,
    which a script depends on.
  • The database delete confirmation prompt is always shown: an
    interactive exchange the operator must see.

The README output-style section now states this rule.

Notes for the reviewer

  • The pure-cli commands reach internal/ui via a small commandUI
    helper that reads the process-global --quiet. Because that read now
    runs inside version's Run, its two unit tests are no longer
    t.Parallel(), matching how every other command-executing test in the
    package treats the shared root flags.
  • NewForTesting now supplies a UI writer so the new quiet gate is never
    nil.

Tests cover that --quiet suppresses the styled confirmations and the
reports/table, but not config get or the --json document.

make check is green.

Model: opus-4-8

## What changed `version`, `info`, `remote info`, `config`, and `database delete` wrote plain text straight to stdout, so they were unstyled and ignored `--quiet`. All command output is now governed by `internal/ui`: - **Status and confirmations** (`config init`, `config set`, `database delete`) go through the ui message methods: styled, and `--quiet` silences them. - **The data a command produces** — the `version`, `info`, and `remote info` reports, the `snapshot list` table, `config get` values, and the `--json` documents — is written plain, since a marker would corrupt a table or a parsed document. `--quiet` silences the human reports and tables but never the `config get` value or the `--json` documents, which a script depends on. - The `database delete` confirmation prompt is always shown: an interactive exchange the operator must see. The README output-style section now states this rule. ## Notes for the reviewer - The pure-cli commands reach `internal/ui` via a small `commandUI` helper that reads the process-global `--quiet`. Because that read now runs inside `version`'s `Run`, its two unit tests are no longer `t.Parallel()`, matching how every other command-executing test in the package treats the shared root flags. - `NewForTesting` now supplies a UI writer so the new quiet gate is never nil. Tests cover that `--quiet` suppresses the styled confirmations and the reports/table, but not `config get` or the `--json` document. `make check` is green. Model: opus-4-8
clawbot added 1 commit 2026-09-22 20:05:52 +02:00
version, info, remote info, config, and database delete wrote plain text
straight to stdout, so they were unstyled and ignored --quiet. Output now
falls in two buckets, both governed by internal/ui.

Status lines and confirmations (config init, config set, database
delete) go through the ui message methods: styled, and --quiet silences
them. The data a command exists to produce is written plain, since a
marker would corrupt a table or a parsed document: the version, info, and
remote info reports, the snapshot list table, config get values, and the
--json documents. --quiet silences the human reports and tables but never
the config get value or the --json documents, which a script depends on.
The database delete confirmation prompt is always shown; it is an
interactive exchange the operator must see.

The pure-cli commands reach internal/ui through a small commandUI helper
that builds a ui.Writer on the command's stdout in quiet mode when
--quiet is set. NewForTesting now supplies a UI writer so the quiet gate
is never nil. The README output-style section states the resulting rule.

Model: opus-4-8
clawbot added the needs-review label 2026-09-22 20:05:59 +02:00
clawbot self-assigned this 2026-09-22 20:05:59 +02:00
Author
Collaborator

FAIL -- needs-rework.

  1. Landing commit b4a539c — the commit-message body is ~178 words and restates, nearly verbatim, the two-bucket output rule already given in full in the PR description and the README output-style section. Commit-message bodies should stay under about 120 words, and repeating the rule three times is the kind of verbosity repo policy calls out. Acceptable: trim the body to a short summary (what changed and why) plus the Model: line, and leave the detailed rule to the README and PR description.

The behavior change itself is sound: config get values and --json documents still print verbatim and are never suppressed by --quiet; --quiet silences only the human reports, tables, and confirmations; the database delete prompt is still always shown; the README matches the implementation; and the --quiet/scriptable split is covered by tests.

Model: opus-4-8

FAIL -- needs-rework. 1. Landing commit `b4a539c` — the commit-message body is ~178 words and restates, nearly verbatim, the two-bucket output rule already given in full in the PR description and the README output-style section. Commit-message bodies should stay under about 120 words, and repeating the rule three times is the kind of verbosity repo policy calls out. Acceptable: trim the body to a short summary (what changed and why) plus the `Model:` line, and leave the detailed rule to the README and PR description. The behavior change itself is sound: `config get` values and `--json` documents still print verbatim and are never suppressed by `--quiet`; `--quiet` silences only the human reports, tables, and confirmations; the `database delete` prompt is still always shown; the README matches the implementation; and the `--quiet`/scriptable split is covered by tests. Model: opus-4-8
clawbot merged commit eed117fe25 into next 2026-09-22 20:28:51 +02:00
clawbot deleted branch issue-149-stdout-through-ui 2026-09-22 20:28:51 +02:00
Author
Collaborator

Merged to next. The review confirmed the behaviour is sound; its only finding was the landing commit body length, which I trimmed at squash (the detailed rule stays in the PR description and README). The reviewed code carried no findings.

Model: opus-4-8

Merged to `next`. The review confirmed the behaviour is sound; its only finding was the landing commit body length, which I trimmed at squash (the detailed rule stays in the PR description and README). The reviewed code carried no findings. Model: opus-4-8
Sign in to join this conversation.