@runa-cmd/help 0.2.0-beta.1 → 0.2.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,338 @@
1
+ # @runa-cmd/help
2
+
3
+ ## 0.2.0-beta.3
4
+
5
+ ### Minor Changes
6
+
7
+ - 1d071a9: Each package now ships its `CHANGELOG.md`, so you can read what changed from `node_modules`.
8
+ - 6ae4563: Completions now work the way they're suggested, with any text.
9
+
10
+ `eval "$(tool completions zsh)"` used to fail on every shell start. The script now registers itself with `compdef`, so it works in a `.zshrc` after `compinit`, as well as from a file in `fpath`.
11
+
12
+ In zsh, a `]` in a description used to end it early, and what followed was run as a command when pressing TAB, so `Mode [x]: fast` left the option without completion and could run `mode`. Brackets and colons are now escaped.
13
+
14
+ An enum value with a space, like `very slow`, used to be split in two candidates in bash, zsh and fish. It's now one.
15
+
16
+ CI runs the generated scripts in the real shells.
17
+
18
+ - eed18ff: A value in the config file now reaches one command, and nothing is ignored. A key used to apply to every option with that name: `{"force":true}` turned on `--force` in any command.
19
+
20
+ **Breaking:** the shape of the file changed. A key at the root is a global option or a command, and groups nest. With `runCLI`, options stay at the root.
21
+
22
+ **Migration:** move each option under its command.
23
+
24
+ ```json
25
+ // Before
26
+ { "force": true, "priority": "high" }
27
+
28
+ // After
29
+ { "clear": { "force": true }, "tag": { "add": { "priority": "high" } } }
30
+ ```
31
+
32
+ An unknown key now exits with 2, naming the file and the key, with a suggestion if there's a close one. `$schema` is accepted. An invalid value names the file and the key too, as in `notes.config.json: invalid value for 'list.priority'`, and broken JSON is reported as a problem of the file, not as an unexpected error.
33
+
34
+ A global option can't share a name with a command in a CLI with a config file: it fails at startup with `CONFIG_COLLISION`. Rename one.
35
+
36
+ Global options now read the config file. They used to ignore it without a word, even with a value of the wrong type, so a `store` in the file left the CLI writing somewhere else. They follow the same order as any option: CLI, env, config, default.
37
+
38
+ `meta.options.<key>.configurable: false` keeps an option out of the file, so a guardrail can't be turned off by a file in the current directory. `--mcp` uses it: only the terminal can start a server.
39
+
40
+ `api.getConfigValues(path)` returns the values of one command. `@runa-cmd/mcp` uses it, so a value only keeps the option of that tool away from the model.
41
+
42
+ - 8b3b8b4: A failed tool call now says what happened, not what to do. An expected `CommandError` used to tell the model "it may have taken effect. Check before retrying", even in a read-only tool, and `safeToRetry` said nothing about how often or when.
43
+
44
+ **Breaking:** `_meta['runa/error']` no longer has `safeToRetry`. It keeps `class` and `effect`.
45
+
46
+ The text only states facts: `The command did not run.`, `The command already ran.` or `The command did not finish.`. A `CommandError` reaches the model as you wrote it, with `effect: "unknown"`.
47
+
48
+ **Migration:** a client that read `safeToRetry` can read `effect`, where `none` means `run()` never started. To guide a model, say it in your error message. Retrying is up to you and whoever approves the calls: if a command fails partway, a model may run it again, so make that safe.
49
+
50
+ - ce76e51: The help of a command can now be copied and run. It used to show `USAGE deploy [options]`, without the CLI: now it's `tool deploy [options]`, in the built-in help and in the plugin. A variadic shows its dots, as in `<files...>`.
51
+
52
+ `styled()` and the help plugin no longer write escape codes to a pipe or with `NO_COLOR`. Colors were left out, but bold, dim, italic and underline weren't, so `tool --help > file` or `| less` got raw codes. Padding stays: it's layout.
53
+
54
+ `detectColorDepth(stream)` takes the stream to ask about, and the plugin asks about the one it writes to, which is stderr when there was nothing to run.
55
+
56
+ `CommandSchema.commandLine` says what a person types to run a command. It's set for help: `fullPath` doesn't change.
57
+
58
+ - 30e962f: A command now has one name, its key, written the same way everywhere. `meta.name` used to be required and do nothing in `defineCLI`: `commands: { withOutput }` ran as `withOutput`, whatever `meta.name` said.
59
+
60
+ **Breaking:** a key only takes lowercase letters, numbers and dashes, and anything else fails at startup with `INVALID_COMMAND_NAME`, saying the right form. `meta.name` has to match the key if you write it. An MCP tool takes the name of its command, so a renamed command is a renamed tool.
61
+
62
+ **Migration:** rename the keys that don't fit.
63
+
64
+ ```ts
65
+ // Before
66
+ commands: { withOutput }
67
+
68
+ // After
69
+ commands: { 'with-output': withOutput }
70
+ ```
71
+
72
+ `meta.name` is now optional in `defineCLI`, and `run()` and hooks still get `command.name`. `runCLI` requires it, because it names the CLI.
73
+
74
+ Options don't change: `run()` reads them by key, so `darkColor` is still `--dark-color`.
75
+
76
+ - d31ad33: A positional now gets the type of its schema. `args: { id: z.number() }` used to fail at the terminal with `expected number, received string`, although TypeScript said it was a number and it worked through MCP.
77
+
78
+ Numbers and booleans convert as in an option, in each item of a variadic too, and an empty string is still never read as 0. An invalid value says `Invalid value for <id>: expected number`.
79
+
80
+ **Migration:** if you used `z.coerce.number()` as a workaround, `z.number()` is enough now.
81
+
82
+ - f15d0cd: What a command returns now reaches the terminal. It used to reach MCP tools only, so at the terminal a command that returned data showed nothing and exited with 0.
83
+
84
+ A string goes to stdout as it is, and anything else as JSON. `run()` can return a value without `output`: this used to be a type error, even though it worked.
85
+
86
+ `format: (result) => string` says what a person reads. It receives the type of what `run()` returned, doesn't run for a tool, and gives the command a `--json` flag that prints the data. A command with `format` that returns nothing fails with `MISSING_RESULT`.
87
+
88
+ **Breaking:** a command that prints and also returns shows both. A command with `format` can't declare an option called `json`, and no global option can take that name while such a command exists.
89
+
90
+ **Migration:** move the printing to `format`, and delete your own `json` option.
91
+
92
+ ```ts
93
+ // Before
94
+ options: { json: z.boolean().default(false) },
95
+ run({ options }) {
96
+ const status = read();
97
+ console.log(options.json ? JSON.stringify(status) : `Port ${status.port}`);
98
+ return status;
99
+ },
100
+
101
+ // After
102
+ run: () => read(),
103
+ format: (status) => `Port ${status.port}`,
104
+ ```
105
+
106
+ Progress belongs on stderr, with `console.error`, so `--json` stays clean to pipe.
107
+
108
+ - 0b62ebb: `testCLI()`, from `@runa-cmd/core/testing`, runs a CLI or a command through its real lifecycle without ending the process. A failing command used to kill the test runner, and capturing its output took a page of patches.
109
+
110
+ It returns the exit code, stdout, stderr, what `run()` returned, the original error, and a `trace` of what happened: where each value came from, which hooks ran and for how long, and everything written, in order. It takes `env` and `config` instead of reading the machine, and several runs can share a process without mixing their output, with `node --test` and with Vitest. A value from env stays out of `trace`, because it can be a secret.
111
+
112
+ `RUNA_DEBUG=1` now shows those steps on stderr while they happen. It never prints a value.
113
+
114
+ - b7a504b: A flag where a command should be is now a usage error. `tool --bogus` used to say `Command not found: '--bogus'` and exit with 127.
115
+
116
+ **Breaking:** it now says `Unknown option: --bogus` and exits with 2, with the same suggestions as a flag after a command, so `--verison` points to `--version`. A script that checked for 127 here has to check for 2. An unknown command still exits with 127.
117
+
118
+ ## 0.2.0-beta.2
119
+
120
+ ### Minor Changes
121
+
122
+ - b158ee6: What's left after `--` is now a usage error, unless the command asks for it. `tool a -- b` used to ignore `b` with exit 0, so data got lost in silence. `--` still fills empty positionals.
123
+
124
+ **Breaking:** a command that reads `ctx.rest` has to declare `rest: true`. Without it, `ctx.rest` is empty and the extra tokens exit with 2 and `Unexpected positional argument`.
125
+
126
+ **Migration:** add `rest: true` to commands that wrap another program. If you validated `ctx.rest` by hand to reject extras, delete that code.
127
+
128
+ `meta.options.<key>.valueName` names the value in help: `valueName: 'hex'` shows `--color <hex>` instead of `--color <string>`. It works in the built-in help and in `@runa-cmd/help`.
129
+
130
+ Clearer errors for mistyped flags:
131
+
132
+ - `--no-color` on an unknown option now says `Unknown option: --no-color`, not `--color`.
133
+ - `--no-style` on an option that takes a value now says it can't be negated.
134
+ - A typo in `--help` or `--version` gets a suggestion, and so does `-V`, which points to `--version`.
135
+
136
+ ### Patch Changes
137
+
138
+ - 2d372e1: The built-in help no longer shows `(default: false)`, as `@runa-cmd/help` already didn't.
139
+
140
+ ## 0.2.0-beta.1
141
+
142
+ ### Minor Changes
143
+
144
+ - 1ddc91c: Boolean options now follow CLI > env > config > default.
145
+
146
+ - **Env and config are honored.** A boolean with `.default()` used to ignore both silently: `MINIFY=true` gave `false`. The schema default no longer reaches `parseArgs`, so it applies last.
147
+ - **Booleans accept `true`, `1`, `false` and `0`,** in any case, from every source. `MINIFY=true` on an optional boolean used to fail, and `--minify=false` used to exit 2.
148
+ - **Any other value is a usage error (exit 2).** Before, `MINIFY=quizas` on a boolean with a default was silently ignored.
149
+
150
+ **Migration:** an env var or config value that was being ignored now takes effect, and an invalid one now fails. Check the boolean options of your CLI that declare `env`.
151
+
152
+ - 763a1a2: Authors now choose what an MCP server exposes. `mcpPlugin({ exclude: ['deploy'] })` removes a tool, so it can't be listed or called. Per tool, `tools: { deploy: { description, annotations } }` replaces what the model reads and passes MCP annotations like `destructiveHint` to the client.
153
+
154
+ Annotations are hints, not access control: `exclude` is the only real boundary. An unknown name in `exclude`, an excluded tool with settings, or a tool both read-only and destructive stop the server at startup.
155
+
156
+ - edfb79e: Clearer usage errors, and an API where every field does something.
157
+
158
+ - **Missing values are reported as such.** `--label` without a value now says `Option --label requires a value`. `--tag --force` no longer takes `--force` as the value of `--tag`; it used to drop the flag silently.
159
+ - **Extra positionals on a command without args exit 2** instead of 1, with the usual message.
160
+ - **Suggestions scale with the input,** so `--nope` no longer suggests `--size`, while real typos still get one.
161
+ - **Shorter errors:** `Missing required argument: <content>`, without repeating the name or the description. The same goes for missing options.
162
+ - **Usage errors point to the next step** with `Run '<cli> --help' for usage.`
163
+ - **Invalid `output` names the command and the field** instead of dumping Zod's JSON. It uses the code `INVALID_OUTPUT`.
164
+ - **`deprecated` warns when the option is used,** from the CLI, env or config. The command still runs.
165
+ - **Help omits `[default: false]`.**
166
+
167
+ **Breaking changes in the API**
168
+
169
+ - **`hint` is gone** from `OptionMeta` and `OptionSchema`: it had no effect. Remove it from your `meta.options`.
170
+ - **`PluginMeta.version` is optional,** and the official plugins no longer declare it. Nothing reads it; use `peerDependencies` for compatibility.
171
+
172
+ **Migration:** a value that looks like a registered flag now needs the `=` form: `--label=--force`. If you match error text, note the shorter messages.
173
+
174
+ - ee5d2ef: An option that declares `env` never reaches an MCP tool's schema, even if the variable isn't set. A forgotten `API_TOKEN` no longer becomes a parameter a model can ask a person for: the call fails with the usual error.
175
+
176
+ **Migration:** to let the model choose an option that declares `env`, add it to `mcpPlugin({ tools: { deploy: { expose: ['env'] } } })`.
177
+
178
+ - 1ed131e: A failed MCP tool call now says what happened to the command's effects, so a model doesn't repeat what already ran. The text ends with that sentence, and `_meta['runa/error']` carries `{ class, effect, safeToRetry }`, where `effect` is `none`, `unknown` or `completed`. A command that fails partway reports `unknown`, and an invalid `output` reports that the command already ran.
179
+
180
+ Tool errors no longer include hints for people, like `RUNA_DEBUG` or `--help`, unless the operator sets `RUNA_DEBUG`. A call whose `run()` finished is now an error if the process exits with an error afterwards, and a skipped command reads `did not run` instead of `did not finish`.
181
+
182
+ - e367c5c: Cleanup always runs, and no failure exits silently.
183
+
184
+ - **`cleanup` runs on unhandled errors.** The `cleanup` hook and plugin `cleanup()` used to be skipped because `process.exit` ran first. They now finish, including async ones, before the process exits.
185
+ - **Every failure explains itself.** Typed errors (`RunaError` and subclasses) print as written. Any other error prints `Unexpected error in '<command>': <message>` and how to see more. An error without a message prints `'<command>' failed without an error message (<type>)` instead of nothing.
186
+ - **`RUNA_DEBUG=1`** adds the stack trace, error code and cause.
187
+ - **`ctx.handled` only controls the output.** Marking an error as handled used to exit 0, reporting a failure as success. The run now keeps the error's exit code. A plugin that truly recovered can set `process.exitCode = 0` in `onError`.
188
+
189
+ **Migration:** if your `onError` sets `ctx.handled = true` and your scripts rely on exit 0, set `process.exitCode = 0` there. If you match the exact text of an unexpected error on stderr, it now has a prefix.
190
+
191
+ - e92ca91: `--help` and `-h` now work with no plugin: `tool --help` and `tool db migrate --help` show plain help, with the global options that work on that command. Help and completions list `--help`, and `--version` when the CLI has a version. Usage errors always end with `Run '<cli> --help' for usage.`
192
+
193
+ A command that declares `-h` or `--help` keeps it, and the CLI starts, with or without `@runa-cmd/help`. Each flag yields separately, so `--help` still shows help on a command that took `-h`.
194
+
195
+ `getSchema()` now includes `help`, and `version` when the CLI has one, in `globalOptions`.
196
+
197
+ **Migration:** `helpPlugin` no longer registers a `help` global option, so `ctx.globalOptions.help` is gone: a plugin that read it to show its own help now uses `api.replaceHelp(show)`, with the `replaceHelp` capability. `@runa-cmd/help` no longer has `zod` as a peer dependency.
198
+
199
+ - 4d81cd4: Hooks can tell where a run comes from: `ctx.invocation` is `{ surface: 'cli' }`, or `{ surface: 'tool', tool }` for a tool call. Selecting the command and its values is now separate from running it, which doesn't change how a CLI behaves.
200
+ - 9040481: Option keys in camelCase now become kebab-case flags: `darkColor` is `--dark-color`, and `outputURL` is `--output-url`. `run()`, config files and MCP tools keep the key. A key with hyphens stays as written. Help, errors and completions show the flag, which `getSchema()` exposes in the new `flag` field of each option.
201
+
202
+ **Breaking:** `--darkColor` no longer works: it's a usage error that points to `--dark-color`. Scripts that use the camelCase form need the new one.
203
+
204
+ A boolean named `noCache` now stops the CLI at startup, because `--no-cache` already negates `cache`. Two keys that give the same flag do too.
205
+
206
+ **Migration:** rename a boolean like `noCache: z.boolean().default(false)` to `cache: z.boolean().default(true)`. Code that builds an `OptionSchema` by hand now has to include `flag`.
207
+
208
+ - 5a40030: **Upgrading from `0.2.0-beta.0`.** Update all four packages together: `help`, `mcp` and `completions` now require this version of `core`, and npm refuses an older one.
209
+
210
+ **What people typing your CLI will notice**
211
+
212
+ | Before | Now | What to do |
213
+ | ---------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------- |
214
+ | `--darkColor` for a key `darkColor` | `--dark-color`; the camelCase form is a usage error that points to it | Update scripts and docs |
215
+ | Ctrl+C ended the process at once, with no `cleanup` | Runs `cleanup` and exits with 130; `SIGTERM` exits with 143. A command that ignores `signal` is waited for 2 seconds, and a second Ctrl+C leaves at once | Pass `signal` to what your command starts |
216
+ | `tool` with no command, or `tool db` on a group, exited with 127 | Help on stderr, exit 2 | Check scripts that compare the exit code |
217
+ | `--tag --force` took `--force` as the value of `--tag` | `Option --tag requires a value` | Use `--tag=--force` for that value |
218
+ | An extra positional on a command without args exited with 1 | Exit 2 | Check scripts that compare the exit code |
219
+ | Exact text of usage errors | Shorter, and they end with `Run '<cli> --help' for usage.` | Update anything that matches this text |
220
+
221
+ **What you need to change in your code**
222
+
223
+ | Before | Now | What to do |
224
+ | ------------------------------------------------------------------------ | ------------------------------------------------- | ------------------------------------------------------------- |
225
+ | `runCLI(cmd, argv)` | `runCLI(cmd, { argv })` | Change the call |
226
+ | A boolean named `noCache` | The CLI stops at startup | Declare `cache: z.boolean().default(true)` |
227
+ | `hint` in `meta.options` | Removed: it had no effect | Delete it |
228
+ | `ctx.globalOptions.help` | Gone: `helpPlugin` no longer adds a global option | Use `api.replaceHelp(show)` with the `replaceHelp` capability |
229
+ | `RunContext`, `HookContext` or `OptionSchema` built by hand, as in tests | They now require `signal`, and `flag` | Add them |
230
+ | `onError` with `ctx.handled = true` exited with 0 | Keeps the error's exit code | Set `process.exitCode = 0` if the plugin truly recovered |
231
+ | `defineCLI` with a single command | Still works, and warns once | Move to `runCLI`: it will be removed before 1.0 |
232
+
233
+ **Values that used to be ignored**
234
+
235
+ | Before | Now | What to do |
236
+ | -------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------ |
237
+ | A boolean with `.default()` ignored env and config | They take effect, and an invalid value exits with 2 | Check boolean options that declare `env` |
238
+ | `exec [target] -- ls -la` left `ls` in `ctx.rest` | `ls` fills `target`, and what's left goes to `ctx.rest` | Don't declare a positional for a wrapped command |
239
+ | `z.array()` options always failed | They repeat, and env splits by commas | Nothing, unless a value in env has a comma |
240
+
241
+ **If you expose your CLI over MCP**
242
+
243
+ | Before | Now | What to do |
244
+ | --------------------------------------- | ----------------------------------------------------------------------------- | -------------------------------------------------------------------- |
245
+ | Tools ran inside the server | Each call runs your CLI as a new process, about 140 ms in a minimal CLI | Don't count on state between calls |
246
+ | Options with `env` were tool parameters | They never reach the schema | Use `tools.<name>.expose` for those the model should choose |
247
+ | Output had no limit | 100 KiB by default, and a larger returned value fails with `output_too_large` | Set `maxOutput` if you need more |
248
+ | Every command was a tool | Still the default, now with `exclude` | Review which commands an agent should have, plugin commands included |
249
+
250
+ - 8030fbb: With nothing to run, a CLI now shows help on stderr and exits with 2, instead of failing with 127. That covers `tool` on a CLI with several commands, and `tool db` on a group. A name that doesn't exist is still a 127, with its suggestion.
251
+
252
+ Help now uses the same routing as running a command, so what it shows can't differ from what would run. `defineCLI` with a single command shows that command's help, and `--help` and `--version` work even if a required global option is missing.
253
+
254
+ A process stopped by a signal now exits with 130 or 143 also when the lifecycle ended early, as an MCP server does.
255
+
256
+ **Migration:** `api.replaceHelp` handlers receive a second argument, the stream to write to. Write there instead of to `process.stdout`.
257
+
258
+ - 03f4e76: In MCP, whoever starts the server beats the model.
259
+
260
+ - **Fixed values leave the tool's schema.** An option with a value from an env var or the config file is hidden, and if a model sends it anyway, it's dropped. A required option that already has a value no longer asks the model for anything.
261
+ - **`mcpPlugin({ tools })` adjusts this per tool:** `expose` leaves an option to the model, and `serverOnly` makes the server refuse to start without a value.
262
+ - **Fixed values are redacted** from the stdout and stderr returned to the model, when they have 8 characters or more. So are the global options the server started with. What `run()` returns is left as it is.
263
+ - **`api.getConfigValues()`** lets a plugin read the config file of the CLI.
264
+
265
+ **Migration:** an option an agent used to set may disappear from its tool if env or config give it a value. Use `tools.<name>.expose` to keep it.
266
+
267
+ - 1b0d6c1: `z.array()` options now work: `--tag a --tag b` gives `['a', 'b']`, and each element is converted to its type, so `z.array(z.number())` gives numbers. Before, they always failed, even with one value.
268
+
269
+ Env values are split by commas and trimmed, so `TAGS=a, b` gives `['a', 'b']` and `TAGS=` gives `[]`. Config files use a JSON array. Each source replaces the ones below it, without adding up.
270
+
271
+ Help shows `--tag <string>...`. zsh keeps offering the option, fish says it can be repeated, and bash and fish offer the values of a `z.array(z.enum(...))`. `getSchema()` adds `itemType` to these options.
272
+
273
+ - 81ac2d6: A CLI made of one command is now first class, with `--version` and a POSIX `--`.
274
+
275
+ - **`runCLI(command, options?)` takes plugins,** plus `middleware`, `config`, `globalOptions`, `globalMeta` and `strictOptions`. Help, MCP and completions all work with it.
276
+ - **`runCLI` runs in an explicit root mode.** A value equal to the command name is data: `tool tool` passes `"tool"`. A subcommand added by a plugin routes by name, and `--` passes that name as data.
277
+ - **`--version` is built in** when `meta.version` is set, in `defineCLI` and `runCLI`. It has no short alias, and a command's own `--version` option wins.
278
+ - **`--` fills empty positionals,** as POSIX operands. A variadic counts as one, and what's left goes to `ctx.rest`.
279
+ - **`defineCLI` with one command is deprecated** when it routes implicitly. It keeps working and warns once. It will be removed before 1.0.
280
+
281
+ `CLISchema` gains an optional `root`, and `RunCLIOptions` is exported.
282
+
283
+ **Migration:**
284
+
285
+ - `runCLI(cmd, argv)` is now `runCLI(cmd, { argv })`.
286
+ - With `exec [target] -- ls -la`, `ls` now fills `target`. Commands that wrap another one should declare no positional for it, or read it from `ctx.rest`.
287
+ - With a variadic and nothing before `--`, as in `lint -- --fix`, the token now lands in the variadic instead of `ctx.rest`.
288
+
289
+ - 374b25f: Stopping a run now reaches everything it started. `run()` and hooks receive `signal`, an `AbortSignal` that fires on `SIGINT`, `SIGTERM` or a cancelled tool. `cleanup` runs in all those cases, and a CLI exits with 130 or 143.
290
+
291
+ **Behavior change:** Ctrl+C no longer ends a CLI at once. A command that ignores `signal` stops being waited for after 2 seconds, the process ends after 5 at most, and a second Ctrl+C leaves at once. A command that blocks the event loop can't react until it yields: `Ctrl+\` still ends it.
292
+
293
+ **Migration:** code that builds a `RunContext` or a `HookContext` by hand, as in unit tests, now has to include `signal`.
294
+
295
+ In MCP, cancelling a call or closing the server ends the child and what it started, and a child stops by itself if the server dies. Tool output is limited to 100 KiB by default: longer output keeps its start and end with a notice, and `maxOutput` changes the limit globally or per tool. A returned value over the limit fails with `output_too_large`.
296
+
297
+ - 25ce70b: MCP tools now run as a child process of your own CLI, so a tool is the same command a person runs.
298
+
299
+ - **The whole lifecycle applies:** env vars, config files, startup global options, hooks and middleware. A middleware can reject a call.
300
+ - **Commands can print.** What they write no longer reaches the protocol. A returned value is the result, and without one, stdout is.
301
+ - **Calls are isolated.** Simultaneous calls don't mix, and a `process.exit` in a command only ends that call.
302
+ - **No false success.** If a command never finished, as when a middleware skips it, the tool returns an error.
303
+ - **Any input travels intact,** including arrays, objects and large values, and validation runs once, in the same place as the CLI.
304
+ - **`cleanup` runs when the server closes,** not before the first call.
305
+ - **The server checks at startup that it can run itself.** `mcpPlugin({ selfCommand })` sets how, if the check fails.
306
+
307
+ **Migration:** each call is a new process, so don't count on state shared between calls. A call now takes about 140 ms in a minimal CLI, plus whatever your CLI takes to start. `exports` of `@runa-cmd/core` gains `./internal`, which is not public API.
308
+
309
+ ## 0.2.0-beta.0
310
+
311
+ ### Minor Changes
312
+
313
+ - 5f03fdf: Production hardening for the first beta. Five behavior changes, one platform change, and a set of additive APIs. Read the migration notes — two of the changes can turn previously-silent misbehavior into hard errors.
314
+
315
+ **Behavior changes (migration guidance included)**
316
+
317
+ 1. **Unknown options are now rejected (exit 2)** — previously a typo'd flag (`--forse`) was silently ignored. Parsing now fails with `Unknown option: --forse` plus a did-you-mean suggestion when a defined flag is within edit distance 3. Escape hatch: `defineCLI({ ..., strictOptions: false })` restores the old lenient behavior one line at a time while you fix call sites.
318
+
319
+ 2. **Empty-string values for number options are now rejected (exit 2)** — previously `--port ""`, an empty env var, or an empty config value coerced to `0` (`Number('') === 0`). All three resolution sources (CLI arg, env var, config file) now fail with `Invalid value for --port: expected number`. No escape hatch: the old behavior fabricated data. A legitimate `0` (e.g. `--port 0` or a config number `0`) still passes.
320
+
321
+ 3. **`helpPlugin()` no longer calls `process.exit(0)`** — after rendering help it short-circuits the lifecycle and lets the process exit naturally with code 0. Terminal users see no difference; embedders (tests, MCP hosts, programmatic `cli.run()` callers) now get the promise resolved and cleanup hooks always run. Restore the old forced exit with `helpPlugin({ exitOnHelp: true })`.
322
+
323
+ 4. **Tokens after `--` are no longer positionals** — everything after the first standalone `--` is delivered verbatim in the new `ctx.rest: string[]` (empty array when no `--` is present), unvalidated and exempt from strict option checking. Global flags after `--` are no longer intercepted (`mycli exec -- --help` runs `exec` instead of rendering help). CLIs that accidentally relied on post-`--` tokens filling schema-validated positionals must drop the `--`.
324
+
325
+ 5. **Global/command option collisions now throw at startup** — if a plugin-registered (or statically declared) global option's name or alias overlaps any command's option name or alias, `cli.run()` fails fast with a `RunaError` (code `OPTION_COLLISION`, exit 1) naming the option, the plugin, and the command — previously the global extractor silently stole the token. Fix: rename one of the two options or drop the conflicting alias.
326
+
327
+ **Platform change**
328
+
329
+ 6. **Node >= 24 required** — `engines` is now `">=24.0.0"` across all packages. Node 18, 20, and 22 are dropped: 18 and 20 are end-of-life, and the toolchain floor (vitest 4) cannot even test them. CI runs the full suite on Linux and Windows under Node 24.
330
+
331
+ **Additive API surface**
332
+
333
+ - `ctx.rest: string[]` on `RunContext` — pass-through tokens after `--`.
334
+ - `CLIConfig.strictOptions?: boolean` (default `true`) — the rollback hatch for change 1.
335
+ - `HelpPluginOptions.exitOnHelp?: boolean` (default `false`) — the rollback hatch for change 3.
336
+ - `SchemaAdapter` / `SchemaDescription` exported as types from `@runa-cmd/core` — Zod v4 introspection is now confined behind an adapter seam (internal refactor, no public behavior change).
337
+ - `OPTION_COLLISION` error code on `RunaError` (change 5).
338
+ - Failures inside `onError` and `cleanup` hook handlers are now logged to stderr (`runa: onError handler threw: ...`) instead of being silently swallowed; the original error still drives the exit code and cleanup still runs.
@@ -17,7 +17,7 @@ import type { ColorDepth, RenderContext } from '../types.js';
17
17
  * 6. process.stdout.hasColors(16) → '16'
