Skip to content

cli: add Cobra Example blocks and tighten flag descriptions#45

Merged
dcmcand merged 1 commit into
mainfrom
issue-44-cobra-metadata
Apr 16, 2026
Merged

cli: add Cobra Example blocks and tighten flag descriptions#45
dcmcand merged 1 commit into
mainfrom
issue-44-cobra-metadata

Conversation

@dcmcand

@dcmcand dcmcand commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add `cmd.Example` to every leaf command in `cli/cmd/` so the auto-generated reference at https://skillsctl.dev/cli/reference/ has concrete invocations alongside the flag tables.
  • Add `cmd.Long` to the root command and to install / publish / auth login / config, where the name alone doesn't convey what the command does. Skipped commands where Short already says everything (e.g. `auth status`, `config get`).
  • Tighten flag descriptions where the expected format was implicit: `--digest` now names the `sha256:` form, publish's `--name` / `--version` / `--description` / `--dir` describe their constraints, root's `--api-url` notes precedence.
  • No behavior changes; metadata only.

The architecture review on #43 deliberately kept the generated reference terse-but-exhaustive while hand-written pages under `docs/site/content/cli/*.md` carry narrative. This PR fills out the reference within that boundary - examples and short Longs, not duplicated prose.

Closes #44.

Test plan

  • `go build ./...` clean
  • `go test ./... -race` passes
  • `golangci-lint run ./...` clean
  • `go run ./tools/docs-gen -o /tmp/cli-ref-44` produces the new Examples sections (verified `skillsctl_install.md`)
  • Verify https://skillsctl.dev/cli/reference/skillsctl_install/ shows the examples after merge

The auto-generated CLI reference now lives at https://skillsctl.dev/cli/reference/
but inherited terse Short descriptions and no Examples from the
original Cobra wiring. Add Example to every leaf command, add Long
where the command name is not self-evident (root, install, publish,
auth login, config), and clarify flag descriptions that left the
expected format implicit (--digest's sha256: form, --name/--version
constraints on publish, --api-url precedence on root).

No behavior changes; metadata only. Test suite and golangci-lint pass.

Closes #44
@dcmcand dcmcand merged commit fb672a2 into main Apr 16, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: add Cobra Example blocks and tighten flag descriptions

1 participant