@wirecat/cli-base 0.72.0 → 0.74.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,25 @@ 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.74.0 — 02.11.2026
12
+
13
+ ### Added
14
+
15
+ - **`--compact`, a shared output switch for one line per item (WC-OUT-24).** The vocabulary lists it with role
16
+ `output`, and `COMPACT_FLAG` from `@wirecat/cli-base/standards` holds its name, so a CLI builds its option from
17
+ that one place. The rule says what the text keeps from the JSON answer: the reference first, the text last and cut
18
+ with `…(+N)`, and `page`, `missing`, `next` and `meta.complete` as lines that start with `# `. cli-core's runner
19
+ draws it; a CLI on its own `run()` has nothing to change until it offers the switch.
20
+
21
+ ## 0.73.0 — 02.11.2026
22
+
23
+ ### Added
24
+
25
+ - **The verb `remind`.** It tells the owner once about what starts soon: it prints it, or runs the owner's own
26
+ program for it. gcal's `events remind` uses it, for a scheduler (cron, a systemd timer) to run every few minutes, as
27
+ gcalcli's `remind` is run. Before, no verb said "tell me once": `watch` keeps a process running, and `send` writes
28
+ to a chat.
29
+
11
30
  ## 0.72.0 — 02.11.2026
12
31
 
13
32
  ### Added
@@ -1,3 +1,4 @@
1
+ import { COMPACT_FLAG } from "./output.js";
1
2
  export const HOW_FLAGS = [
2
3
  {
3
4
  name: "--limit",
@@ -84,6 +85,12 @@ export const HOW_FLAGS = [
84
85
  type: "switch",
85
86
  meaning: "each item as its reference, title, time and excerpt only",
86
87
  },
88
+ {
89
+ name: COMPACT_FLAG,
90
+ role: "output",
91
+ type: "switch",
92
+ meaning: "one line per item, built from the same answer as --json, with its paging and next steps as # lines",
93
+ },
87
94
  {
88
95
  name: "--chart-kind",
89
96
  value: "<messages|active|membership>",
@@ -1,6 +1,6 @@
1
1
  export { EFFECT_LEVELS, type EffectLevel, type Effects, effectsSchema, writes } from "./effects.js";
2
2
  export { BASE_REASONS, COMMON_DETAILS, CRASH_CODE, CRASH_REASON, defineReasons, type ErrorObject, type ErrorReason, errorObjectSchema, } from "./errors.js";
3
3
  export { defineLogEvents, isContentKey, LOG_ATTRIBUTE_KEYS, LOG_EVENTS, LOG_SEVERITIES, type LogEvent, type LogRecord, type LogSeverity, logAttributesJsonSchema, logEventProblems, logRecordSchema, traceIdOf, } from "./log.js";
4
- export { clockMeta, type Issue, type ItemEnvelope, isoTime, issueSchema, itemEnvelopeSchema, jsonlEndSchema, jsonlItemSchema, jsonlOf, type ListEnvelope, listEnvelopeSchema, localTime, MAX_NEXT_STEPS, type Meta, type Missing, metaSchema, missingSchema, type NextStep, nextStepSchema, type Page, pageSchema, reference, type Total, totalSchema, } from "./output.js";
4
+ export { COMPACT_FLAG, clockMeta, type Issue, type ItemEnvelope, isoTime, issueSchema, itemEnvelopeSchema, jsonlEndSchema, jsonlItemSchema, jsonlOf, type ListEnvelope, listEnvelopeSchema, localTime, MAX_NEXT_STEPS, type Meta, type Missing, metaSchema, missingSchema, type NextStep, nextStepSchema, type Page, pageSchema, reference, type Total, totalSchema, } from "./output.js";
5
5
  export { fill, jsonSchemaOf, RegistryError } from "./registry.js";
6
6
  export { defineSteps, SAME_COMMAND, STEPS, type StepDefinition, type StepInput, type StepTarget, stepOf, } from "./steps.js";
@@ -1,6 +1,6 @@
1
1
  export { EFFECT_LEVELS, effectsSchema, writes } from "./effects.js";
2
2
  export { BASE_REASONS, COMMON_DETAILS, CRASH_CODE, CRASH_REASON, defineReasons, errorObjectSchema, } from "./errors.js";
3
3
  export { defineLogEvents, isContentKey, LOG_ATTRIBUTE_KEYS, LOG_EVENTS, LOG_SEVERITIES, logAttributesJsonSchema, logEventProblems, logRecordSchema, traceIdOf, } from "./log.js";
4
- export { clockMeta, isoTime, issueSchema, itemEnvelopeSchema, jsonlEndSchema, jsonlItemSchema, jsonlOf, listEnvelopeSchema, localTime, MAX_NEXT_STEPS, metaSchema, missingSchema, nextStepSchema, pageSchema, reference, totalSchema, } from "./output.js";
4
+ export { COMPACT_FLAG, clockMeta, isoTime, issueSchema, itemEnvelopeSchema, jsonlEndSchema, jsonlItemSchema, jsonlOf, listEnvelopeSchema, localTime, MAX_NEXT_STEPS, metaSchema, missingSchema, nextStepSchema, pageSchema, reference, totalSchema, } from "./output.js";
5
5
  export { fill, jsonSchemaOf, RegistryError } from "./registry.js";
6
6
  export { defineSteps, SAME_COMMAND, STEPS, stepOf, } from "./steps.js";
@@ -1,6 +1,8 @@
1
1
  import * as v from "valibot";
2
2
  /** At most two next steps per answer: the one to take, then one alternative. */
3
3
  export declare const MAX_NEXT_STEPS = 2;
4
+ /** The switch for one line per item (WC-OUT-24). Its name is still the owner's to settle, so it lives in one place. */
5
+ export declare const COMPACT_FLAG = "--compact";
4
6
  export declare const isoTime: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, "an ISO 8601 time in UTC">, v.EndsWithAction<string, "Z", "an ISO 8601 time in UTC, ending in `Z`">]>;
5
7
  /** The same moment on the wall clock of a zone, with its offset: `2026-11-02T16:03:00.000+01:00` (WC-TIME-2). */
6
8
  export declare const localTime: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "an ISO 8601 time with its offset">]>;
@@ -3,6 +3,8 @@ import { errorCodes } from "../errors.js";
3
3
  import { dottedId, text } from "./registry.js";
4
4
  /** At most two next steps per answer: the one to take, then one alternative. */
5
5
  export const MAX_NEXT_STEPS = 2;
6
+ /** The switch for one line per item (WC-OUT-24). Its name is still the owner's to settle, so it lives in one place. */
7
+ export const COMPACT_FLAG = "--compact";
6
8
  export const isoTime = v.pipe(v.string(), v.isoTimestamp("an ISO 8601 time in UTC"), v.endsWith("Z", "an ISO 8601 time in UTC, ending in `Z`"));
7
9
  /** The same moment on the wall clock of a zone, with its offset: `2026-11-02T16:03:00.000+01:00` (WC-TIME-2). */
8
10
  export const localTime = v.pipe(v.string(), v.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}[+-]\d{2}:\d{2}$/, "an ISO 8601 time with its offset"));
