Lines 1514-1554javascript
1514 const id = process.argv[4];
1515 if (!id) { console.error("Usage: patchcord schedule test <id>"); process.exit(1); }
1516 const { status, json } = await accountCall("POST", `${BASE}/${id}/test`, {});
1517 if (status !== "200") { console.error(`test failed (HTTP ${status}): ${json?.error || ""}`); process.exit(1); }
1518 console.log(`✓ fired ${id} once (does not consume max-runs)`);
1521 if (sub === "pause" || sub === "resume") {
1522 const id = process.argv[4];
1523 if (!id) { console.error(`Usage: patchcord schedule ${sub} <id>`); process.exit(1); }
1524 const { status, json } = await accountCall("PATCH", `${BASE}/${id}`, { active: sub === "resume" });
1525 if (status !== "200") { console.error(`${sub} failed (HTTP ${status}): ${json?.error || ""}`); process.exit(1); }
1526 console.log(`✓ ${sub === "resume" ? "resumed" : "paused"} ${id}`);
1529 console.error("Usage: patchcord schedule <create|list|cancel|test|pause|resume>");
1534if (cmd === "update" || cmd === "--update") {
1535 const { spawnSync: _spawn } = await import("child_process");
1536 const r = _spawn("npx", ["--min-release-age=0", "patchcord@latest", "--update-only"], { stdio: "inherit" });
1537 process.exit(r.status ?? (r.signal ? 1 : 0));
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
bin/patchcord.mjsView on unpkg · L1534 1540if (!cmd || cmd === "install" || cmd === "agent" || cmd?.startsWith("--")) {
1541 const flags = cmd?.startsWith("--") ? process.argv.slice(2) : process.argv.slice(3);
1542 const fullStatusline = flags.includes("--full");
1543 const updateOnly = flags.includes("--update-only");
1544 let wasPluginInstalled = false;
1545 const { readFileSync, writeFileSync, unlinkSync, rmSync, chmodSync, copyFileSync } = await import("fs");
1547 // JSONC-safe comment stripper that preserves content inside string literals.
1548 // Prevents corrupting URLs like "https://..." which contain "//".
1549 function _stripJsoncOutsideStrings(str) {