Skip to content

Commit be417a6

Browse files
committed
feat: add cobra Example fields to all 115+ CLI commands
Every `ctx <command> --help` now shows practical usage examples. Expanded examples.yaml from 5 add-subtype entries to 136 keys, wired desc.Example() into all cmd.go files and parent.Cmd(), and added drift-prevention comments to YAML asset files. Changes: - examples.yaml: 136 command-keyed entries, add-subtypes namespaced under "add." prefix - parent.Cmd(): auto-loads Example from desc key - 115 cmd.go files + bootstrap root: Example field wired - ForType(): uses ExampleKeyPrefixAdd constant - TestExamplesYAMLLinkage: validates against desc key constants - commands.yaml, flags.yaml: update reminder comments Spec: specs/cli-examples.md Signed-off-by: Jose Alekhinne <jose@ctx.ist>
1 parent 033d7e8 commit be417a6

123 files changed

Lines changed: 1184 additions & 391 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.context/TASKS.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,21 @@ TASK STATUS LABELS:
6868

6969
### Phase -3: DevEx
7070

71-
- [ ] Plugin enablement gap: Ref:
71+
- [x] Plugin enablement gap: Ref:
7272
`ideas/plugin-enablement-gap.md`. Local-installed plugins get
7373
registered in `installed_plugins.json` but not auto-added to
7474
`enabledPlugins`, so slash commands are invisible in non-ctx
7575
projects.
7676

77-
- [ ] Add cobra Example fields to CLI commands via
77+
- [x] Add cobra Example fields to CLI commands via
7878
examples.yaml #added:2026-03-20-163413
7979

80+
- [ ] Add CLI YAML drift detection test: verify flag names in
81+
examples.yaml match actual registered flags, and Use: patterns
82+
in commands.yaml match Use constants. Structural linkage is
83+
already tested; this covers content-level drift. Semantic
84+
accuracy (does the description match behavior?) needs periodic
85+
LLM audit — not automatable. #priority:medium #added:2026-04-05
8086

8187
- [ ] Create ctx-docstrings skill: audit and fix docstrings
8288
against CONVENTIONS.md Documentation section. Skill loads

internal/assets/commands/commands.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
# Command descriptions for ctx CLI.
22
# Used by assets.CommandDesc() to populate cobra Short/Long fields.
33
# Keys use dot notation: parent.subcommand (e.g., pad.show)
4+
#
5+
# UPDATE THIS FILE when command behavior changes (new flags,
6+
# renamed subcommands, changed semantics). Short/Long text
7+
# appears in --help output and must stay accurate.
8+
#
9+
# See also: examples.yaml (Example fields), flags.yaml (flag descriptions).
410

511
add:
612
long: |-

0 commit comments

Comments
 (0)