@wirecat/cli-base 0.82.0 → 0.83.1
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 +22 -0
- package/dist/dev/land.js +4 -1
- package/dist/standards/flags-what.js +8 -0
- package/docs/standards/new-cli.md +14 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -8,6 +8,28 @@ Versions before 0.8.0 are in the [git tags](https://github.com/WireCatLabs/cli-b
|
|
|
8
8
|
Every entry says what changed as a caller sees it, why, and what to watch for — the rules are
|
|
9
9
|
[`docs/dev/CONVENTIONS.md`](docs/dev/CONVENTIONS.md#the-changelog).
|
|
10
10
|
|
|
11
|
+
## 0.83.1 — 08.11.2026
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- **`cli-dev changelog restore` and the other `--land` steps read an output past 1 MiB.** Their git and gh calls had
|
|
16
|
+
Node's default 1 MiB output limit, so `restore` failed once a released `CHANGELOG.md` passed that size, as
|
|
17
|
+
cli-core's did at 0.607.0, and its error printed the changelog instead of the cause. The limit is now 64 MiB, the
|
|
18
|
+
same as `@wirecat/cli-base/release`, and a call that cannot run says why (`ENOBUFS`, `ENOENT`). A release script
|
|
19
|
+
that pins an older cli-base for `changelog restore` should take this version.
|
|
20
|
+
|
|
21
|
+
## 0.83.0 — 08.11.2026
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- **The flag vocabulary has `--button <text=data>` and `--no-buttons`.** `--button` (value, string, repeatable) is one
|
|
26
|
+
inline button under a bot's message, as its text and the data a press sends back; `--no-buttons` takes the buttons
|
|
27
|
+
off a message being edited. Negations here are `--no-<thing>` (`--no-preview`, `--no-approval`), so this one is not
|
|
28
|
+
`--clear-buttons`; `--clear` stays the generic unset. cli-core's `bot messages send` and `edit` use them.
|
|
29
|
+
- **The new-CLI handbook names the data-folder rule for a CLI published outside `@wirecat`:** WireCat Desktop adds
|
|
30
|
+
such a tool only when its `appName` is `<scope>-<name>` of the package or starts with it. It also says that the
|
|
31
|
+
template now calls `wcatStart`, writes the `wcat-` command and names a reference CLI for mail and crm.
|
|
32
|
+
|
|
11
33
|
## 0.82.0 — 07.11.2026
|
|
12
34
|
|
|
13
35
|
### Added
|
package/dist/dev/land.js
CHANGED
|
@@ -3,7 +3,10 @@ import spawn from "cross-spawn";
|
|
|
3
3
|
import { foldUnreleased, mergeRepeatedHeadings, restoreReleased } from "../release/index.js";
|
|
4
4
|
export const processShell = (cwd) => ({
|
|
5
5
|
run: (command, args) => {
|
|
6
|
-
|
|
6
|
+
// Node's default 1 MiB output limit cut `git show` of a changelog past that size (cli-core 0.607.0).
|
|
7
|
+
const result = spawn.sync(command, [...args], { cwd, encoding: "utf8", maxBuffer: 64 * 1024 * 1024 });
|
|
8
|
+
if (result.error)
|
|
9
|
+
return { ok: false, out: result.error.message };
|
|
7
10
|
return { ok: result.status === 0, out: `${result.stdout ?? ""}${result.stderr ?? ""}`.trim() };
|
|
8
11
|
},
|
|
9
12
|
sleep: (ms) => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms),
|
|
@@ -801,7 +801,15 @@ export const WHAT_FLAGS = [
|
|
|
801
801
|
meaning: "what kind of thing it is; the command lists the kinds",
|
|
802
802
|
},
|
|
803
803
|
{ name: "--name", value: "<name>", role: "value", type: "string", meaning: "the name to give it" },
|
|
804
|
+
{
|
|
805
|
+
name: "--button",
|
|
806
|
+
value: "<text=data>",
|
|
807
|
+
role: "value",
|
|
808
|
+
type: "string",
|
|
809
|
+
meaning: "an inline button under a message: its text, then the data a press sends back; repeat for more in one row",
|
|
810
|
+
},
|
|
804
811
|
{ name: "--no-approval", role: "value", type: "switch", meaning: "anyone with the link joins at once" },
|
|
812
|
+
{ name: "--no-buttons", role: "value", type: "switch", meaning: "take the buttons off the message" },
|
|
805
813
|
{
|
|
806
814
|
name: "--notification",
|
|
807
815
|
value: "<text>",
|
|
@@ -38,8 +38,8 @@ Every choice question also takes `other:<your answer>`.
|
|
|
38
38
|
|
|
39
39
|
`new` copies the template of its own package version into `<name>-cli/`, renames the command word everywhere, runs
|
|
40
40
|
`git init`, records the template version in `template.json`, writes `docs/dev/DESIGN.md` from your answers and names
|
|
41
|
-
a reference CLI for your category in `AGENTS.md
|
|
42
|
-
|
|
41
|
+
a reference CLI for your category in `AGENTS.md`: mail-cli for `mail`, bitrix24-cli for `crm`. `other:` has none;
|
|
42
|
+
`AGENTS.md` then says to pick the nearest one with the owner from the Reference CLIs page. It does not
|
|
43
43
|
install packages, push, create the repository or publish. Then:
|
|
44
44
|
|
|
45
45
|
```sh
|
|
@@ -81,9 +81,9 @@ installing that command; nothing else is registered anywhere.
|
|
|
81
81
|
[WC-CMD-29](commands.md#wc-cmd-29--answer---wcat-describe-and-take-no-name-wirecat-reserves) asks a CLI outside
|
|
82
82
|
WireCat not to take one.
|
|
83
83
|
- **The command.** `"bin": { "wcat-<name>": "dist/bin/<name>.js" }`. `cli-dev lint` warns about a `"bin"` key without
|
|
84
|
-
the `wcat-` prefix. The template
|
|
85
|
-
- **The description `wcat --help` shows.** The
|
|
86
|
-
|
|
84
|
+
the `wcat-` prefix. The template writes both `<name>` and `wcat-<name>`.
|
|
85
|
+
- **The description `wcat --help` shows.** The bin calls `wcatStart` first, before the program loads; the template's
|
|
86
|
+
bin does:
|
|
87
87
|
|
|
88
88
|
```ts
|
|
89
89
|
import { wcatStart } from "@wirecat/cli-base/wcat/start"
|
|
@@ -109,11 +109,17 @@ installing that command; nothing else is registered anywhere.
|
|
|
109
109
|
```
|
|
110
110
|
|
|
111
111
|
`cli-dev manifest --program dist/program.js --identity dist/wcat.js` writes the file; `--check` in CI fails when it
|
|
112
|
-
is stale.
|
|
113
|
-
|
|
112
|
+
is stale. `wcatStart` reads the shipped file for `--wcat-describe`, so the bin needs only the format-1 fields and
|
|
113
|
+
keeps the program out of its first import. List `contracts/wirecat.json`, not all of `contracts`, in `files`
|
|
114
|
+
([WC-REL-16](releases.md#wc-rel-16--the-package-ships-only-the-files-it-names)). A CLI with a
|
|
114
115
|
`sync` command also sets `syncs`, what it copies in at most 40 characters. The file holds no version, and
|
|
115
116
|
`mcpServer` no port: Desktop reads the version from npm and gives the tool a free port. A command the manifest lists
|
|
116
|
-
without `effects` counts as a write; `permissionOf` adds each command's permission key. See
|
|
117
|
+
without `effects` counts as a write; `permissionOf` adds each command's permission key. See
|
|
118
|
+
[WC-CMD-29](commands.md#wc-cmd-29--answer---wcat-describe-and-take-no-name-wirecat-reserves).
|
|
119
|
+
- **A CLI published outside `@wirecat`.** WireCat Desktop adds it only when its data folder, the identity's `appName`,
|
|
120
|
+
is `<scope>-<name>` of the package or starts with `<scope>-<name>-`, with `.` and `_` read as `-`: `@acme/crm-cli`
|
|
121
|
+
keeps its data in `acme-crm-cli`. Only the scope's owner publishes under it, so the folder Desktop may delete is
|
|
122
|
+
theirs. `new` names it so for a package outside `@wirecat`.
|
|
117
123
|
- **The short name.** `wcat shortcuts add <name>` makes `<name>` a shortcut to `wcat-<name>`, only when no program on
|
|
118
124
|
PATH has that name. A CLI does not install its short name itself.
|
|
119
125
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-base",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.83.1",
|
|
4
4
|
"description": "The parts every command line tool needs: output modes, terminal rendering, error model, exit codes, credentials, clocks",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|