nemoris 0.1.15 → 0.1.16
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/package.json +1 -1
- package/src/cli/help.js +5 -0
- package/src/cli-main.js +23 -0
package/package.json
CHANGED
package/src/cli/help.js
CHANGED
|
@@ -52,6 +52,11 @@ export const USER_FACING_COMMANDS = [
|
|
|
52
52
|
description: "Import agents from OpenClaw",
|
|
53
53
|
usage: ["nemoris migrate [--dry-run]"],
|
|
54
54
|
},
|
|
55
|
+
{
|
|
56
|
+
name: "update",
|
|
57
|
+
description: "Update nemoris to the latest version",
|
|
58
|
+
usage: ["nemoris update"],
|
|
59
|
+
},
|
|
55
60
|
{
|
|
56
61
|
name: "mcp",
|
|
57
62
|
description: "Manage MCP server connections",
|
package/src/cli-main.js
CHANGED
|
@@ -2767,6 +2767,29 @@ export async function main(argv = process.argv) {
|
|
|
2767
2767
|
console.log("\n Tip: run nemoris doctor --fix to clean the stale PID file.");
|
|
2768
2768
|
}
|
|
2769
2769
|
return results.exitCode;
|
|
2770
|
+
} else if (command === "update") {
|
|
2771
|
+
// Self-update via npm
|
|
2772
|
+
const { execSync } = await import("node:child_process");
|
|
2773
|
+
const pkgPath = path.join(projectRoot, "package.json");
|
|
2774
|
+
const currentVersion = JSON.parse(fs.readFileSync(pkgPath, "utf8")).version;
|
|
2775
|
+
console.log(` Current version: ${currentVersion}`);
|
|
2776
|
+
console.log(" Checking for updates...\n");
|
|
2777
|
+
try {
|
|
2778
|
+
const output = execSync("npm i -g nemoris@latest 2>&1", { encoding: "utf8", timeout: 60_000 });
|
|
2779
|
+
// Re-read version from npm to show what we got
|
|
2780
|
+
const latestLine = output.match(/\+ nemoris@([\d.]+)/);
|
|
2781
|
+
const newVersion = latestLine?.[1] ?? "latest";
|
|
2782
|
+
if (newVersion === currentVersion) {
|
|
2783
|
+
console.log(` ✓ Already on the latest version (${currentVersion})`);
|
|
2784
|
+
} else {
|
|
2785
|
+
console.log(` ✓ Updated to v${newVersion}`);
|
|
2786
|
+
console.log(" Restart your daemon: nemoris restart");
|
|
2787
|
+
}
|
|
2788
|
+
} catch (err) {
|
|
2789
|
+
console.error(" ✗ Update failed:", err.message?.split("\n")[0] || "unknown error");
|
|
2790
|
+
console.error(" Try manually: npm i -g nemoris@latest");
|
|
2791
|
+
return 1;
|
|
2792
|
+
}
|
|
2770
2793
|
} else if (command === "battle") {
|
|
2771
2794
|
const { runBattle, parseBattleFlags } = await import("./battle.js");
|
|
2772
2795
|
const flags = parseBattleFlags(rest);
|