@wirecat/cli-base 0.88.0 → 0.89.0

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 CHANGED
@@ -8,6 +8,27 @@ 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.89.0 — 08.11.2026
12
+
13
+ ### Added
14
+
15
+ - **The vocabulary has the verb `preview` and the options `--locale <code>` and `--undo`.** They name cli-core's
16
+ `templates` commands: `templates preview` renders what a message would say without sending or saving it,
17
+ `--locale <code>` picks a template's language by its ISO 639-1 code, and `templates edit --undo` puts back the body
18
+ the last change replaced. `--locale` is a human language; `--language <lucene|legacy>` stays the query language.
19
+ - **`--channel` may also take a value, `--channel <channel>`: what a message is written for, such as email or
20
+ telegram.** As a switch it is still a channel instead of a group. The meaning of `--file <file>` now covers a file
21
+ read as the new text of a write, such as a template, beside an attachment to send.
22
+
23
+ ### Fixed
24
+
25
+ - **The handbook lists bitrix24-cli where it already follows a rule.** b24 joins the enforced-by lines of WC-CI-12
26
+ (its main ruleset requires the pull request checks), WC-TOOL-19 and the user-page rule on correction marks, the
27
+ CLIs that set `userPage`, the `ci:quick` list of WC-CI-4, the MCP page (cli-core's shared server, both snapshots)
28
+ and the repository names an "Enforced by" line may use. WC-SECR-17 names b24's phone and e-mail rules.
29
+ - **The New CLI page shows the template's own start file.** The bin passes `DESKTOP` from `src/identity.ts` to
30
+ `wcatStart`, and `src/wcat.ts` adds the permission keys as `WCAT`; the page showed an inline object and one `WCAT`.
31
+
11
32
  ## 0.88.0 — 08.11.2026
12
33
 
13
34
  ### Added
@@ -576,6 +576,7 @@ export const HOW_FLAGS = [
576
576
  { name: "--retract", role: "action", type: "switch", meaning: "take the owner's vote back" },
577
577
  { name: "--revoke", role: "action", type: "switch", meaning: "forget every login given to a browser app" },
578
578
  { name: "--track", role: "action", type: "switch", meaning: "also do it daily while serve runs" },
579
+ { name: "--undo", role: "mode", type: "switch", meaning: "put back what the last change replaced, not a new value" },
579
580
  {
580
581
  name: "--transcribe",
581
582
  role: "action",
@@ -1,4 +1,11 @@
1
1
  export const SCHEDULE_FLAGS = [
2
+ {
3
+ name: "--locale",
4
+ value: "<code>",
5
+ role: "target",
6
+ type: "string",
7
+ meaning: "a human language, as an ISO 639-1 code such as en or ru: which language's version it acts on",
8
+ },
2
9
  {
3
10
  name: "--notify-on",
4
11
  value: "<when>",
@@ -548,7 +548,13 @@ export const WHAT_FLAGS = [
548
548
  meaning: "who joins by the link asks first, and an admin lets them in",
549
549
  },
550
550
  { name: "--can", value: "<rights>", role: "value", type: "list", meaning: "what an admin may do, comma-separated" },
551
- { name: "--channel", role: "value", type: "switch", meaning: "a channel instead of a group" },
551
+ {
552
+ name: "--channel",
553
+ role: "value",
554
+ type: "switch",
555
+ otherValues: ["channel"],
556
+ meaning: "a channel instead of a group (a switch), or what a message is written for (<channel>), such as email",
557
+ },
552
558
  {
553
559
  name: "--certainty",
554
560
  value: "<n>",
@@ -764,7 +770,7 @@ export const WHAT_FLAGS = [
764
770
  value: "<file>",
765
771
  role: "value",
766
772
  type: "path",
767
- meaning: "a file to send with the message; the text becomes its caption",
773
+ meaning: "a file it reads: one to send with a message, the text its caption, or the new text of a write",
768
774
  },
769
775
  {
770
776
  name: "--filename",
@@ -108,6 +108,7 @@ const verbs = [
108
108
  ["status", "how a thing stands right now"],
109
109
  ["check", "verify, and change nothing; the answer says what is wrong and how to fix it"],
110
110
  ["test", "run rules over what is already stored and say what they would have done, doing none of it"],
111
+ ["preview", "render what would be sent or written, from what is stored or a draft; sends and saves nothing"],
111
112
  ["apply", "run the owner's saved rules over what is already stored and change what they match; dry run unless --yes"],
112
113
  ["scan", "read stored messages for what a rule finds, such as tasks, and list it; records it only with --yes"],
113
114
  ["pause", "stop what a running process does for a profile, without stopping the process"],
@@ -84,7 +84,7 @@ Every rule has the same shape. A rule may add a sentence or a short list under i
84
84
  CLI's `node_modules`;
85
85
  - a check in another repository, as `<repo>: <check>`, such as `cli-core: pnpm parity:check` or
86
86
  `cli-core: biome noRestrictedImports`. `<repo>` is the repository's name on GitHub: `cli-core`, `cli-testing`,
87
- `cli-docs`, `community`, `tg-cli`, `max-cli`, `cli-memo`, `drive-cli`, `zoom-cli`, `whatsapp-cli` or `gcal-cli`. `<app>`
87
+ `cli-docs`, `community`, `tg-cli`, `max-cli`, `cli-memo`, `drive-cli`, `zoom-cli`, `whatsapp-cli`, `gcal-cli` or `bitrix24-cli`. `<app>`
88
88
  stands for each CLI the rule applies to, when every one of them runs that check in its own repository;
89
89
  - no check yet: "review only", or "review only, check planned: <the check>" when one is designed but not built.
90
90
  The planned check is plain words, not backticks, so nobody reads it as a check that runs.
@@ -53,7 +53,7 @@ plus community itself. cli-template follows every rule here as a CLI does
53
53
  - **Why:** it is the first build-level answer on a pull request, so it must stay fast enough that nobody wants it gone.
54
54
  - **Enforced by:** `standards.yml:standards` · `pnpm ci:quick`.
55
55
  - **Example:** what each repository runs today:
56
- - tg, max, memo, wa and cli-template: `pnpm typecheck && pnpm build && pnpm lint:commands`;
56
+ - tg, max, memo, wa, b24 and cli-template: `pnpm typecheck && pnpm build && pnpm lint:commands`;
57
57
  - drive: `pnpm typecheck && pnpm lint:commands`, which builds first;
58
58
  - zoom, cli-base and cli-testing: `pnpm typecheck`;
59
59
  - cli-core: `pnpm typecheck` and its command lint test;
@@ -211,7 +211,7 @@ its prompt in cli-template says so from cli-template 0.8.0. A CLI on an older te
211
211
  - **Enforced by:** `whatsapp-cli: main ruleset required checks` · `cli-core: main ruleset required checks` ·
212
212
  `tg-cli: main ruleset required checks` · `max-cli: main ruleset required checks` ·
213
213
  `cli-memo: main ruleset required checks` · `drive-cli: main ruleset required checks` ·
214
- `gcal-cli: main ruleset required checks`, plus the main rulesets of
214
+ `gcal-cli: main ruleset required checks` · `bitrix24-cli: main ruleset required checks`, plus the main rulesets of
215
215
  cli-base and cli-template. In each repository with pr.yml, the ruleset requires the pull request validation jobs besides the
216
216
  standards job. cli-testing and cli-docs have no pr.yml, so their rulesets require only the standards job, and
217
217
  review covers the rest. zoom-cli has pr.yml,
@@ -25,10 +25,10 @@ Rule ids on this page are `WC-DOC-<n>`. How to read a rule, how ids work and whi
25
25
 
26
26
  - **Why:** the reader wants the current behaviour, not the history of a page or a journal number they cannot open.
27
27
  - **Enforced by:** `tg-cli: pnpm docs:check` · `max-cli: pnpm docs:check` · `whatsapp-cli: pnpm docs:check` ·
28
- `zoom-cli: pnpm docs:check` · `gcal-cli: pnpm docs:check`.
28
+ `zoom-cli: pnpm docs:check` · `gcal-cli: pnpm docs:check` · `bitrix24-cli: pnpm docs:check`.
29
29
  - **Example:** write "`--limit` defaults to 50", not "~~20~~ 50 (correction 2026-10-01, NEED-12)".
30
30
  - **Exceptions:** none. `cli-dev docs-check` checks this when the CLI's rules module sets `userPage`. tg, max, wa,
31
- zoom, gcal and cli-template set it; memo, drive and cli-base's default check do not.
31
+ zoom, gcal, b24 and cli-template set it; memo, drive and cli-base's default check do not.
32
32
  - **Applies to:** all CLIs. **Since:** cli-base 0.41.0. **Rulings:** none.
33
33
 
34
34
  ### WC-DOC-3 · Every document states current facts; rewrite a wrong sentence in place
@@ -20,7 +20,8 @@ cli-core serves `mcp serve --profiles`
20
20
  ([WC-MCP-9](#wc-mcp-9--a-server-serves-the-profiles-it-is-told-with-one-connection-for-each)) from 0.470.0, for the
21
21
  messengers and for the CLIs below that use its shared server.
22
22
  zoom serves the three shared tools over its own commands from zoom-cli 0.35.0 (`zm <profile> mcp serve`, cli-core's
23
- `toolsFromCommands` and `runCommandForAgent`), and gcal does the same (`gcal <profile> mcp serve`). memo and drive have their own servers: memo has hand-written
23
+ `toolsFromCommands` and `runCommandForAgent`), and gcal does the same (`gcal <profile> mcp serve`). b24 serves the
24
+ same three tools through cli-core's `appMcpCommand` (`b24 <profile> mcp serve`). memo and drive have their own servers: memo has hand-written
24
25
  tools, and drive builds one tool per command from its command tree and skips commands through its own list. Those two are known
25
26
  gaps against these rules.
26
27
 
@@ -243,7 +244,7 @@ cli-core builds its personal and bot MCP catalogues from the command tree with `
243
244
  (WC-MCP-1) that is three names and their schemas, which do not change when a command is added. So each CLI also
244
245
  pins the command catalogue behind the tools, every command `tools_search` can return and whether it runs through
245
246
  `read` or `write`, in `contracts/mcp-catalogue.json`. A command that becomes visible to agents then shows up as a diff in
246
- its pull request. tg, max and gcal keep both; wa, zm and drive pin only the tools, a known gap as of 2026-10-27.
247
+ its pull request. tg, max, gcal and b24 keep both; wa, zm and drive pin only the tools, a known gap as of 2026-10-27.
247
248
 
248
249
  ## Sources
249
250
 
@@ -84,33 +84,40 @@ installing that command; nothing else is registered anywhere.
84
84
  published, not added later. The short name may stay beside it. The template writes both `<name>` and
85
85
  `wcat-<name>`. `cli-dev lint` warns about a `"bin"` key without the `wcat-` prefix, and `cli-dev release-pr` fails
86
86
  the pull request that raises the version from `0.0.0` when no key has it.
87
- - **The description `wcat --help` shows.** The bin calls `wcatStart` first, before the program loads; the template's
88
- bin does:
87
+ - **The description `wcat --help` shows.** The bin calls `wcatStart` first, before the program loads, with the
88
+ `DESKTOP` identity from `src/identity.ts`; the template's bin does:
89
89
 
90
90
  ```ts
91
91
  import { wcatStart } from "@wirecat/cli-base/wcat/start"
92
+ import { DESKTOP } from "../identity.js"
92
93
 
93
- const { code } = await wcatStart({ command: "gcal", version, description, docs: "https://example.com/gcal" })
94
- if (code !== undefined) process.exitCode = code
95
- else await startCli(…)
94
+ const wcat = await wcatStart(DESKTOP)
95
+ if (wcat.code !== undefined) process.exitCode = wcat.code
96
+ else await import("../program.js") // and runs it
96
97
  ```
97
98
 
98
99
  It answers `--wcat-describe`, runs `wcat` when the `wcat` launcher starts the tool, and on any other start makes sure
99
100
  the `wcat` launcher in the tool's bin folder works. `cli-dev lint --cli` warns when the built CLI does not answer.
100
- - **The manifest WireCat Desktop reads.** Export the identity for it, and commit `contracts/wirecat.json`:
101
+ - **The manifest WireCat Desktop reads.** `src/identity.ts` exports `DESKTOP`, the texts Desktop shows, and
102
+ `src/wcat.ts` adds the permission keys for the manifest. Commit `contracts/wirecat.json`:
101
103
 
102
104
  ```ts
103
- import type { ManifestIdentity } from "@wirecat/cli-base/wcat/manifest"
104
-
105
- export const WCAT: ManifestIdentity = {
105
+ // src/identity.ts
106
+ export const DESKTOP: ManifestIdentity = {
106
107
  ...IDENTITY,
107
108
  docs: "https://example.com/gcal",
108
109
  tagline: "Google Calendar events, searchable on your computer",
109
110
  signIn: { gives: "Lets your agent read your calendar.", asks: "Google asks to allow read-only access." },
110
111
  hosts: ["www.googleapis.com", "oauth2.googleapis.com"],
111
112
  }
113
+
114
+ // src/wcat.ts
115
+ export const WCAT: ManifestIdentity = { ...DESKTOP, permissionOf: permissions.keyOf }
112
116
  ```
113
117
 
118
+ The bin takes `DESKTOP`, not `WCAT`: `WCAT` imports the permission table, and the start file stays thin
119
+ ([WC-LAY-2](layout.md#wc-lay-2--start-the-command-from-srcbincommandts-and-keep-that-file-thin)).
120
+
114
121
  `cli-dev manifest --program dist/program.js --identity dist/wcat.js` writes the file; `--check` in CI fails when it
115
122
  is stale. `wcatStart` reads the shipped file for `--wcat-describe`, so the bin needs only the format-1 fields and
116
123
  keeps the program out of its first import. List `contracts/wirecat.json`, not all of `contracts`, in `files`
@@ -252,7 +252,8 @@ allowlist names synthetic values by value, never a whole file, so the file stays
252
252
  - **Enforced by:** review only.
253
253
  - **Example:** max's `.gitleaks.toml` has `max-session-token`, `max-device-identity` and `phone-number-e164`, and
254
254
  allows only `+71234567890` and other sanctioned fakes.
255
- - **Exceptions:** `pnpm-lock.yaml` may be allowed by path. Today only max and wa have a phone number rule.
255
+ - **Exceptions:** `pnpm-lock.yaml` may be allowed by path. Today max, wa and b24 have a phone number rule, and b24 an
256
+ e-mail address rule.
256
257
  - **Applies to:** all CLIs. **Since:** cli-base 0.41.0. **Rulings:** none.
257
258
 
258
259
  ### WC-SECR-18 · Report a vulnerability privately
@@ -243,7 +243,8 @@ no-unbounded-spread ([WC-TOOL-12](#wc-tool-12--do-not-spread-a-list-of-user-data
243
243
 
244
244
  - **Why:** user pages feed the docs site, so their Markdown form is checked more closely than developer notes.
245
245
  - **Enforced by:** `tg-cli: pnpm docs:check` · `max-cli: pnpm docs:check` · `whatsapp-cli: pnpm docs:check` ·
246
- `zoom-cli: pnpm docs:check` · `gcal-cli: pnpm docs:check` · `cli-testing: pnpm docs:check`.
246
+ `zoom-cli: pnpm docs:check` · `gcal-cli: pnpm docs:check` · `bitrix24-cli: pnpm docs:check` ·
247
+ `cli-testing: pnpm docs:check`.
247
248
  - **Example:** `rumdl check --config config/wirecat/rumdl.toml README.md docs/*.md`, inside `docs:check`. The preset
248
249
  turns off line length (MD013), first-line heading (MD041) and relative links (MD057), because other checks cover
249
250
  them.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-base",
3
- "version": "0.88.0",
3
+ "version": "0.89.0",
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",