@silicaclaw/cli 1.0.0-beta.30 → 1.0.0-beta.32
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/README.md +2 -0
- package/package.json +1 -1
- package/scripts/silicaclaw-cli.mjs +11 -11
- package/scripts/silicaclaw-gateway.mjs +5 -13
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -122,6 +122,10 @@ function userEnvFile() {
|
|
|
122
122
|
return resolve(homedir(), ".silicaclaw", "env.sh");
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
function userNpmCacheDir() {
|
|
126
|
+
return resolve(homedir(), ".silicaclaw", "npm-cache");
|
|
127
|
+
}
|
|
128
|
+
|
|
125
129
|
function ensureLineInFile(filePath, block) {
|
|
126
130
|
try {
|
|
127
131
|
const current = existsSync(filePath) ? readFileSync(filePath, "utf8") : "";
|
|
@@ -190,9 +194,11 @@ function installPersistentCommand() {
|
|
|
190
194
|
const binDir = userShimDir();
|
|
191
195
|
const shimPath = userShimPath();
|
|
192
196
|
const envFile = userEnvFile();
|
|
197
|
+
const npmCacheDir = userNpmCacheDir();
|
|
193
198
|
const envBlock = [
|
|
194
199
|
"#!/usr/bin/env bash",
|
|
195
200
|
'export PATH="$HOME/.silicaclaw/bin:$PATH"',
|
|
201
|
+
'export npm_config_cache="$HOME/.silicaclaw/npm-cache"',
|
|
196
202
|
"",
|
|
197
203
|
].join("\n");
|
|
198
204
|
const rcBlock = [
|
|
@@ -202,12 +208,14 @@ function installPersistentCommand() {
|
|
|
202
208
|
].join("\n");
|
|
203
209
|
|
|
204
210
|
mkdirSync(binDir, { recursive: true });
|
|
211
|
+
mkdirSync(npmCacheDir, { recursive: true });
|
|
205
212
|
writeFileSync(envFile, envBlock, { encoding: "utf8", mode: 0o755 });
|
|
206
213
|
writeFileSync(
|
|
207
214
|
shimPath,
|
|
208
215
|
[
|
|
209
216
|
"#!/usr/bin/env bash",
|
|
210
217
|
"set -euo pipefail",
|
|
218
|
+
'export npm_config_cache="${npm_config_cache:-$HOME/.silicaclaw/npm-cache}"',
|
|
211
219
|
'exec npx -y @silicaclaw/cli@beta "$@"',
|
|
212
220
|
"",
|
|
213
221
|
].join("\n"),
|
|
@@ -429,24 +437,16 @@ function update() {
|
|
|
429
437
|
function help() {
|
|
430
438
|
headline();
|
|
431
439
|
console.log("");
|
|
432
|
-
section("
|
|
440
|
+
section("Commands");
|
|
433
441
|
kv("Install", "npx -y @silicaclaw/cli@beta install");
|
|
434
|
-
kv("Start", "silicaclaw start
|
|
442
|
+
kv("Start", "silicaclaw start");
|
|
435
443
|
kv("Status", "silicaclaw status");
|
|
436
444
|
kv("Stop", "silicaclaw stop");
|
|
437
445
|
kv("Update", "silicaclaw update");
|
|
438
|
-
console.log("");
|
|
439
|
-
section("Setup and network");
|
|
440
446
|
kv("Onboard", "silicaclaw onboard");
|
|
441
447
|
kv("Connect", "silicaclaw connect");
|
|
442
|
-
kv("
|
|
443
|
-
kv("Signaling", "silicaclaw signaling");
|
|
444
|
-
console.log("");
|
|
445
|
-
section("Local apps");
|
|
446
|
-
kv("Console", "silicaclaw local-console");
|
|
447
|
-
kv("Explorer", "silicaclaw explorer");
|
|
448
|
+
kv("Logs", "silicaclaw logs local-console");
|
|
448
449
|
kv("Doctor", "silicaclaw doctor");
|
|
449
|
-
kv("Version", "silicaclaw version");
|
|
450
450
|
kv("Help", "silicaclaw help");
|
|
451
451
|
}
|
|
452
452
|
|
|
@@ -218,18 +218,12 @@ function readState() {
|
|
|
218
218
|
function printHelp() {
|
|
219
219
|
headline();
|
|
220
220
|
console.log("");
|
|
221
|
-
section("Gateway
|
|
222
|
-
kv("Start", "silicaclaw gateway start
|
|
221
|
+
section("Gateway");
|
|
222
|
+
kv("Start", "silicaclaw gateway start");
|
|
223
223
|
kv("Stop", "silicaclaw gateway stop");
|
|
224
|
-
kv("Restart", "silicaclaw gateway restart
|
|
224
|
+
kv("Restart", "silicaclaw gateway restart");
|
|
225
225
|
kv("Status", "silicaclaw gateway status");
|
|
226
226
|
kv("Logs", "silicaclaw gateway logs local-console");
|
|
227
|
-
console.log("");
|
|
228
|
-
section("Notes");
|
|
229
|
-
kv("App dir", "current directory, then ~/silicaclaw");
|
|
230
|
-
kv("State dir", ".silicaclaw/gateway");
|
|
231
|
-
kv("Default relay", "https://relay.silicaclaw.com");
|
|
232
|
-
kv("Default room", "silicaclaw-global-preview");
|
|
233
227
|
}
|
|
234
228
|
|
|
235
229
|
function buildStatusPayload() {
|
|
@@ -341,14 +335,12 @@ function tailFile(file, lines = 80) {
|
|
|
341
335
|
if (!existsSync(file)) {
|
|
342
336
|
headline();
|
|
343
337
|
console.log("");
|
|
344
|
-
|
|
345
|
-
kv("Path", file);
|
|
338
|
+
kv("Logs", "not found");
|
|
346
339
|
return;
|
|
347
340
|
}
|
|
348
341
|
headline();
|
|
349
342
|
console.log("");
|
|
350
|
-
|
|
351
|
-
kv("Path", file);
|
|
343
|
+
kv("Logs", file);
|
|
352
344
|
console.log("");
|
|
353
345
|
const text = String(readFileSync(file, "utf8"));
|
|
354
346
|
const out = text.split(/\r?\n/).slice(-lines).join("\n");
|