Route direct-stdout command output through internal/ui #149

Closed
opened 2026-09-21 22:03:28 +02:00 by clawbot · 1 comment
Collaborator

Split from #74 (documentation accuracy sweep, item 1). The README output-style section claimed all user-facing output goes through internal/ui. #74 narrowed that claim to match reality rather than doing this refactor, because routing these call sites through ui is a behavior change that affects --quiet.

These call sites write plain text directly to stdout, bypassing internal/ui, so they are unstyled, uncolored, and ignore w.Quiet():

  • internal/cli/version.go — all of version
  • internal/cli/config.go — config init/get/set output
  • internal/cli/database.go — database delete, including its interactive confirmation prompt
  • internal/vaultik/info.go via v.stdoutf (internal/vaultik/vaultik.go)
  • internal/vaultik/snapshot_list.go — the snapshot list table

Definition of done

Each emits through internal/ui, or a deliberate exception is recorded for output that must stay machine-plain and scriptable (for example config get values and the --json documents); --quiet is honored where it should be; the README output-style section is updated to state the resulting rule exactly; tests cover the --quiet behavior of the affected commands; make check green.

model: claude-opus-4-8

Split from https://git.eeqj.de/sneak/vaultik/issues/74 (documentation accuracy sweep, item 1). The README output-style section claimed all user-facing output goes through `internal/ui`. #74 narrowed that claim to match reality rather than doing this refactor, because routing these call sites through `ui` is a behavior change that affects `--quiet`. These call sites write plain text directly to stdout, bypassing `internal/ui`, so they are unstyled, uncolored, and ignore `w.Quiet()`: - `internal/cli/version.go` — all of `version` - `internal/cli/config.go` — `config init`/`get`/`set` output - `internal/cli/database.go` — `database delete`, including its interactive confirmation prompt - `internal/vaultik/info.go` via `v.stdoutf` (`internal/vaultik/vaultik.go`) - `internal/vaultik/snapshot_list.go` — the `snapshot list` table ## Definition of done Each emits through `internal/ui`, or a deliberate exception is recorded for output that must stay machine-plain and scriptable (for example `config get` values and the `--json` documents); `--quiet` is honored where it should be; the README output-style section is updated to state the resulting rule exactly; tests cover the `--quiet` behavior of the affected commands; `make check` green. model: claude-opus-4-8
Author
Collaborator

Implemented in #201.

All command output is now governed by internal/ui. Status lines and the config init/config set/database delete confirmations go through the ui message methods and are silenced by --quiet. The data a command exists to produce — the version, info, and remote info reports, the snapshot list table, config get values, and the --json documents — is written plain, because 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.

The README output-style section now states this rule, and tests cover the --quiet behavior of the affected commands.

Model: opus-4-8

Implemented in https://git.eeqj.de/sneak/vaultik/pulls/201. All command output is now governed by `internal/ui`. Status lines and the `config init`/`config set`/`database delete` confirmations go through the ui message methods and are silenced by `--quiet`. The data a command exists to produce — the `version`, `info`, and `remote info` reports, the `snapshot list` table, `config get` values, and the `--json` documents — is written plain, because 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. The README output-style section now states this rule, and tests cover the `--quiet` behavior of the affected commands. Model: opus-4-8
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/vaultik#149