traderclaw-cli 1.0.95 → 1.0.96

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.
@@ -4169,6 +4169,7 @@ Commands:
4169
4169
  status Check connection health and wallet status
4170
4170
  config View and manage configuration
4171
4171
  test-session Test session auth flow (refresh, rotation, challenge) without reinstalling
4172
+ update Update to the latest version and restart the gateway
4172
4173
 
4173
4174
  Setup options:
4174
4175
  --api-key, -k API key (skip interactive prompt)
@@ -4236,9 +4237,59 @@ Examples:
4236
4237
  traderclaw config set apiTimeout 60000
4237
4238
  traderclaw test-session
4238
4239
  traderclaw test-session --wallet-private-key <base58_key>
4240
+ traderclaw update
4241
+ traderclaw update --beta
4239
4242
  `);
4240
4243
  }
4241
4244
 
4245
+ async function cmdUpdate(args) {
4246
+ const tag = args.includes("--beta") ? "beta" : "latest";
4247
+
4248
+ print("\nTraderClaw — Update\n");
4249
+ print("=".repeat(45));
4250
+
4251
+ let currentVersion = "unknown";
4252
+ try {
4253
+ const out = execSync("npm list -g traderclaw-cli --json --depth=0", { encoding: "utf-8" });
4254
+ const data = JSON.parse(out);
4255
+ currentVersion = data?.dependencies?.["traderclaw-cli"]?.version ?? "unknown";
4256
+ } catch {}
4257
+ printInfo(` Current version: ${currentVersion}`);
4258
+
4259
+ let latestVersion = "unknown";
4260
+ try {
4261
+ latestVersion = execSync(`npm view traderclaw-cli@${tag} version`, { encoding: "utf-8" }).trim();
4262
+ } catch {}
4263
+ printInfo(` Available (${tag}):${" ".repeat(Math.max(1, 9 - tag.length))}${latestVersion}`);
4264
+
4265
+ if (currentVersion !== "unknown" && latestVersion !== "unknown" && currentVersion === latestVersion) {
4266
+ printSuccess(`\n Already on the ${tag} version (${currentVersion}). Nothing to do.\n`);
4267
+ return;
4268
+ }
4269
+
4270
+ print(`\n Installing traderclaw-cli@${tag}...\n`);
4271
+ try {
4272
+ execSync(`npm install -g traderclaw-cli@${tag}`, { stdio: "inherit" });
4273
+ } catch {
4274
+ printError("npm install failed. Try running manually:");
4275
+ print(` npm install -g traderclaw-cli@${tag}`);
4276
+ process.exit(1);
4277
+ }
4278
+
4279
+ printSuccess(`\n Package updated.`);
4280
+ print("\n Restarting gateway...\n");
4281
+
4282
+ try {
4283
+ execSync("openclaw gateway restart", { stdio: "inherit" });
4284
+ printSuccess(" Gateway restarted.");
4285
+ } catch {
4286
+ printWarn(" Gateway restart returned non-zero. Restart manually: openclaw gateway restart");
4287
+ }
4288
+
4289
+ print("\n" + "=".repeat(45));
4290
+ printSuccess("\n Update complete!\n");
4291
+ }
4292
+
4242
4293
  async function cmdRepairOpenclaw() {
4243
4294
  const { ensureOpenClawGlobalPackageDependencies } = await import("./installer-step-engine.mjs");
4244
4295
  printInfo("Repairing global OpenClaw npm dependencies (fixes missing grammy, @buape/carbon, etc.)...");
@@ -4303,6 +4354,9 @@ async function main() {
4303
4354
  case "test-session":
4304
4355
  await cmdTestSession(args.slice(1));
4305
4356
  break;
4357
+ case "update":
4358
+ await cmdUpdate(args.slice(1));
4359
+ break;
4306
4360
  default:
4307
4361
  printError(`Unknown command: ${command}`);
4308
4362
  printHelp();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "traderclaw-cli",
3
- "version": "1.0.95",
3
+ "version": "1.0.96",
4
4
  "description": "Global TraderClaw CLI (install --wizard, setup, precheck). Installs solana-traderclaw as a dependency for OpenClaw plugin files.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -17,7 +17,7 @@
17
17
  "node": ">=22"
18
18
  },
19
19
  "dependencies": {
20
- "solana-traderclaw": "^1.0.95"
20
+ "solana-traderclaw": "^1.0.96"
21
21
  },
22
22
  "keywords": [
23
23
  "traderclaw",