patchcord 0.5.50 → 0.5.52
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/bin/patchcord.mjs +12 -2
- package/package.json +1 -1
package/bin/patchcord.mjs
CHANGED
|
@@ -71,11 +71,12 @@ if (cmd === "help" || cmd === "--help" || cmd === "-h") {
|
|
|
71
71
|
|
|
72
72
|
Usage:
|
|
73
73
|
patchcord Setup via browser (patchcord.dev)
|
|
74
|
-
patchcord --token <token>
|
|
75
|
-
patchcord --token <token> --server <url> Self-hosted
|
|
74
|
+
patchcord --token <token> CI / headless setup (no browser)
|
|
75
|
+
patchcord --token <token> --server <url> Self-hosted server setup
|
|
76
76
|
patchcord --full Same + full statusline
|
|
77
77
|
patchcord --rename <new-name> [--tool <slug>] Rename this agent (paste from dashboard)
|
|
78
78
|
patchcord subscribe Start the realtime listener
|
|
79
|
+
patchcord update Update to the latest version
|
|
79
80
|
patchcord --version Show installed version
|
|
80
81
|
patchcord --help Show this help
|
|
81
82
|
|
|
@@ -301,9 +302,16 @@ if (cmd === "subscribe") {
|
|
|
301
302
|
// works the same as the space-form (--token foo). The internal flag parsing below
|
|
302
303
|
// supports both. Non-flag commands (channel, init, skill, help, plugin-path) have
|
|
303
304
|
// their own branches above and below.
|
|
305
|
+
if (cmd === "update" || cmd === "--update") {
|
|
306
|
+
const { spawnSync: _spawn } = await import("child_process");
|
|
307
|
+
const r = _spawn("npx", ["--min-release-age=0", "patchcord@latest", "--update-only"], { stdio: "inherit" });
|
|
308
|
+
process.exit(r.status ?? (r.signal ? 1 : 0));
|
|
309
|
+
}
|
|
310
|
+
|
|
304
311
|
if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
305
312
|
const flags = cmd?.startsWith("--") ? process.argv.slice(2) : process.argv.slice(3);
|
|
306
313
|
const fullStatusline = flags.includes("--full");
|
|
314
|
+
const updateOnly = flags.includes("--update-only");
|
|
307
315
|
let wasPluginInstalled = false;
|
|
308
316
|
const { readFileSync, writeFileSync, unlinkSync, rmSync, chmodSync, copyFileSync } = await import("fs");
|
|
309
317
|
|
|
@@ -612,6 +620,8 @@ if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
|
|
|
612
620
|
console.log(`${dim}No Claude Code or Codex CLI detected — skipping global setup.${r}`);
|
|
613
621
|
}
|
|
614
622
|
|
|
623
|
+
if (updateOnly) process.exit(0);
|
|
624
|
+
|
|
615
625
|
// ── project setup (inline, not a separate command) ──────────
|
|
616
626
|
const cwd = process.cwd();
|
|
617
627
|
const { createInterface } = await import("readline");
|