@@ -164,6 +164,7 @@ const verbs = [
164
164
  ["vote", "answer a poll"],
165
165
  ["answer", "reply to a button someone pressed under a bot's message"],
166
166
  ["respond", "answer an invitation: accept, tentatively accept or decline it"],
167
+ ["remind", "tell the owner once about what starts soon: print it, or run the owner's own program for it"],
167
168
  ["press", "press a button under a bot's message; the bot sees who pressed it"],
168
169
  ["action", "show what a bot is doing in a chat, such as typing, for a few seconds"],
169
170
  ["watch", "follow new events as they come, and keep them"],
@@ -30,7 +30,7 @@ the four steps that need a person. A new CLI is ready for its first release when
30
30
  | [Toolchain](toolchain.md) | `TOOL` | 20 | TypeScript, Biome, grit plugins, size caps, import cycles, spelling, Markdown, Go |
31
31
  | [Layout](layout.md) | `LAY` | 10 | Repository layout, entry points, exports, file size, one job per file, splitting a unit, the bundled bin |
32
32
  | [Commands](commands.md) | `CMD` | 29 | Paths, vocabulary, flags, arguments, effects, lifetime, query, help, external references, joining `wcat` |
33
- | [Output](output.md) | `OUT` | 23 | Data on stdout only, envelopes, errors, exit codes, partial answers, projection |
33
+ | [Output](output.md) | `OUT` | 24 | Data on stdout only, envelopes, errors, exit codes, partial answers, projection |
34
34
  | [MCP](mcp.md) | `MCP` | 13 | The MCP tools, how they come from commands, what each permission shows |
35
35
  | [Accounts](accounts.md) | `ACCT` | 12 | The explicit profile, reads across accounts, scope flags, linked identities, sign-in commands |
36
36
  | [Permissions](permissions.md) | `PERM` | 22 | Levels, keys, defaults, hard limits, the write guard and its journal |
@@ -165,8 +165,9 @@ catalogue and parity manifest stay in cli-core
165
165
 
166
166
  - **Why:** a script that works with one CLI works with the next.
167
167
  - **Enforced by:** review only.
168
- - **Example:** `--json` and `--jsonl` choose machine output. `--quiet` turns diagnostics off, but a failure is still
169
- said. `-v` and `-vv` add detail, `-V` prints the version, `--trace` writes request diagnostics, `--debug` adds the
168
+ - **Example:** `--json` and `--jsonl` choose machine output, `--compact` one line per item
169
+ ([WC-OUT-24](output.md#wc-out-24--offer-a-compact-text-form-built-from-the-same-answer)). `--quiet` turns
170
+ diagnostics off, but a failure is still said. `-v` and `-vv` add detail, `-V` prints the version, `--trace` writes request diagnostics, `--debug` adds the
170
171
  whole failure record. `--timeout <duration>` bounds the command. `--no-input` never prompts. `--dry-run` previews.
171
172
  `--yes` answers the question an `ask` permission level puts before a write.
172
173
  - **Exceptions:** none.
@@ -176,8 +177,8 @@ catalogue and parity manifest stay in cli-core
176
177
 
177
178
  - **Why:** a prompt in a pipe or under an agent waits for ever.
178
179
  - **Enforced by:** review only.
179
- - **Example:** `--no-input`, `--json`, `--jsonl`, a `CI` variable or a stdout that is not a terminal each switch prompts
180
- and browser logins off. Data piped on stdin for an explicit command still works. Buffered stdin stops at
180
+ - **Example:** `--no-input`, `--json`, `--jsonl`, `--compact`, a `CI` variable or a stdout that is not a terminal
181
+ each switch prompts and browser logins off. Data piped on stdin for an explicit command still works. Buffered stdin stops at
181
182
  `--max-input-bytes` (16 MiB by default).
182
183
  - **Exceptions:** none. `--yes` confirms a write; it never lifts a `deny`
183
184
  ([WC-PERM-10](permissions.md#wc-perm-10--a-flag-confirms-it-never-grants)).
@@ -288,6 +288,21 @@ Three things follow from it:
288
288
  - **Exceptions:** none.
289
289
  - **Applies to:** all CLIs. **Since:** cli-base 0.43.1. **Rulings:** none.
290
290
 
291
+ ### WC-OUT-24 · Offer a compact text form built from the same answer
292
+
293
+ - **Why:** an agent pays for every key, quote and repeated chat reference it reads. One line per item says the same
294
+ thing in about half the bytes, with no script to format it.
295
+ - **Enforced by:** `cli-core: src/cli/compact.test.ts`.
296
+ - **Example:** `tg personal messages list 111 --compact` prints one line per item, columns joined by ` · `, the
297
+ reference first and the free text last. When every reference shares a prefix, a header line names it once and the
298
+ rows print only the tail. Text is kept on one line, with control and direction characters made visible, and cut at
299
+ 400 characters with `…(+N)`; `--full` keeps it whole. What JSON says beside the items is kept as lines that start
300
+ with `# `: `# more:` from `page`, `# missing:` per `missing` entry, `# next:` per next step and `# complete: false`.
301
+ A row never starts with `# `, so no message text can pass for one of them. The footer goes to stdout with the
302
+ rows. `--compact` is refused with `--json`, `--jsonl` and `--brief`, never prompts, and exits as JSON would.
303
+ - **Exceptions:** MCP tools answer JSON.
304
+ - **Applies to:** CLIs that run on cli-core's `run()`. **Since:** cli-base 0.74.0. **Rulings:** NEED-2131.
305
+
291
306
  ## Sources
292
307
 
293
308
  These documents explain the rules on this page in more detail. Where one of them disagrees with this page, this page
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirecat/cli-base",
3
- "version": "0.72.0",
3
+ "version": "0.74.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",