18
18
  * 7. fallback → 'none'
19
19
  */
20
- export declare function detectColorDepth(): ColorDepth;
20
+ export declare function detectColorDepth(stream?: NodeJS.WriteStream): ColorDepth;
21
21
  /**
22
22
  * Detect terminal width in columns.
23
23
  * Falls back to 80 if unavailable (e.g. piped output).
@@ -1 +1 @@
1
- {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/ansi/detect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,IAAI,UAAU,CAyC7C;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAMD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAQhD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
1
+ {"version":3,"file":"detect.d.ts","sourceRoot":"","sources":["../../src/ansi/detect.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,GAAE,MAAM,CAAC,WAA4B,GAAG,UAAU,CAyCxF;AAED;;;GAGG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAMD;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAQhD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC"}
@@ -10,7 +10,7 @@
10
10
  * 6. process.stdout.hasColors(16) → '16'
11
11
  * 7. fallback → 'none'
12
12
  */
13
- export function detectColorDepth() {
13
+ export function detectColorDepth(stream = process.stdout) {
14
14
  const env = process.env;
15
15
  // NO_COLOR takes absolute priority (https://no-color.org/)
16
16
  if (env.NO_COLOR !== undefined) {
@@ -26,7 +26,7 @@ export function detectColorDepth() {
26
26
  return '16';
27
27
  }
28
28
  // Non-TTY (piped) → no color unless FORCE_COLOR was set (handled above)
29
- if (!process.stdout.isTTY) {
29
+ if (!stream.isTTY) {
30
30
  return 'none';
31
31
  }
32
32
  // COLORTERM for truecolor detection
@@ -39,13 +39,13 @@ export function detectColorDepth() {
39
39
  if (term?.includes('256color')) {
40
40
  return '256';
41
41
  }
42
- // process.stdout.hasColors() as additional signal
43
- if (typeof process.stdout.hasColors === 'function') {
44
- if (process.stdout.hasColors(16_777_216))
42
+ // hasColors() as additional signal
43
+ if (typeof stream.hasColors === 'function') {
44
+ if (stream.hasColors(16_777_216))
45
45
  return 'truecolor';
46
- if (process.stdout.hasColors(256))
46
+ if (stream.hasColors(256))
47
47
  return '256';
48
- if (process.stdout.hasColors(16))
48
+ if (stream.hasColors(16))
49
49
  return '16';
50
50
  }
51
51
  return 'none';
@@ -1 +1 @@
1
- {"version":3,"file":"detect.js","sourceRoot":"","sources":["../../src/ansi/detect.ts"],"names":[],"mappings":"AAQA;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,gBAAgB;IAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;IAExB,2DAA2D;IAC3D,IAAI,GAAG,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,MAAM,CAAC;IACf,CAAC;IAED,iEAAiE;IACjE,MAAM,UAAU,GAAG,GAAG,CAAC,WAAW,CAAC;IACnC,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC9B,IAAI,UAAU,KAAK,GAAG;YAAE,OAAO,WAAW,CAAC;QAC3C,IAAI,UAAU,KAAK,GAAG;YAAE,OAAO,KAAK,CAAC;QACrC,OAAO,IAAI,CAAC;IACb,CAAC;IAED,wEAAwE;IACxE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QAC3B,OAAO,MAAM,CAAC;IACf,CAAC;IAED,oCAAoC;IACpC,MAAM,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IAChC,IAAI,SAAS,KAAK,WAAW,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QACxD,OAAO,WAAW,CAAC;IACpB,CAAC;IAED,+BAA+B;IAC/B,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;IACtB,IAAI,IAAI,EAAE,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACd,CAAC;IAED,kDAAkD;IAClD,IAAI,OAAO,OAAO,CAAC,MAAM,CAAC,SAAS,KAAK,UAAU,EAAE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BAAkB;IACjC,OAAO,GAAG,SAAS,CAAC;AACrB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAE,iBAAsB,GAAG,YAAY,CA4BrE"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAKnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,GAAE,iBAAsB,GAAG,YAAY,CAgCrE"}
package/dist/plugin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { definePlugin } from '@runa-cmd/core';
2
- import { getRenderContext } from './ansi/detect.js';
2
+ import { detectColorDepth, getRenderContext } from './ansi/detect.js';
3
3
  import { defaultRenderer } from './render.js';
4
4
  import { resolveTheme } from './theme.js';
5
5
  /**
@@ -18,7 +18,11 @@ export function helpPlugin(opts = {}) {
18
18
  // Core decides when help runs and what it's about, and yields if a
19
19
  // command declares --help or -h: only the rendering is left here.
20
20
  api.replaceHelp((target, output) => {
21
- const renderCtx = getRenderContext();
21
+ // With nothing to run, help goes to stderr: that's the one to ask about
22
+ const renderCtx = {
23
+ ...getRenderContext(),
24
+ colorDepth: detectColorDepth(output),
25
+ };
22
26
  const renderer = opts.render ?? defaultRenderer;
23
27
  const rendered = renderer({
24
28
  schema: target,
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"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M,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,aAAkB,EAAE,GAAG,CAAC,EAAE,aAAa,GAAG,KAAK,CAuCzF"}
@@ -17,20 +17,23 @@ import { downsampleColor } from '../ansi/downsample.js';
17
17
  export function styled(text, opts = {}, ctx) {
18
18
  const renderCtx = ctx ?? getRenderContext();
19
19
  let result = text;
20
- // Apply color first (innermost)
21
- if (opts.color) {
22
- const ansiColor = downsampleColor(opts.color, renderCtx.colorDepth);
23
- result = fg(result, ansiColor);
20
+ // A pipe or NO_COLOR rules out every escape code, not only the colors
21
+ if (renderCtx.colorDepth !== 'none') {
22
+ // Apply color first (innermost)
23
+ if (opts.color) {
24
+ const ansiColor = downsampleColor(opts.color, renderCtx.colorDepth);
25
+ result = fg(result, ansiColor);
26
+ }
27
+ // Apply styles in consistent order: bold → dim → italic → underline
28
+ if (opts.bold)
29
+ result = bold(result);
30
+ if (opts.dim)
31
+ result = dim(result);
32
+ if (opts.italic)
33
+ result = italic(result);
34
+ if (opts.underline)
35
+ result = underline(result);
24
36
  }
25
- // Apply styles in consistent order: bold → dim → italic → underline
26
- if (opts.bold)
27
- result = bold(result);
28
- if (opts.dim)
29
- result = dim(result);
30
- if (opts.italic)
31
- result = italic(result);
32
- if (opts.underline)
33
- result = underline(result);
34
37
  // Apply padding
35
38
  if (opts.padding) {
36
39
  const [top, right, bottom, left] = normalizePadding(opts.padding);
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","sourceRoot":"","sources":["../../src/primitives/styled.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAsBxD;;;;;;GAMG;AACH,MAAM,UAAU,MAAM,CAAC,IAAY,EAAE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,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC;QACjD,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACxC,MAAM,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC9D,MAAM,WAAW,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAEpE,MAAM,GAAG,CAAC,GAAG,QAAQ,EAAE,GAAG,WAAW,EAAE,GAAG,WAAW,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAED,+DAA+D;AAE/D,SAAS,gBAAgB,CACxB,OAA4D;IAE5D,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,OAAO,CAAC;IAChB,CAAC;IACD,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC;IACvB,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACrB,CAAC"}
package/dist/render.js CHANGED
@@ -64,7 +64,7 @@ function renderCLI(cli, theme, ctx) {
64
64
  function renderCommand(cmd, theme, ctx) {
65
65
  const sections = [];
66
66
  // Header
67
- const cmdPath = cmd.fullPath.join(' ');
67
+ const cmdPath = (cmd.commandLine ?? cmd.fullPath).join(' ');
68
68
  sections.push(styled(cmdPath, { bold: true }, ctx));
69
69
  if (cmd.description) {
70
70
  sections.push(styled(cmd.description, { dim: true }, ctx));
@@ -75,7 +75,8 @@ function renderCommand(cmd, theme, ctx) {
75
75
  usageParts.push('<command>');
76
76
  if (cmd.args.length > 0) {
77
77
  for (const arg of cmd.args) {
78
- usageParts.push(arg.required ? `<${arg.name}>` : `[${arg.name}]`);
78
+ const label = arg.isVariadic ? `${arg.name}...` : arg.name;
79
+ usageParts.push(arg.required ? `<${label}>` : `[${label}]`);
79
80
  }
80
81
  }
81
82
  usageParts.push('[options]');
@@ -160,7 +161,10 @@ function renderOptionRow(opt, theme, ctx) {
160
161
  // Type column
161
162
  const typeParts = [];
162
163
  const repeats = opt.type === 'array' ? '...' : '';
163
- if (opt.enumValues) {
164
+ if (opt.valueName) {
165
+ typeParts.push(`${opt.valueName}${repeats}`);
166
+ }
167
+ else if (opt.enumValues) {
164
168
  typeParts.push(`${opt.enumValues.join(' | ')}${repeats}`);
165
169
  }
166
170
  else if (opt.type !== 'boolean') {
@@ -206,7 +210,9 @@ function renderArgRow(arg, theme, ctx) {
206
210
  return [nameStr, typeStr, descParts.join(' ')];
207
211
  }
208
212
  // ─── Helpers ────────────────────────────────────────────────
209
- function sectionTitle(title, theme, _ctx) {
213
+ function sectionTitle(title, theme, ctx) {
214
+ if (ctx.colorDepth === 'none')
215
+ return title;
210
216
  // theme colors are already ANSI-resolved, so use fg() directly (not styled.color which re-downsamples)
211
217
  return ansiBold(fg(title, theme.primary));
212
218
  }
@@ -1 +1 @@
1
- {"version":3,"file":"render.js","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,IAAI,IAAI,QAAQ,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAG9C;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,GAAgB;IAC/C,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC;IAC9B,MAAM,SAAS,GAAkB,EAAE,UAAU,EAAE,GAAG,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,C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C,GAAG,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAE3E,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAChD,CAAC;AAED,+DAA+D;AAE/D,SAAS,YAAY,CAAC,KAAa,EAAE,KAAoB,EAAE,GAAkB;IAC5E,IAAI,GAAG,CAAC,UAAU,KAAK,MAAM;QAAE,OAAO,KAAK,CAAC;IAC5C,uGAAuG;IACvG,OAAO,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC3C,CAAC;AAED,SAAS,MAAM,CAAC,KAAY,EAAE,MAAM,GAAG,CAAC;IACvC,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClC,OAAO,KAAK;SACV,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,CAAC;SACjC,IAAI,CAAC,IAAI,CAAC,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@runa-cmd/help",
3
- "version": "0.2.0-beta.1",
3
+ "version": "0.2.0-beta.3",
4
4
  "description": "Themeable help output for Runa CLIs with composable layout primitives.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -41,13 +41,14 @@
41
41
  },
42
42
  "files": [
43
43
  "dist",
44
- "README.md"
44
+ "README.md",
45
+ "CHANGELOG.md"
45
46
  ],
46
47
  "devDependencies": {
47
48
  "@types/node": "^25.6.0",
48
49
  "typescript": "^6.0.2",
49
50
  "zod": "^4.3.6",
50
- "@runa-cmd/core": "0.2.0-beta.1"
51
+ "@runa-cmd/core": "0.2.0-beta.3"
51
52
  },
52
53
  "scripts": {
53
54
  "build": "tsc",