@wirecat/cli-core 0.435.0 → 0.436.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 +13 -0
- package/dist/cli/profile.d.ts +4 -1
- package/dist/cli/profile.js +22 -7
- package/dist/cli/program.js +8 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,19 @@ Notable changes to `@wirecat/cli-core` (`@wirecat/cli-messaging` up to 0.261.0,
|
|
|
5
5
|
minor version may break callers, and says how under "Changed — may break callers". `pnpm docs:check` checks the
|
|
6
6
|
shape of this file.
|
|
7
7
|
|
|
8
|
+
## Unreleased
|
|
9
|
+
|
|
10
|
+
## 0.436.0 — 26.10.2026
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **`--help-all` shows the profile with a command that takes one.** The example after "The first word is the profile
|
|
15
|
+
whenever it is not a command" skipped only cli-core's own profile-free commands, so a CLI whose first command was
|
|
16
|
+
marked `profileFree` (cli-template's `doctor`) printed `clidev personal doctor`. It now skips every command that
|
|
17
|
+
takes no profile, at every level: `clidev personal mcp`. A CLI where no command takes a profile no longer prints
|
|
18
|
+
the three profile sentences at all, instead of `personal <command>`. A messenger CLI's text is unchanged, so the
|
|
19
|
+
help snapshots in tg-cli, max-cli and whatsapp-cli change only if a CLI's first command is `profileFree`.
|
|
20
|
+
|
|
8
21
|
## 0.435.0 — 25.10.2026
|
|
9
22
|
|
|
10
23
|
### Added
|
package/dist/cli/profile.d.ts
CHANGED
|
@@ -35,5 +35,8 @@ export declare const valuedOptions: (program: Command) => Set<string>;
|
|
|
35
35
|
export declare const refuseCommandName: (profile: string, words: Set<string>, command: string) => void;
|
|
36
36
|
/** The root of the command tree, from anywhere inside it. */
|
|
37
37
|
export declare const rootOf: (command: Command) => Command;
|
|
38
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* A command this CLI really has, for an example: the first path down to a leaf that takes a profile,
|
|
40
|
+
* skipping `PROFILE_FREE` and `profileFree` ones. Works on commands not yet added to the program.
|
|
41
|
+
*/
|
|
39
42
|
export declare const sampleCommand: (commands: readonly Command[]) => string | undefined;
|
package/dist/cli/profile.js
CHANGED
|
@@ -78,13 +78,28 @@ export const rootOf = (command) => {
|
|
|
78
78
|
root = root.parent;
|
|
79
79
|
return root;
|
|
80
80
|
};
|
|
81
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* A command this CLI really has, for an example: the first path down to a leaf that takes a profile,
|
|
83
|
+
* skipping `PROFILE_FREE` and `profileFree` ones. Works on commands not yet added to the program.
|
|
84
|
+
*/
|
|
82
85
|
export const sampleCommand = (commands) => {
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
const pathFrom = (command) => {
|
|
87
|
+
if (freeOfProfile.has(command))
|
|
88
|
+
return undefined;
|
|
89
|
+
const children = command.commands.filter((one) => one.name() !== "help");
|
|
90
|
+
if (children.length === 0)
|
|
91
|
+
return [command.name()];
|
|
92
|
+
for (const child of children) {
|
|
93
|
+
const rest = pathFrom(child);
|
|
94
|
+
if (rest)
|
|
95
|
+
return [command.name(), ...rest];
|
|
96
|
+
}
|
|
97
|
+
return undefined;
|
|
98
|
+
};
|
|
99
|
+
for (const command of commands) {
|
|
100
|
+
const path = PROFILE_FREE.has(command.name()) ? undefined : pathFrom(command);
|
|
101
|
+
if (path)
|
|
102
|
+
return path.join(" ");
|
|
88
103
|
}
|
|
89
|
-
return
|
|
104
|
+
return undefined;
|
|
90
105
|
};
|
package/dist/cli/program.js
CHANGED
|
@@ -42,13 +42,17 @@ export const createProgram = ({ app, commands, configure, firstScreen }, { out,
|
|
|
42
42
|
const messenger = app.messenger !== false;
|
|
43
43
|
const found = messenger ? "found messages" : "found items";
|
|
44
44
|
const content = messenger ? "message content" : "content";
|
|
45
|
+
const sample = messenger ? "chats list" : sampleCommand(mounted);
|
|
46
|
+
// A CLI where every command is profile-free has nothing to show a profile with, so it says nothing about one.
|
|
47
|
+
const profileHelp = sample
|
|
48
|
+
? `\n\nThe first word is the profile whenever it is not a command — \`${app.command} personal ${sample}\`.\n` +
|
|
49
|
+
`\`${app.envPrefix}_PROFILE\` says the same thing for a whole shell session.\n` +
|
|
50
|
+
"No profile is assumed: without one, a command that uses an account stops and lists the profiles here."
|
|
51
|
+
: "";
|
|
45
52
|
program
|
|
46
53
|
.name(app.command)
|
|
47
54
|
.usage("[profile] [options] <command>")
|
|
48
|
-
.description(`${app.description}
|
|
49
|
-
`The first word is the profile whenever it is not a command — \`${app.command} personal ${messenger ? "chats list" : (sampleCommand(mounted) ?? "<command>")}\`.\n` +
|
|
50
|
-
`\`${app.envPrefix}_PROFILE\` says the same thing for a whole shell session.\n` +
|
|
51
|
-
"No profile is assumed: without one, a command that uses an account stops and lists the profiles here.")
|
|
55
|
+
.description(`${app.description}${profileHelp}`)
|
|
52
56
|
.version(app.version, "-V, --version")
|
|
53
57
|
.option("-v, --verbose", "more detail in what is shown: -v ids, -vv everything we know", (_, level) => level + 1, 0)
|
|
54
58
|
.option("--json", "machine-readable output: one JSON value on stdout; --json=id,text keeps only those fields")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirecat/cli-core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.436.0",
|
|
4
4
|
"description": "The messenger-neutral half of a messaging CLI: domain model, message locators, rendering, name resolution, the SQLite seam, the command skeleton and shared read commands, the send guard, run records and the message store",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Viacheslav Ptsarev",
|