@hallohuman/hightea 0.1.2 → 0.1.8
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/dist/bin.js +187 -16
- package/dist/chunk-0ab6h39c.js +402 -0
- package/dist/chunk-3qbh10ga.js +12 -0
- package/dist/chunk-5mezgvms.js +139 -0
- package/dist/chunk-99e0mv8w.js +7313 -0
- package/dist/chunk-c8kc1c68.js +78 -0
- package/dist/chunk-d5h204vj.js +14 -0
- package/dist/{chunk-mcmsnaer.js → chunk-k2ws7xvy.js} +223 -21
- package/dist/chunk-py45wjd1.js +91 -0
- package/dist/chunk-sbqmqp8e.js +123 -0
- package/dist/chunk-v59kcfmj.js +347 -0
- package/dist/plugin/plugin.json +1 -1
- package/dist/plugin/plugin.mjs +2126 -112
- package/package.json +9 -5
- package/dist/chunk-9wxqnv9x.js +0 -149
package/dist/bin.js
CHANGED
|
@@ -5,22 +5,35 @@ import { fileURLToPath } from "node:url";
|
|
|
5
5
|
// package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "@hallohuman/hightea",
|
|
8
|
-
version: "0.1.
|
|
8
|
+
version: "0.1.8",
|
|
9
9
|
description: "The Hightea command line: join this machine to a Hightea workspace as a host.",
|
|
10
|
-
publishConfig: {
|
|
10
|
+
publishConfig: {
|
|
11
|
+
access: "public"
|
|
12
|
+
},
|
|
11
13
|
type: "module",
|
|
12
|
-
bin: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
bin: {
|
|
15
|
+
hightea: "./dist/bin.js"
|
|
16
|
+
},
|
|
17
|
+
files: [
|
|
18
|
+
"dist"
|
|
19
|
+
],
|
|
20
|
+
engines: {
|
|
21
|
+
node: ">=26.13.1"
|
|
22
|
+
},
|
|
23
|
+
scripts: {
|
|
24
|
+
build: "bun build.ts",
|
|
25
|
+
prepack: "bun run build"
|
|
26
|
+
},
|
|
16
27
|
dependencies: {
|
|
17
|
-
"@ahpd/sdk": "https://github.com/beorn/ahpd/releases/download/hh-
|
|
18
|
-
"@ahpd/server": "https://github.com/beorn/ahpd/releases/download/hh-
|
|
28
|
+
"@ahpd/sdk": "https://github.com/beorn/ahpd/releases/download/hh-38446-12d61c7b/ahpd-sdk-0.15.0-rc.4-beorn.12d61c7b.tgz",
|
|
29
|
+
"@ahpd/server": "https://github.com/beorn/ahpd/releases/download/hh-38446-12d61c7b/ahpd-server-0.15.0-rc.4-beorn.12d61c7b.tgz",
|
|
30
|
+
"@ahpd/services": "https://github.com/beorn/ahpd/releases/download/hh-38446-12d61c7b/ahpd-services-0.15.0-rc.4-beorn.12d61c7b.tgz",
|
|
19
31
|
"@silvery/commander": "0.29.3",
|
|
20
32
|
ws: "8.21.0"
|
|
21
33
|
},
|
|
22
34
|
devDependencies: {
|
|
23
|
-
"@hallohuman/hightea-ahp-host": "workspace:*"
|
|
35
|
+
"@hallohuman/hightea-ahp-host": "workspace:*",
|
|
36
|
+
"@hallohuman/hightea-client": "workspace:*"
|
|
24
37
|
}
|
|
25
38
|
};
|
|
26
39
|
|
|
@@ -29,33 +42,109 @@ import { Command, CommanderError } from "@silvery/commander";
|
|
|
29
42
|
async function runCli(argv, options) {
|
|
30
43
|
let code = 0;
|
|
31
44
|
const program = new Command("hightea").description("Hightea: join this machine to a Hightea workspace as a host for your own agents.").version(options.version, "-v, --version").exitOverride();
|
|
32
|
-
|
|
45
|
+
program.command("apply <file>").description("Apply a native process-compose file, or a TypeScript program that returns a plan, to one machine's ahpd: preview first, write only with --yes.").option("--machine <url>", "The machine's ahpd WebSocket endpoint, e.g. ws://127.0.0.1:7777").option("--token <token>", "The machine's token for this client (default: AHP_TKN)").option("--yes", "Send the previewed changes; without it nothing is sent").option("--prune", "After the preview lists them, remove entries this same source created that the plan no longer carries").option("--json", "Print one JSON document").addHelpText("after", `
|
|
46
|
+
Exit status: 0 previewed or applied; 1 the machine refused the plan or could not be reached.`).exitOverride().action(async (file, flags) => {
|
|
47
|
+
const { applyFile } = await import("./chunk-99e0mv8w.js");
|
|
48
|
+
code = await applyFile(file, {
|
|
49
|
+
machine: flags.machine ?? "",
|
|
50
|
+
token: flags.token ?? process.env.AHP_TKN,
|
|
51
|
+
yes: flags.yes === true,
|
|
52
|
+
prune: flags.prune === true,
|
|
53
|
+
json: flags.json === true
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
const host = program.command("host").description("Hosts: this machine joining a workspace, and the workspace's registered hosts.").exitOverride();
|
|
33
57
|
host.command("join").description("Join this machine to a workspace with a one-use host join code from the workspace owner.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--code <code>", "The one-use join code").option("--owner-config <file>", "Your owner configuration: agents, provider plugins and their credentials").addHelpText("after", `
|
|
34
58
|
Exit status: 0 registered; 2 pending, rerun the same command; 3 not authorised for that workspace or agent;
|
|
35
59
|
4 an agent is already bound to another host; 1 any other failure.`).exitOverride().action(async (flags) => {
|
|
36
|
-
const { hostJoin } = await import("./chunk-
|
|
60
|
+
const { hostJoin } = await import("./chunk-3qbh10ga.js");
|
|
37
61
|
code = await hostJoin({ origin: flags.origin ?? "", workspace: flags.workspace ?? "", code: flags.code ?? "", ownerConfig: flags.ownerConfig ?? "" }, { directory: options.pluginDirectory, version: options.version });
|
|
38
62
|
});
|
|
63
|
+
host.command("list").description("List the workspace's registered hosts and which agents each runs; a workspace owner sees every host.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print one JSON document").addHelpText("after", `
|
|
64
|
+
Exit status: 0 listed; 3 your account is not a person of this workspace; 1 any other failure.`).exitOverride().action(async (flags) => {
|
|
65
|
+
const { hostList } = await import("./chunk-c8kc1c68.js");
|
|
66
|
+
code = await hostList({
|
|
67
|
+
origin: flags.origin ?? "",
|
|
68
|
+
workspace: flags.workspace ?? "",
|
|
69
|
+
sessionFile: flags.sessionFile,
|
|
70
|
+
json: flags.json === true
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
host.command("remove").description("Remove a registered host from a workspace, as the workspace owner; its agents need a new join code.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--host <id>", "The registered host's id, e.g. host_01").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print one JSON document").addHelpText("after", `
|
|
74
|
+
Exit status: 0 removed or already removed; 3 your account is not this workspace's owner; 1 any other failure, including an unknown host id.`).exitOverride().action(async (flags) => {
|
|
75
|
+
const { hostRemove } = await import("./chunk-c8kc1c68.js");
|
|
76
|
+
code = await hostRemove({
|
|
77
|
+
origin: flags.origin ?? "",
|
|
78
|
+
workspace: flags.workspace ?? "",
|
|
79
|
+
host: flags.host ?? "",
|
|
80
|
+
sessionFile: flags.sessionFile,
|
|
81
|
+
json: flags.json === true
|
|
82
|
+
});
|
|
83
|
+
});
|
|
39
84
|
host.command("status").description("Show every joined host on this machine and whether its plugin bundle is intact. Changes nothing.").option("--json", "Print one JSON document").exitOverride().action(async (flags) => {
|
|
40
|
-
const { hostStatus } = await import("./chunk-
|
|
85
|
+
const { hostStatus } = await import("./chunk-3qbh10ga.js");
|
|
41
86
|
code = await hostStatus({ version: options.version, json: flags.json === true });
|
|
42
87
|
});
|
|
43
|
-
const
|
|
44
|
-
|
|
88
|
+
const trust = host.command("trust").description("The browser and host keys this machine trusts to ask its agents through a room.").addHelpText("after", `
|
|
89
|
+
What it protects against: an ask forged by a compromised Hightea server or database.
|
|
90
|
+
` + `What it does not: a compromised page script, since the script that signs comes from Hightea, or a process
|
|
91
|
+
` + "running as this machine's user, which can edit trusted-keys.json as it can config.json.").exitOverride();
|
|
92
|
+
trust.command("add").description("Trust a browser's (or another host's) public key, under a name of your choosing.").argument("<name>", "A name for the key, e.g. the browser it came from").argument("<public-key>", "The raw Ed25519 public key, base64url, as the browser's Members page shows it").option("--host <id>", "Which of this machine's joined hosts, when it holds more than one").addHelpText("after", `
|
|
93
|
+
Exit status: 0 trusted or already trusted; 1 any failure, with the file left unchanged.`).exitOverride().action(async (name, publicKey, flags) => {
|
|
94
|
+
const { hostTrust } = await import("./chunk-py45wjd1.js");
|
|
95
|
+
code = await hostTrust({ action: "add", name, publicKey, ...flags.host === undefined ? {} : { host: flags.host } });
|
|
96
|
+
});
|
|
97
|
+
trust.command("remove").description("Stop trusting the key with this name; asks signed with it are refused from then on.").argument("<name>", "The key's name, as `hightea host trust list` shows it").option("--host <id>", "Which of this machine's joined hosts, when it holds more than one").addHelpText("after", `
|
|
98
|
+
Exit status: 0 removed; 1 any failure, including an unknown name, with the file left unchanged.`).exitOverride().action(async (name, flags) => {
|
|
99
|
+
const { hostTrust } = await import("./chunk-py45wjd1.js");
|
|
100
|
+
code = await hostTrust({ action: "remove", name, ...flags.host === undefined ? {} : { host: flags.host } });
|
|
101
|
+
});
|
|
102
|
+
trust.command("list").description("List the keys this machine trusts. Changes nothing.").option("--host <id>", "Which of this machine's joined hosts, when it holds more than one").option("--json", "Print one JSON document").exitOverride().action(async (flags) => {
|
|
103
|
+
const { hostTrust } = await import("./chunk-py45wjd1.js");
|
|
104
|
+
code = await hostTrust({ action: "list", json: flags.json === true, ...flags.host === undefined ? {} : { host: flags.host } });
|
|
105
|
+
});
|
|
106
|
+
const auth = program.command("auth").description("Sign this machine in to a Hightea deployment for the owner commands.").exitOverride();
|
|
107
|
+
auth.command("login").description("Sign in with a short code confirmed in your browser, and store the session for this deployment.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--no-browser", "Print the confirmation URL instead of opening it").option("--json", "Print one JSON document with the account and expiry, never the tokens").addHelpText("after", `
|
|
108
|
+
Exit status: 0 signed in; 1 any other failure, named on stderr.`).exitOverride().action(async (flags) => {
|
|
109
|
+
const { authLogin } = await import("./chunk-d5h204vj.js");
|
|
110
|
+
code = await authLogin({ origin: flags.origin ?? "", noBrowser: flags.browser === false, json: flags.json === true });
|
|
111
|
+
});
|
|
112
|
+
auth.command("status").description("Show which account this machine is signed in as for a deployment. Changes nothing.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--json", "Print one JSON document with the account and expiry, never the tokens").exitOverride().action(async (flags) => {
|
|
113
|
+
const { authStatus } = await import("./chunk-d5h204vj.js");
|
|
114
|
+
code = await authStatus({ origin: flags.origin ?? "", json: flags.json === true });
|
|
115
|
+
});
|
|
116
|
+
auth.command("logout").description("Revoke this machine's session at the deployment and forget its local credential.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--json", "Print one JSON document").exitOverride().action(async (flags) => {
|
|
117
|
+
const { authLogout } = await import("./chunk-d5h204vj.js");
|
|
118
|
+
code = await authLogout({ origin: flags.origin ?? "", json: flags.json === true });
|
|
119
|
+
});
|
|
120
|
+
const source = program.command("source").description("A workspace's km sources: bind one to a host, unbind it, or read its state.").exitOverride();
|
|
121
|
+
source.command("bind").description("Bind a km source to one of the workspace's hosts, as the workspace owner.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--source <id>", "The source id, e.g. src_km").option("--host <id>", "The host id that serves the source").option("--refresh <every>", "Refresh interval to declare at bind time: 1h, 30m, 2d (default: none)").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print one JSON document").addHelpText("after", `
|
|
45
122
|
Exit status: 0 bound; 3 your account is not this workspace's owner; 4 that source is bound to another host;
|
|
46
123
|
1 any other failure.`).exitOverride().action(async (flags) => {
|
|
47
|
-
const { sourceBind } = await import("./chunk-
|
|
124
|
+
const { sourceBind } = await import("./chunk-5mezgvms.js");
|
|
48
125
|
code = await sourceBind({
|
|
49
126
|
origin: flags.origin ?? "",
|
|
50
127
|
workspace: flags.workspace ?? "",
|
|
51
128
|
source: flags.source ?? "",
|
|
52
129
|
host: flags.host ?? "",
|
|
130
|
+
refresh: flags.refresh,
|
|
131
|
+
sessionFile: flags.sessionFile,
|
|
132
|
+
json: flags.json === true
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
source.command("unbind").description("Take a km source out of service, as the workspace owner; its rows stay and read as unbound.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--source <id>", "The source id, e.g. src_km").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print one JSON document").addHelpText("after", `
|
|
136
|
+
Exit status: 0 unbound; 3 your account is not this workspace's owner; 1 any other failure, including a source that is not bound.`).exitOverride().action(async (flags) => {
|
|
137
|
+
const { sourceUnbind } = await import("./chunk-5mezgvms.js");
|
|
138
|
+
code = await sourceUnbind({
|
|
139
|
+
origin: flags.origin ?? "",
|
|
140
|
+
workspace: flags.workspace ?? "",
|
|
141
|
+
source: flags.source ?? "",
|
|
53
142
|
sessionFile: flags.sessionFile,
|
|
54
143
|
json: flags.json === true
|
|
55
144
|
});
|
|
56
145
|
});
|
|
57
146
|
source.command("show").description("Read one source's binding, freshness and position; changes nothing.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--source <id>", "The source id, e.g. src_km").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print one JSON document").exitOverride().action(async (flags) => {
|
|
58
|
-
const { sourceShow } = await import("./chunk-
|
|
147
|
+
const { sourceShow } = await import("./chunk-5mezgvms.js");
|
|
59
148
|
code = await sourceShow({
|
|
60
149
|
origin: flags.origin ?? "",
|
|
61
150
|
workspace: flags.workspace ?? "",
|
|
@@ -64,6 +153,88 @@ Exit status: 0 bound; 3 your account is not this workspace's owner; 4 that sourc
|
|
|
64
153
|
json: flags.json === true
|
|
65
154
|
});
|
|
66
155
|
});
|
|
156
|
+
source.command("set-refresh").description("Give a bound source a refresh interval (1h, 30m, 2d) or clear it with none; as the workspace owner.").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--source <id>", "The source id, e.g. src_km").option("--every <interval>", "45s, 30m, 1h, 2d, or none to clear; the shortest allowed is 5m").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print one JSON document").addHelpText("after", `
|
|
157
|
+
Exit status: 0 set; 3 your account is not this workspace's owner; 1 any other failure, including an interval under 5 minutes.`).exitOverride().action(async (flags) => {
|
|
158
|
+
const { sourceSetRefresh } = await import("./chunk-5mezgvms.js");
|
|
159
|
+
code = await sourceSetRefresh({
|
|
160
|
+
origin: flags.origin ?? "",
|
|
161
|
+
workspace: flags.workspace ?? "",
|
|
162
|
+
source: flags.source ?? "",
|
|
163
|
+
every: flags.every ?? "",
|
|
164
|
+
sessionFile: flags.sessionFile,
|
|
165
|
+
json: flags.json === true
|
|
166
|
+
});
|
|
167
|
+
});
|
|
168
|
+
const service = program.command("service").description("A machine's services under process-compose: list, change, start, stop, read logs; from Hightea or on the machine.").exitOverride();
|
|
169
|
+
const serviceAction = (command, description, options = {}) => {
|
|
170
|
+
const sub = service.command(command).description(description);
|
|
171
|
+
if (options.named)
|
|
172
|
+
sub.argument("<name>", "The service's name, as process-compose knows it");
|
|
173
|
+
sub.option("--host <id>", "The registered host's id; with --local, which of this machine's joined hosts").option("--local", "Act on this machine, in-process, as you").option("--origin <url>", "The deployment, e.g. https://hightea.dev (with --host)").option("--workspace <slug>", "The workspace slug (with --host)").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print the machine's answer as one JSON document");
|
|
174
|
+
if (options.fields) {
|
|
175
|
+
sub.option("--command <cmd>", "The program's command line").option("--cwd <dir>", "The directory it runs in").option("--patch <json>", "Any other service fields, as a JSON object (env, schedule, restart, depends_on, health)");
|
|
176
|
+
}
|
|
177
|
+
if (options.logs) {
|
|
178
|
+
sub.option("--limit <lines>", "How many lines (the machine caps it)").option("--end <lines>", "Lines back from the newest the read ends at (default 0)");
|
|
179
|
+
}
|
|
180
|
+
sub.addHelpText("after", `
|
|
181
|
+
Exit status: 0 done; 3 your account may not manage this host's services; 1 any other failure, named on stderr.`).exitOverride().action(async (...args) => {
|
|
182
|
+
const name = options.named ? String(args[0]) : undefined;
|
|
183
|
+
const flags = options.named ? args[1] : args[0];
|
|
184
|
+
const { serviceCommand } = await import("./chunk-v59kcfmj.js");
|
|
185
|
+
const text = (key) => typeof flags[key] === "string" ? flags[key] : undefined;
|
|
186
|
+
code = await serviceCommand({
|
|
187
|
+
origin: text("origin") ?? "",
|
|
188
|
+
workspace: text("workspace") ?? "",
|
|
189
|
+
host: text("host"),
|
|
190
|
+
local: flags.local === true,
|
|
191
|
+
sessionFile: text("sessionFile"),
|
|
192
|
+
json: flags.json === true
|
|
193
|
+
}, { command, name, fields: { command: text("command"), cwd: text("cwd"), patch: text("patch") }, end: text("end"), limit: text("limit") });
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
serviceAction("list", "List the machine's services, which are read-only and why. Shows commands and paths.");
|
|
197
|
+
serviceAction("add", "Add a service to the machine's own process-compose file.", { named: true, fields: true });
|
|
198
|
+
serviceAction("change", "Change a service in the machine's own process-compose file.", { named: true, fields: true });
|
|
199
|
+
serviceAction("remove", "Take a service out of the machine's own process-compose file.", { named: true });
|
|
200
|
+
serviceAction("start", "Start a service.", { named: true });
|
|
201
|
+
serviceAction("stop", "Stop a service.", { named: true });
|
|
202
|
+
serviceAction("restart", "Restart a service.", { named: true });
|
|
203
|
+
serviceAction("logs", "One bounded read of a service's raw output; nothing is kept.", { named: true, logs: true });
|
|
204
|
+
serviceAction("acknowledge", "Accept the process-compose files as they are now, so drift stops alerting on a hand edit.");
|
|
205
|
+
service.command("backup").description("Show Hightea's backup of a host's services and their change log, labelled with how far it reaches; works while the host is offline or revoked.").requiredOption("--host <id>", "The registered host's id").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--json", "Print the backup as one JSON document").addHelpText("after", `
|
|
206
|
+
Exit status: 0 shown; 3 your account may not read this host's backup; 1 any other failure, named on stderr.`).exitOverride().action(async (flags) => {
|
|
207
|
+
const { serviceBackupCommand } = await import("./chunk-v59kcfmj.js");
|
|
208
|
+
const text = (key) => typeof flags[key] === "string" ? flags[key] : undefined;
|
|
209
|
+
code = await serviceBackupCommand({
|
|
210
|
+
origin: text("origin") ?? "",
|
|
211
|
+
workspace: text("workspace") ?? "",
|
|
212
|
+
host: text("host"),
|
|
213
|
+
local: false,
|
|
214
|
+
sessionFile: text("sessionFile"),
|
|
215
|
+
json: flags.json === true
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
service.command("restore").description("Create a host's backed-up services on a new host, create-only: shows what it will create and asks first.").argument("[names...]", "Which services; every one in the backup when none is named").requiredOption("--from <id>", "The old host whose backup is read").option("--host <id>", "The new registered host's id; with --local, which of this machine's joined hosts").option("--local", "Create them on this machine, in-process, as you").option("--origin <url>", "The deployment, e.g. https://hightea.dev").option("--workspace <slug>", "The workspace slug").option("--session-file <file>", "File holding your signed-in ht_session cookie (default: HIGHTEA_SESSION_FILE)").option("--yes", "Do not ask; for scripts").option("--json", "Print each service's outcome as one JSON document").addHelpText("after", `
|
|
219
|
+
Exit status: 0 every service created; 3 your account may not read the old host's backup; 1 anything else, each named.`).exitOverride().action(async (names, flags) => {
|
|
220
|
+
const { serviceRestore } = await import("./chunk-v59kcfmj.js");
|
|
221
|
+
const text = (key) => typeof flags[key] === "string" ? flags[key] : undefined;
|
|
222
|
+
code = await serviceRestore({
|
|
223
|
+
origin: text("origin") ?? "",
|
|
224
|
+
workspace: text("workspace") ?? "",
|
|
225
|
+
host: text("host"),
|
|
226
|
+
local: flags.local === true,
|
|
227
|
+
sessionFile: text("sessionFile"),
|
|
228
|
+
json: flags.json === true
|
|
229
|
+
}, { from: text("from") ?? "", names, yes: flags.yes === true });
|
|
230
|
+
});
|
|
231
|
+
for (const [verb, enable] of [["enable", true], ["disable", false]]) {
|
|
232
|
+
service.command(verb).description(enable ? "On this machine: let Hightea list, read logs of, change, start and stop this machine's services (adds the services grants)." : "On this machine: stop Hightea managing this machine's services (removes the services grants).").option("--host <id>", "Which of this machine's joined hosts, when it holds more than one").addHelpText("after", `
|
|
233
|
+
Exit status: 0 changed or already so; 1 any failure, named on stderr.`).exitOverride().action(async (flags) => {
|
|
234
|
+
const { hostServicesGrants } = await import("./chunk-3qbh10ga.js");
|
|
235
|
+
code = await hostServicesGrants({ enable, ...typeof flags.host === "string" ? { host: flags.host } : {} });
|
|
236
|
+
});
|
|
237
|
+
}
|
|
67
238
|
try {
|
|
68
239
|
await program.parseAsync([...argv], { from: "user" });
|
|
69
240
|
} catch (error) {
|