Skip to content

The shared version command renders text; -o yaml prints Version: lines instead of a result #795

Closed

Description

@David-Noble-at-work

Feature: #832 — The shared root: one root, the common set, and its enforcement

cli.NewVersionCmd writes Version:, Commit:, Built:, Go version:, OS/Arch: lines to
cmd.OutOrStdout() (cmd/internal/cli/version.go:61). On every program -o yaml and -o json print the same
five lines, because nothing goes through the pipeline. Observed 2026-09-04 on star version -o yaml and
writ version -o yaml.

The version is a result: a record {version, commit, built, go, os, arch} emitted through cli.Emit, so
-o json serves a script, -o yaml reads by eye, and -o value gives the five values. The --version flag
keeps its one-line form, which is cobra's and not a result.

Acceptance

  • version emits the record through cli.Emit; -o json parses; asserted on the shared root
  • the no-direct-stdout walk, once it traces OutOrStdout(), is green on version.go

Found alongside the walk gap. Its own worktree, or with the walk fix.

Metadata

Metadata

Labels

Area:CLICommand-line interfaceEpic:CommandLineOne output convention across every CLI in the suitebugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions