You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4abcdec
Browse filesBrowse the repository at this point in the historyBrowse files
feat(help): moshscript verbs, terminal manners, and completable topics (#263)
The tail of PRD 0006 — R14, R15, R16.
R14. `moshcode help ask` answered "no help for ask". `ask()` is as much
part of the interface as `moshcode prd`, but the vocabulary lives in a
registry help had never been introduced to. Verbs now carry an optional
`usage` — `ai(prompt, { engine })`, `ask(...prompt)` — and help renders it
with the summary and a note that this one is called from a .mosh file, not
a shell. `usage` stays optional, so a verb registered by a host that has
not declared one still renders as `name(…)`.
cliVerb() derives its own signature rather than repeating it twenty times:
every CLI verb forwards its arguments to `moshcode <name>`, so adding a
line to the vocabulary documents it.
R15 turned out to be already true and is now nailed down. src/ui.mjs
gates colour on `NO_COLOR == null && process.stdout.isTTY`, so both the CLI
and the pit already emit plain text to a pipe. Three tests keep it that
way, including one for the pit — which needs spawnSync rather than the
execFile helper the rest of the file uses, because the pit reads stdin and
execFile has no way to supply it. Nothing paginates.
R16. `moshcode help <tab>` now completes topics, in all four shells. The
list is what help itself accepts — commands, engines, tools and moshscript
verbs — so tab-completion and help cannot disagree about what is
answerable. A test asserts exactly that: every offered topic resolves.
1099 tests, 887 pass, 0 fail.
That closes PRD 0006. R1–R16 are implemented across #257, #258, #260 and
this.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
0 commit comments