@amalgm/shell 0.1.164-main.44537962272 → 0.1.164-main.44849294351
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/PURPOSE.md +11 -13
- package/dist/cli-arguments.d.ts +6 -0
- package/dist/cli-arguments.js +20 -1
- package/dist/cli-arguments.js.map +1 -1
- package/dist/cli-commands.d.ts +61 -0
- package/dist/cli-commands.js +293 -0
- package/dist/cli-commands.js.map +1 -0
- package/dist/cli.js +25 -36
- package/dist/cli.js.map +1 -1
- package/dist/detection/basis-advanced.d.ts +4 -4
- package/dist/detection/basis-advanced.js +4 -4
- package/dist/detection/basis-advanced.js.map +1 -1
- package/dist/detection/repository-state.d.ts +7 -9
- package/dist/detection/repository-state.js +8 -14
- package/dist/detection/repository-state.js.map +1 -1
- package/dist/detection/root-walk.d.ts +1 -5
- package/dist/detection/root-walk.js +1 -1
- package/dist/detection/root-walk.js.map +1 -1
- package/dist/detection/withheld.d.ts +1 -1
- package/dist/git/rail.d.ts +4 -5
- package/dist/git/rail.js +7 -8
- package/dist/git/rail.js.map +1 -1
- package/dist/git/read-state.d.ts +0 -2
- package/dist/git/read-state.js +8 -9
- package/dist/git/read-state.js.map +1 -1
- package/dist/git/write-files.d.ts +3 -3
- package/dist/git/write-files.js +30 -39
- package/dist/git/write-files.js.map +1 -1
- package/dist/main.js +4 -3
- package/dist/main.js.map +1 -1
- package/dist/native/cloud-files.node +0 -0
- package/dist/native/windows-fs.node +0 -0
- package/dist/service/cli.d.ts +6 -1
- package/dist/service/cli.js +18 -33
- package/dist/service/cli.js.map +1 -1
- package/dist/sync-cli.d.ts +1 -1
- package/dist/sync-cli.js +0 -3
- package/dist/sync-cli.js.map +1 -1
- package/npm-shrinkwrap.json +13 -13
- package/package.json +5 -5
package/PURPOSE.md
CHANGED
|
@@ -1265,17 +1265,16 @@ after adoption.
|
|
|
1265
1265
|
and widens only when that object is unknown. Old and new addresses reconcile
|
|
1266
1266
|
under the same complete identity law. Ordinary structural changes still
|
|
1267
1267
|
use broad reconciliation; constant-time named work is not a current claim.
|
|
1268
|
-
A Git lock (`<path>.lock`) is a write in progress
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
lock
|
|
1273
|
-
|
|
1274
|
-
lock
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
therefore cannot prevent completion and is never deleted by observation.
|
|
1268
|
+
A Git lock (`<path>.lock`) is a write in progress on the computer that
|
|
1269
|
+
made it, never repository state and never proof that reading is unsafe
|
|
1270
|
+
(`@amalgm/live` `git/state.ts`). Detect reads the committed files and
|
|
1271
|
+
current physical bytes and closes their normal source witnesses even
|
|
1272
|
+
while a lock exists; no lane waits on a lock at any age, and none ever
|
|
1273
|
+
travels. Moving evidence without a known deadline retries after 250 ms. A
|
|
1274
|
+
stale lock therefore cannot prevent Detect's completion and is never
|
|
1275
|
+
deleted by observation. Apply, writing as one more Git process, waits on
|
|
1276
|
+
a lock standing where it writes (`EBUSY`) until someone removes it, as
|
|
1277
|
+
Git itself does.
|
|
1279
1278
|
Shell's own background Git reads disable optional locks so observation
|
|
1280
1279
|
never rings itself merely by refreshing the index.
|
|
1281
1280
|
Nameless, invalid, startup, and
|
|
@@ -1711,8 +1710,7 @@ after adoption.
|
|
|
1711
1710
|
closes the complete original binding and exclusion proof at Record.
|
|
1712
1711
|
|
|
1713
1712
|
Changed native source evidence refuses capture; the mere existence of a
|
|
1714
|
-
Git lock or a reveal marker does not (
|
|
1715
|
-
law 45). Amalgm's own incomplete reveal is
|
|
1713
|
+
Git lock or a reveal marker does not (law 45). Amalgm's own incomplete reveal is
|
|
1716
1714
|
ground its receipt owns, which Detect leaves unread (law 54). A stable
|
|
1717
1715
|
unfinished merge is portable Checkpoint truth: Shell captures its
|
|
1718
1716
|
unmerged stages, worktree conflict bytes, and merge continuation through
|
package/dist/cli-arguments.d.ts
CHANGED
|
@@ -5,4 +5,10 @@ export interface ParsedArguments {
|
|
|
5
5
|
readonly positionals: readonly string[];
|
|
6
6
|
}
|
|
7
7
|
export declare function parseArguments(args: readonly string[]): ParsedArguments;
|
|
8
|
+
/**
|
|
9
|
+
* `amalgm help files register` and `amalgm -h files register` ask what
|
|
10
|
+
* `amalgm files register --help` does. Words after `--` name a command a
|
|
11
|
+
* module would run, and help runs nothing, so they are left out.
|
|
12
|
+
*/
|
|
13
|
+
export declare function helpLast(args: readonly string[]): readonly string[];
|
|
8
14
|
export declare function option(parsed: ParsedArguments, key: string): string;
|
package/dist/cli-arguments.js
CHANGED
|
@@ -19,6 +19,11 @@ export function parseArguments(args) {
|
|
|
19
19
|
const positionals = [];
|
|
20
20
|
for (let index = 0; index < remaining.length; index += 1) {
|
|
21
21
|
const argument = remaining[index];
|
|
22
|
+
// Help may be asked anywhere, of any command, as often as a person types it.
|
|
23
|
+
if (isHelp(argument)) {
|
|
24
|
+
options.help = true;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
22
27
|
if (!argument.startsWith("--")) {
|
|
23
28
|
positionals.push(argument);
|
|
24
29
|
continue;
|
|
@@ -30,7 +35,7 @@ export function parseArguments(args) {
|
|
|
30
35
|
}
|
|
31
36
|
const key = argument.slice(2);
|
|
32
37
|
const next = remaining[index + 1];
|
|
33
|
-
if (next && !next.startsWith("--")) {
|
|
38
|
+
if (next && !next.startsWith("--") && !isHelp(next)) {
|
|
34
39
|
setOption(key, next);
|
|
35
40
|
index += 1;
|
|
36
41
|
}
|
|
@@ -40,6 +45,20 @@ export function parseArguments(args) {
|
|
|
40
45
|
}
|
|
41
46
|
return { command, options, positionals };
|
|
42
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* `amalgm help files register` and `amalgm -h files register` ask what
|
|
50
|
+
* `amalgm files register --help` does. Words after `--` name a command a
|
|
51
|
+
* module would run, and help runs nothing, so they are left out.
|
|
52
|
+
*/
|
|
53
|
+
export function helpLast(args) {
|
|
54
|
+
if (!["help", "--help", "-h"].includes(args[0] ?? "") || !/^[a-z]/.test(args[1] ?? ""))
|
|
55
|
+
return args;
|
|
56
|
+
const words = args.slice(1);
|
|
57
|
+
return [...(words.includes("--") ? words.slice(0, words.indexOf("--")) : words), "--help"];
|
|
58
|
+
}
|
|
59
|
+
function isHelp(argument) {
|
|
60
|
+
return argument === "--help" || argument === "-h";
|
|
61
|
+
}
|
|
43
62
|
export function option(parsed, key) {
|
|
44
63
|
const value = parsed.options[key];
|
|
45
64
|
return typeof value === "string" ? value : "";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-arguments.js","sourceRoot":"","sources":["../src/cli-arguments.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAQ/E,MAAM,UAAU,cAAc,CAAC,IAAuB;IACpD,MAAM,SAAS,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;IAC5B,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACvD,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;IAC3D,CAAC;IACD,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,WAAW,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAC1D,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC;IAC9D,CAAC;IACD,MAAM,OAAO,GAAG,SAAS,CAAC,KAAK,EAAE,IAAI,MAAM,CAAC;IAC5C,MAAM,OAAO,GAAqC,EAAE,CAAC;IACrD,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,KAAuB,EAAQ,EAAE;QAC/D,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,GAAG,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,GAAG,EAAE,CAAC,CAAC;QAChF,IAAI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AAG,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,MAAM,CAAC,QAAgB;IAC9B,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,KAAK,IAAI,CAAC;AACpD,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,MAAuB,EAAE,GAAW;IACzD,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every command the amalgm CLI answers, each with its own help. The
|
|
3
|
+
* dispatchers know a command only by its entry here, so a command cannot
|
|
4
|
+
* exist without its help, and `--help` or `-h` at any depth answers from the
|
|
5
|
+
* entry it names. A command whose grammar another module owns (Sharing,
|
|
6
|
+
* Keychain, Billing, Automations, the products, Channels) is named here by
|
|
7
|
+
* its summary and answers its own help.
|
|
8
|
+
*/
|
|
9
|
+
/** The version this CLI prints and its runtime reports. */
|
|
10
|
+
export declare const CLI_VERSION: string;
|
|
11
|
+
/** A word or option and what it means: `<path>`, `--mode MODE`. */
|
|
12
|
+
export type Term = readonly [term: string, meaning: string];
|
|
13
|
+
/** A command whose grammar and help are the Shell's. */
|
|
14
|
+
export interface OwnCommand {
|
|
15
|
+
readonly name: string;
|
|
16
|
+
/** One line: what it does. */
|
|
17
|
+
readonly summary: string;
|
|
18
|
+
/** What a person should know beyond the summary, in a few short lines. */
|
|
19
|
+
readonly about?: string;
|
|
20
|
+
/** The words it takes, in order, each written `<word>`. */
|
|
21
|
+
readonly arguments?: readonly Term[];
|
|
22
|
+
/** Options of its own, beyond those every command takes. */
|
|
23
|
+
readonly options?: readonly Term[];
|
|
24
|
+
/** One working example: the words after the command itself, if any. */
|
|
25
|
+
readonly example: string;
|
|
26
|
+
readonly commands?: readonly CliCommand[];
|
|
27
|
+
}
|
|
28
|
+
/** A command another module parses, and whose help that module answers. */
|
|
29
|
+
export interface ModuleCommand {
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly summary: string;
|
|
32
|
+
readonly ownHelp: true;
|
|
33
|
+
}
|
|
34
|
+
export type CliCommand = OwnCommand | ModuleCommand;
|
|
35
|
+
/** Where a list of words leads in the table. */
|
|
36
|
+
export interface Found {
|
|
37
|
+
/** The command words matched, outermost first; empty for amalgm itself. */
|
|
38
|
+
readonly path: readonly string[];
|
|
39
|
+
readonly command: OwnCommand | ModuleCommand | null;
|
|
40
|
+
/** The words after the matched command. */
|
|
41
|
+
readonly rest: readonly string[];
|
|
42
|
+
}
|
|
43
|
+
export declare const CLI_COMMANDS: readonly CliCommand[];
|
|
44
|
+
/** The deepest command a list of words names; the words beyond it are its own. */
|
|
45
|
+
export declare function findCommand(words: readonly string[], within?: readonly CliCommand[]): Found;
|
|
46
|
+
/** What is wrong with a call the table can judge, or null when nothing is. */
|
|
47
|
+
export declare function usageProblem({ path, command, rest }: Found): string | null;
|
|
48
|
+
/**
|
|
49
|
+
* What help asked at these words answers: that command's help, the whole
|
|
50
|
+
* CLI's at the top, or, for a word no command has, the commands there are.
|
|
51
|
+
* A command another module owns answers its own help before this is asked;
|
|
52
|
+
* help that reaches it here, in a form its module did not read, points there.
|
|
53
|
+
*/
|
|
54
|
+
export declare function helpAnswer(found: Found): {
|
|
55
|
+
readonly code: 0 | 2;
|
|
56
|
+
readonly text: string;
|
|
57
|
+
};
|
|
58
|
+
/** One command's help: usage, what it does, its words and options, an example. */
|
|
59
|
+
export declare function commandHelp(path: readonly string[], command: OwnCommand): string;
|
|
60
|
+
/** The whole CLI at a glance. */
|
|
61
|
+
export declare function generalHelp(version: string): string;
|
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Every command the amalgm CLI answers, each with its own help. The
|
|
3
|
+
* dispatchers know a command only by its entry here, so a command cannot
|
|
4
|
+
* exist without its help, and `--help` or `-h` at any depth answers from the
|
|
5
|
+
* entry it names. A command whose grammar another module owns (Sharing,
|
|
6
|
+
* Keychain, Billing, Automations, the products, Channels) is named here by
|
|
7
|
+
* its summary and answers its own help.
|
|
8
|
+
*/
|
|
9
|
+
import { readFileSync } from "node:fs";
|
|
10
|
+
import { commandDefinitions } from "@amalgm/live/sharing";
|
|
11
|
+
/** The version this CLI prints and its runtime reports. */
|
|
12
|
+
export const CLI_VERSION = String(JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version);
|
|
13
|
+
const SETUP_CODE = ["--setup-code CODE", "Sign in with a setup code from amalgm.ai instead of a browser"];
|
|
14
|
+
const NO_OPEN = ["--no-open", "Print the sign-in link without opening a browser"];
|
|
15
|
+
const NAME = ["--name NAME", "What to call this computer (default: its own name)"];
|
|
16
|
+
const EXIT_AFTER_READY = ["--exit-after-ready", "Stop once the runtime is ready (for examinations)"];
|
|
17
|
+
/** Shared by `amalgm start` and `amalgm service start`, and likewise stop. */
|
|
18
|
+
const START = {
|
|
19
|
+
name: "start",
|
|
20
|
+
summary: "Start the runtime's OS service, installing it the first time",
|
|
21
|
+
example: "--user you@example.com",
|
|
22
|
+
};
|
|
23
|
+
const STOP = {
|
|
24
|
+
name: "stop",
|
|
25
|
+
summary: "Stop the runtime's OS service",
|
|
26
|
+
example: "--user you@example.com",
|
|
27
|
+
};
|
|
28
|
+
const SERVICE = {
|
|
29
|
+
name: "service",
|
|
30
|
+
summary: "Keep the runtime running whenever you are logged in",
|
|
31
|
+
about: `The service is a keepalive the OS runs: a LaunchAgent on macOS, a systemd
|
|
32
|
+
user unit on Linux, a Task Scheduler task on Windows. It runs amalgm run and
|
|
33
|
+
restarts it whenever it exits or stops answering, waiting longer after each
|
|
34
|
+
failure, up to five minutes. Only stop and uninstall end it.`,
|
|
35
|
+
example: "install --user you@example.com",
|
|
36
|
+
commands: [
|
|
37
|
+
{
|
|
38
|
+
name: "install",
|
|
39
|
+
summary: "Register the service with the OS and start it",
|
|
40
|
+
about: "The options given here (--home, --app-url and the rest) are the ones the service runs with.",
|
|
41
|
+
options: [["--mode MODE", "auto, launchd, systemd, windows or portable (default: auto)"]],
|
|
42
|
+
example: "--user you@example.com",
|
|
43
|
+
},
|
|
44
|
+
START,
|
|
45
|
+
STOP,
|
|
46
|
+
{
|
|
47
|
+
name: "retry",
|
|
48
|
+
summary: "Restart a failing runtime now, skipping its wait",
|
|
49
|
+
example: "--user you@example.com",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "status",
|
|
53
|
+
summary: "Show whether the service is registered and running",
|
|
54
|
+
example: "--user you@example.com",
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "uninstall",
|
|
58
|
+
summary: "Stop the service and remove it from the OS",
|
|
59
|
+
example: "--user you@example.com",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "keepalive",
|
|
63
|
+
summary: "What the OS runs to keep the runtime alive",
|
|
64
|
+
about: "In portable mode, run it yourself as the foreground entrypoint.",
|
|
65
|
+
example: "--user you@example.com",
|
|
66
|
+
},
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
const UUID_EXAMPLE = "0192f3a0-7c1e-7d2a-9b3e-4f5a6b7c8d9e";
|
|
70
|
+
export const CLI_COMMANDS = [
|
|
71
|
+
{
|
|
72
|
+
name: "setup",
|
|
73
|
+
summary: "Sign in, then keep the runtime running as an OS service",
|
|
74
|
+
about: "Returns once the service's runtime answers.",
|
|
75
|
+
options: [SETUP_CODE, NAME, NO_OPEN],
|
|
76
|
+
example: "",
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: "login",
|
|
80
|
+
summary: "Sign in on this computer and run the runtime here until stopped",
|
|
81
|
+
about: `Where this computer can serve a drive, your home is one: every file is
|
|
82
|
+
listed, and its bytes arrive the first time something opens it. Elsewhere the
|
|
83
|
+
whole home downloads. amalgm status says which, and why.`,
|
|
84
|
+
options: [SETUP_CODE, NAME, NO_OPEN, EXIT_AFTER_READY],
|
|
85
|
+
example: "",
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "run",
|
|
89
|
+
summary: "Run the runtime here in the foreground until stopped",
|
|
90
|
+
options: [EXIT_AFTER_READY],
|
|
91
|
+
example: "--user you@example.com",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "mount",
|
|
95
|
+
summary: "Run a runtime whose disk goes away after it stops",
|
|
96
|
+
about: `Each change to what runs prints one AMALGM_ACTIVITY line. A stop signal, or
|
|
97
|
+
--exit-when-idle, takes no new work and exits 0 once nothing runs; a second
|
|
98
|
+
signal stops at once and exits 1, naming what still ran.`,
|
|
99
|
+
options: [["--exit-when-idle MINUTES", "Stop after this many minutes with nothing running"], EXIT_AFTER_READY],
|
|
100
|
+
example: "--user you@example.com --exit-when-idle 10",
|
|
101
|
+
},
|
|
102
|
+
START,
|
|
103
|
+
STOP,
|
|
104
|
+
{
|
|
105
|
+
name: "status",
|
|
106
|
+
summary: "Show whether the runtime runs, and whether your home is a drive",
|
|
107
|
+
example: "--user you@example.com",
|
|
108
|
+
},
|
|
109
|
+
SERVICE,
|
|
110
|
+
{
|
|
111
|
+
name: "sync",
|
|
112
|
+
summary: "Pause or resume sync on this computer, or see its state",
|
|
113
|
+
example: "status",
|
|
114
|
+
commands: [
|
|
115
|
+
{ name: "status", summary: "Show the saved setting and what is running", example: "" },
|
|
116
|
+
{ name: "pause", summary: "Pause sync; the runtime and chat keep running", example: "" },
|
|
117
|
+
{ name: "resume", summary: "Turn sync back on and catch up", example: "" },
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "auth",
|
|
122
|
+
summary: "Repair this computer's sign-in",
|
|
123
|
+
example: "recover",
|
|
124
|
+
commands: [
|
|
125
|
+
{
|
|
126
|
+
name: "recover",
|
|
127
|
+
summary: "Replace a missing, broken or rejected device key once you approve it in a browser",
|
|
128
|
+
options: [SETUP_CODE, NO_OPEN],
|
|
129
|
+
example: "",
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "files",
|
|
135
|
+
summary: "Register, add and trash workspaces, and see your Files plan",
|
|
136
|
+
example: "register ~/projects/site",
|
|
137
|
+
commands: [
|
|
138
|
+
{
|
|
139
|
+
name: "register",
|
|
140
|
+
summary: "Make one folder a workspace: upload it and keep it in sync",
|
|
141
|
+
arguments: [["<path>", "The folder to register; it stays where it is"]],
|
|
142
|
+
example: "~/projects/site",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "add",
|
|
146
|
+
summary: "Download one of your workspaces into the current folder and keep it in sync",
|
|
147
|
+
arguments: [["<workspace-id>", "The workspace's ID"]],
|
|
148
|
+
example: UUID_EXAMPLE,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "trash",
|
|
152
|
+
summary: "Put an item in Trash, or delete from Trash for good",
|
|
153
|
+
about: `Never a root, and only in roots this computer holds whole; the web
|
|
154
|
+
empties the rest.`,
|
|
155
|
+
example: "empty",
|
|
156
|
+
commands: [
|
|
157
|
+
{
|
|
158
|
+
name: "move",
|
|
159
|
+
summary: "Put one item in Trash, a folder with everything inside it",
|
|
160
|
+
arguments: [["<uuid>", "The item's ID"]],
|
|
161
|
+
example: UUID_EXAMPLE,
|
|
162
|
+
},
|
|
163
|
+
{ name: "empty", summary: "Delete everything in Trash for good", example: "" },
|
|
164
|
+
{
|
|
165
|
+
name: "delete",
|
|
166
|
+
summary: "Delete one item in Trash for good",
|
|
167
|
+
arguments: [["<uuid>", "The item's ID"]],
|
|
168
|
+
example: UUID_EXAMPLE,
|
|
169
|
+
},
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
{ name: "billing", summary: "Your Files plan: status, usage, plans, pay, cancel and more", ownHelp: true },
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
{ name: "automations", summary: "Create, list, change and run automations", ownHelp: true },
|
|
176
|
+
{ name: "agents", summary: "Your agents, as the agents MCP tools see them", ownHelp: true },
|
|
177
|
+
{ name: "tools", summary: "Your toolbox: find and run tools", ownHelp: true },
|
|
178
|
+
{ name: "apps", summary: "Your apps: run, release and roll back", ownHelp: true },
|
|
179
|
+
{ name: "browser", summary: "The runtime's browser", ownHelp: true },
|
|
180
|
+
{ name: "channels", summary: "Send one message through the running runtime", ownHelp: true },
|
|
181
|
+
...commandDefinitions.map((definition) => ({
|
|
182
|
+
name: definition.name, summary: definition.title, ownHelp: true,
|
|
183
|
+
})),
|
|
184
|
+
{ name: "keychain", summary: "Your secrets, on every computer", ownHelp: true },
|
|
185
|
+
{
|
|
186
|
+
name: "diagnostics",
|
|
187
|
+
summary: "Show the failures of ours this computer kept",
|
|
188
|
+
example: "show",
|
|
189
|
+
commands: [
|
|
190
|
+
{
|
|
191
|
+
name: "show",
|
|
192
|
+
summary: "Print each failure this computer kept, one JSON line each, and whether it was sent",
|
|
193
|
+
about: `Nothing leaves this computer but what this prints: no name, path or
|
|
194
|
+
message. AMALGM_DIAGNOSTICS=off keeps none.`,
|
|
195
|
+
example: "",
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
{ name: "version", summary: "Print this runtime's version", example: "" },
|
|
200
|
+
];
|
|
201
|
+
/** The deepest command a list of words names; the words beyond it are its own. */
|
|
202
|
+
export function findCommand(words, within = CLI_COMMANDS) {
|
|
203
|
+
const path = [];
|
|
204
|
+
let command = null;
|
|
205
|
+
let children = within;
|
|
206
|
+
while (children && path.length < words.length) {
|
|
207
|
+
const next = children.find(({ name }) => name === words[path.length]);
|
|
208
|
+
if (!next)
|
|
209
|
+
break;
|
|
210
|
+
command = next;
|
|
211
|
+
path.push(next.name);
|
|
212
|
+
children = "ownHelp" in next ? undefined : next.commands;
|
|
213
|
+
}
|
|
214
|
+
return { path, command, rest: words.slice(path.length) };
|
|
215
|
+
}
|
|
216
|
+
/** What is wrong with a call the table can judge, or null when nothing is. */
|
|
217
|
+
export function usageProblem({ path, command, rest }) {
|
|
218
|
+
if (command && "ownHelp" in command)
|
|
219
|
+
return null;
|
|
220
|
+
const children = command ? command.commands : CLI_COMMANDS;
|
|
221
|
+
const named = ["amalgm", ...path].join(" ");
|
|
222
|
+
if (children) {
|
|
223
|
+
const list = children.map(({ name }) => name).join(", ");
|
|
224
|
+
const learn = `Run ${named} --help to learn them.\n`;
|
|
225
|
+
if (rest.length === 0)
|
|
226
|
+
return `${named} needs a command: ${list}.\n${learn}`;
|
|
227
|
+
return `Unknown command: ${named} ${rest[0]}\nThe ${path.length ? `${path.join(" ")} ` : ""}commands are: ${list}.\n${learn}`;
|
|
228
|
+
}
|
|
229
|
+
const own = command;
|
|
230
|
+
if (rest.length === (own.arguments?.length ?? 0))
|
|
231
|
+
return null;
|
|
232
|
+
return `Usage: ${usageLine(path, own)}\nRun ${named} --help to learn it.\n`;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* What help asked at these words answers: that command's help, the whole
|
|
236
|
+
* CLI's at the top, or, for a word no command has, the commands there are.
|
|
237
|
+
* A command another module owns answers its own help before this is asked;
|
|
238
|
+
* help that reaches it here, in a form its module did not read, points there.
|
|
239
|
+
*/
|
|
240
|
+
export function helpAnswer(found) {
|
|
241
|
+
const { path, command, rest } = found;
|
|
242
|
+
if (command && "ownHelp" in command)
|
|
243
|
+
return { code: 2, text: `Run amalgm ${path.join(" ")} --help to learn it.\n` };
|
|
244
|
+
if ((!command || command.commands) && rest.length > 0)
|
|
245
|
+
return { code: 2, text: usageProblem(found) };
|
|
246
|
+
return { code: 0, text: command ? commandHelp(path, command) : generalHelp(CLI_VERSION) };
|
|
247
|
+
}
|
|
248
|
+
/** One command's help: usage, what it does, its words and options, an example. */
|
|
249
|
+
export function commandHelp(path, command) {
|
|
250
|
+
const sections = [
|
|
251
|
+
`Usage: ${usageLine(path, command)}`,
|
|
252
|
+
[command.summary, ...(command.about ? [command.about] : [])].join("\n\n"),
|
|
253
|
+
...(command.arguments ? [terms("Arguments:", command.arguments)] : []),
|
|
254
|
+
...(command.options ? [terms("Options:", command.options)] : []),
|
|
255
|
+
...(command.commands ? [terms("Commands:", command.commands.map(({ name, summary }) => [name, summary]))] : []),
|
|
256
|
+
`Example:\n ${["amalgm", ...path, command.example].filter(Boolean).join(" ")}`,
|
|
257
|
+
"Every command also takes --user EMAIL, --home PATH and --app-url URL; amalgm --help says what they do.",
|
|
258
|
+
];
|
|
259
|
+
return `${sections.join("\n\n")}\n`;
|
|
260
|
+
}
|
|
261
|
+
/** The whole CLI at a glance. */
|
|
262
|
+
export function generalHelp(version) {
|
|
263
|
+
return `${[
|
|
264
|
+
`amalgm ${version}`,
|
|
265
|
+
"Usage: amalgm <command> [options]",
|
|
266
|
+
terms("Commands:", CLI_COMMANDS.map(({ name, summary }) => [name, summary])),
|
|
267
|
+
"Run amalgm <command> --help to learn one, such as amalgm files register --help.",
|
|
268
|
+
terms("Environments:", [
|
|
269
|
+
["amalgm ...", "Production: ~/amalgm"],
|
|
270
|
+
["amalgm preview ...", "Preview: ~/amalgm-preview"],
|
|
271
|
+
["amalgm dev ... --profile FILE", "Local: ~/amalgm-dev/SESSION"],
|
|
272
|
+
]),
|
|
273
|
+
terms("Options every command takes:", [
|
|
274
|
+
["--user EMAIL", "Pick one of several people signed in on this computer"],
|
|
275
|
+
["--home PATH", "Use this folder as the home instead of yours"],
|
|
276
|
+
["--app-url URL", "The Amalgm control plane (default: https://amalgm.ai)"],
|
|
277
|
+
]),
|
|
278
|
+
].join("\n\n")}\n`;
|
|
279
|
+
}
|
|
280
|
+
function usageLine(path, command) {
|
|
281
|
+
return [
|
|
282
|
+
"amalgm",
|
|
283
|
+
...path,
|
|
284
|
+
...(command.commands ? ["<command>"] : []),
|
|
285
|
+
...(command.arguments ?? []).map(([term]) => term),
|
|
286
|
+
...(command.options ?? []).map(([term]) => `[${term}]`),
|
|
287
|
+
].join(" ");
|
|
288
|
+
}
|
|
289
|
+
function terms(heading, rows) {
|
|
290
|
+
const width = Math.max(...rows.map(([term]) => term.length));
|
|
291
|
+
return [heading, ...rows.map(([term, meaning]) => ` ${term.padEnd(width)} ${meaning}`)].join("\n");
|
|
292
|
+
}
|
|
293
|
+
//# sourceMappingURL=cli-commands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-commands.js","sourceRoot":"","sources":["../src/cli-commands.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,2DAA2D;AAC3D,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAC1C,YAAY,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAClE,CAAC,OAAO,CAAC,CAAC;AAuCX,MAAM,UAAU,GAAS,CAAC,mBAAmB,EAAE,+DAA+D,CAAC,CAAC;AAChH,MAAM,OAAO,GAAS,CAAC,WAAW,EAAE,kDAAkD,CAAC,CAAC;AACxF,MAAM,IAAI,GAAS,CAAC,aAAa,EAAE,oDAAoD,CAAC,CAAC;AACzF,MAAM,gBAAgB,GAAS,CAAC,oBAAoB,EAAE,mDAAmD,CAAC,CAAC;AAE3G,8EAA8E;AAC9E,MAAM,KAAK,GAAe;IACxB,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,8DAA8D;IACvE,OAAO,EAAE,wBAAwB;CAClC,CAAC;AACF,MAAM,IAAI,GAAe;IACvB,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,+BAA+B;IACxC,OAAO,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zE,CAAC,aAAa,EAAE,8CAA8C,CAAC;YAC/D,CAAC,eAAe,EAAE,uDAAuD,CAAC;SAC3E,CAAC;KACH,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,SAAS,SAAS,CAAC,IAAuB,EAAE,OAAmB;IAC7D,OAAO;QACL,QAAQ;QACR,GAAG,IAAI;QACP,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC1C,GAAG,CAAC,OAAO,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC;QAClD,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,IAAI,GAAG,CAAC;KACxD,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACd,CAAC;AAED,SAAS,KAAK,CAAC,OAAe,EAAE,IAAqB;IACnD,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC7D,OAAO,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACvG,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
|
-
import { readFileSync } from "node:fs";
|
|
3
2
|
import { homedir as osHomedir } from "node:os";
|
|
4
3
|
import { resolve } from "node:path";
|
|
5
4
|
import { performance } from "node:perf_hooks";
|
|
@@ -9,7 +8,8 @@ import { splitRuntimeArgv } from "./runtime-argv.js";
|
|
|
9
8
|
import { MachineHost, defaultMachineName } from "./machine-host.js";
|
|
10
9
|
import { renderStageLedger } from "./files-trace.js";
|
|
11
10
|
import { backgroundErrorLine } from "./background-error.js";
|
|
12
|
-
import { parseArguments, option } from "./cli-arguments.js";
|
|
11
|
+
import { helpLast, parseArguments, option } from "./cli-arguments.js";
|
|
12
|
+
import { CLI_VERSION as VERSION, findCommand, helpAnswer, usageProblem } from "./cli-commands.js";
|
|
13
13
|
import { selectRuntimeInvocation, resolveInvocationBinding } from "./installation/selection.js";
|
|
14
14
|
import { runtimeAppOrigin, runtimeHostedEndpoints } from "./installation/environment.js";
|
|
15
15
|
import { laneLayout, laneRoot, resolveRuntimeBinding } from "@amalgm/core/identity";
|
|
@@ -20,7 +20,6 @@ import { processShutdown, reportRuntimeReady, waitForShutdown } from './process-
|
|
|
20
20
|
import { RUNTIME_COMMAND_STOPPED } from './runtime-command-host.js';
|
|
21
21
|
import { resolveAvailableInstallation } from '@amalgm/core/supervision';
|
|
22
22
|
import { shellReleaseCatalog } from './release-catalog.js';
|
|
23
|
-
const VERSION = String(JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8")).version);
|
|
24
23
|
export async function runCli(argv = process.argv, signal, profile) {
|
|
25
24
|
const owned = signal ? null : processShutdown();
|
|
26
25
|
try {
|
|
@@ -37,7 +36,8 @@ export async function runCli(argv = process.argv, signal, profile) {
|
|
|
37
36
|
async function runSelectedCli(argv, shutdown, profile) {
|
|
38
37
|
if (shutdown.aborted)
|
|
39
38
|
return 130;
|
|
40
|
-
const
|
|
39
|
+
const selected = selectRuntimeInvocation(argv.slice(2));
|
|
40
|
+
const invocation = { ...selected, args: helpLast(selected.args) };
|
|
41
41
|
// A Sharing verb's syntax is Live's, not the Shell's: its argv is split
|
|
42
42
|
// rather than parsed, so a list flag given more than once survives.
|
|
43
43
|
const sharing = SHARING_COMMANDS.has(invocation.args[0] ?? "")
|
|
@@ -80,13 +80,19 @@ async function runSelectedCli(argv, shutdown, profile) {
|
|
|
80
80
|
return 0;
|
|
81
81
|
}
|
|
82
82
|
if (parsed.command === "channels"
|
|
83
|
-
&& (parsed.options.help || [undefined, "help"
|
|
83
|
+
&& (parsed.options.help || [undefined, "help"].includes(parsed.positionals[0]))) {
|
|
84
84
|
process.stdout.write((await import("@amalgm/channels/cli")).channelsCliHelp);
|
|
85
85
|
return 0;
|
|
86
86
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
// Every command the Shell itself parses is in the one table, which says its
|
|
88
|
+
// help and judges its words (cli-commands.ts).
|
|
89
|
+
const found = findCommand(parsed.command === "help" ? parsed.positionals : [parsed.command, ...parsed.positionals]);
|
|
90
|
+
// A module above answers its own help; help that reaches here unanswered
|
|
91
|
+
// never runs anything.
|
|
92
|
+
const help = parsed.command === "help" || parsed.options.help ? helpAnswer(found) : null;
|
|
93
|
+
if (help) {
|
|
94
|
+
(help.code === 0 ? process.stdout : process.stderr).write(help.text);
|
|
95
|
+
return help.code;
|
|
90
96
|
}
|
|
91
97
|
if (parsed.command === "version" || parsed.options.version) {
|
|
92
98
|
if (parsed.options['runtime-contract']) {
|
|
@@ -96,17 +102,17 @@ async function runSelectedCli(argv, shutdown, profile) {
|
|
|
96
102
|
process.stdout.write(`${parsed.options['setup-protocol'] ? '1' : VERSION}\n`);
|
|
97
103
|
return 0;
|
|
98
104
|
}
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
process.stderr.write(`Unknown command: ${parsed.command}\n\n${helpText()}`);
|
|
105
|
+
const problem = usageProblem(found);
|
|
106
|
+
if (problem) {
|
|
107
|
+
process.stderr.write(problem);
|
|
108
|
+
return 2;
|
|
109
|
+
}
|
|
110
|
+
// Billing reads its own words, so a Shell option put before them is not its.
|
|
111
|
+
if (found.path[1] === "billing" && !billing) {
|
|
112
|
+
process.stderr.write("Put options after the command, as in amalgm files billing --help.\n");
|
|
108
113
|
return 2;
|
|
109
114
|
}
|
|
115
|
+
const filesCommand = parsed.command === "files" ? parsed.positionals[0] : undefined;
|
|
110
116
|
const binding = resolveInvocationBinding(invocation.runtimeLabel, parsed);
|
|
111
117
|
if (parsed.command === "diagnostics") {
|
|
112
118
|
const { showDiagnostics } = await import("./faults/show.js");
|
|
@@ -234,8 +240,6 @@ async function runSelectedCli(argv, shutdown, profile) {
|
|
|
234
240
|
return 0;
|
|
235
241
|
}
|
|
236
242
|
if (parsed.command === 'sync') {
|
|
237
|
-
if (parsed.positionals.length !== 1)
|
|
238
|
-
throw new Error('Usage: amalgm sync <status|pause|resume> --user EMAIL');
|
|
239
243
|
await (await import('./sync-cli.js')).runSyncCommand(host, parsed.positionals[0], shutdown);
|
|
240
244
|
return 0;
|
|
241
245
|
}
|
|
@@ -252,20 +256,12 @@ async function runSelectedCli(argv, shutdown, profile) {
|
|
|
252
256
|
}
|
|
253
257
|
if (parsed.command === "files" && filesCommand === "trash") {
|
|
254
258
|
const [, act, uuid] = parsed.positionals;
|
|
255
|
-
const pick = act === "empty"
|
|
256
|
-
: act === "delete" && parsed.positionals.length === 3 ? { pick: "one", uuid }
|
|
257
|
-
: act === "move" && parsed.positionals.length === 3 ? { pick: "move", uuid }
|
|
258
|
-
: null;
|
|
259
|
-
if (!pick)
|
|
260
|
-
throw new Error("Usage: amalgm files trash <move UUID | empty | delete UUID>");
|
|
259
|
+
const pick = act === "empty" ? { pick: "all" } : act === "delete" ? { pick: "one", uuid } : { pick: "move", uuid };
|
|
261
260
|
const outcome = await host.callFilesRuntime("/entities/trash", pick, shutdown);
|
|
262
261
|
process.stdout.write(`AMALGM_FILES ${JSON.stringify({ command: "trash", ...outcome })}\n`);
|
|
263
262
|
return 0;
|
|
264
263
|
}
|
|
265
264
|
if (parsed.command === "files") {
|
|
266
|
-
if (parsed.positionals.length !== 2) {
|
|
267
|
-
throw new Error(`Usage: amalgm files ${filesCommand} <${filesCommand === "register" ? "path" : "workspace-id"}>`);
|
|
268
|
-
}
|
|
269
265
|
const result = filesCommand === "register"
|
|
270
266
|
? await host.callFilesRuntime("/entities/register", {
|
|
271
267
|
path: parsed.positionals[1],
|
|
@@ -284,9 +280,6 @@ async function runSelectedCli(argv, shutdown, profile) {
|
|
|
284
280
|
return 0;
|
|
285
281
|
}
|
|
286
282
|
if (parsed.command === "auth") {
|
|
287
|
-
if (authCommand !== "recover" || parsed.positionals.length !== 1) {
|
|
288
|
-
throw new Error("Usage: amalgm auth recover [--setup-code CODE] --user EMAIL");
|
|
289
|
-
}
|
|
290
283
|
const result = await host.recoverAuthorizationKey({
|
|
291
284
|
...(option(parsed, "setup-code") ? { setupCode: option(parsed, "setup-code") } : {}),
|
|
292
285
|
});
|
|
@@ -457,8 +450,7 @@ function channelsArguments(parsed) {
|
|
|
457
450
|
function productHelp(parsed) {
|
|
458
451
|
return parsed.positionals.length === 0
|
|
459
452
|
|| parsed.positionals[0] === "help"
|
|
460
|
-
|| parsed.
|
|
461
|
-
|| parsed.options.help === true;
|
|
453
|
+
|| Boolean(parsed.options.help);
|
|
462
454
|
}
|
|
463
455
|
function openBrowser(url) {
|
|
464
456
|
const command = process.platform === "darwin" ? "open" : process.platform === "win32" ? "cmd" : "xdg-open";
|
|
@@ -478,7 +470,4 @@ function keychainHelp(args) {
|
|
|
478
470
|
const own = args.includes("--") ? args.slice(0, args.indexOf("--")) : args;
|
|
479
471
|
return own[0] === undefined || own[0] === "help" || own.includes("--help") || own.includes("-h");
|
|
480
472
|
}
|
|
481
|
-
function helpText() {
|
|
482
|
-
return `amalgm ${VERSION}\n\nUsage:\n amalgm setup [--setup-code CODE] (finite setup and OS service)\n amalgm login [--setup-code CODE] [--no-open]\n amalgm start --user EMAIL\n amalgm stop --user EMAIL\n amalgm run --user EMAIL (foreground)\n amalgm mount --user EMAIL [--exit-when-idle MINUTES]\n (foreground; stops only when nothing runs)\n amalgm status --user EMAIL\n amalgm auth recover [--setup-code CODE] --user EMAIL\n amalgm sync <status|pause|resume> --user EMAIL\n amalgm files register <path> --user EMAIL\n amalgm files add <workspace-id> --user EMAIL\n amalgm files trash <move UUID|empty|delete UUID> --user EMAIL\n amalgm files billing <command> [--json] [--yes] --user EMAIL\n amalgm automations <command> [--input JSON | --file PATH | --stdin]\n amalgm <agents|tools|apps|browser> <command> [--input JSON | --file PATH | --stdin] --user EMAIL\n amalgm channels send --input JSON --user EMAIL\n amalgm <share|link|access|unshare|publish|unpublish|download|request> [...] --user EMAIL\n amalgm keychain <command> [...] --user EMAIL\n amalgm diagnostics show\n\nEnvironments:\n amalgm ... Production: ~/amalgm\n amalgm preview ... Preview: ~/amalgm-preview\n amalgm dev ... --branch BRANCH --local-session SESSION --app-url URL\n Local: ~/amalgm-dev/SESSION\n\nAuthorization:\n recover Replace a missing, corrupt, or rejected device key after browser approval\n\nSync:\n pause Pause sync in place; keep the runtime and chat running\n resume Deliberately enable sync and reconcile through the existing system\n status Show the saved setting and the running state\n\nFiles:\n register Register, watch, upload, and commit one external workspace\n add Materialize one owned cloud workspace through the running Watch host\n trash move UUID: put one item, a folder with all inside it, in Trash,\n as the web does. Delete for good: everything in Trash (empty), or\n one item in it (delete UUID). Nothing outside Trash, and never a\n root. Only roots this computer holds whole; the web empties the rest\n billing The Files plan: status, plans, usage, preview, plan, pay, cancel,\n resume, history, payment-methods; cards are added in the browser.\n \`amalgm files billing --help\` lists every command\n\nAutomations:\n create, list, get, update, delete, run-now\n Use the same JSON objects and results as Automations MCP\n\nAgents, Tools, Apps, Browser:\n --help Lists the product's commands; each uses the same JSON objects\n and results as that product's MCP tools\n\nChannels:\n send Send one deliberate message through the running authenticated Shell\n\nSharing:\n share, link, access, unshare, publish, unpublish, download, request\n Who may open an agent, automation, app, or tool. Identical to the\n Sharing MCP tools; \`amalgm share --help\` lists every field\n\nKeychain:\n Your one vault of secrets on every computer; \`amalgm keychain help\` lists\n every command\n\nDiagnostics:\n show Every failure of ours this computer kept, one JSON line each, and\n whether it has been sent. Nothing leaves but what this prints:\n no name, path or message. AMALGM_DIAGNOSTICS=off keeps none\n\nMount:\n A runtime whose disk is destroyed after it stops. Each change to what runs\n is one AMALGM_ACTIVITY line; a stop signal, or staying idle for\n --exit-when-idle minutes, takes no new work and exits 0 once nothing runs.\n A second signal stops at once and exits 1, naming what still ran.\n\nDrive:\n Login makes the person's home the drive wherever this computer can serve\n it: their conventional home, amalgm/users/EMAIL, is served on demand over\n all their files: the core root, and each folder added on any computer\n at files/COMPUTER/ and the path it has there, all listed from the map\n and placed on first touch; their .amalgmignore is always real bytes.\n This computer's own added folders stand where they live, never again in\n files/. The ground itself stands on a shelf of the lane's.\n The drive lives with the runtime: run, mount and the service's start\n bring it back from what this computer holds, and stop unmounts it. On\n macOS it is served through the system's own NFS client, with nothing to\n install; on Linux through FUSE, which needs /dev/fuse and\n @cocalc/fuse-native, named by AMALGM_FUSE_MODULE when it is not installed\n beside amalgm; on Windows through its own Cloud Files sync root, with the\n binding amalgm ships. A computer that already holds a downloaded home\n keeps it, and elsewhere the home is the whole download; amalgm status\n says which, and why\n\nOptions:\n --app-url URL Amalgm control plane (default: https://amalgm.ai)\n --home PATH OS home override\n --user EMAIL Select one of multiple local users\n --name NAME Computer display name\n --exit-after-ready Examination-only: prove readiness, then stop\n`;
|
|
483
|
-
}
|
|
484
473
|
//# sourceMappingURL=cli.js.map
|