nextclaw 0.4.13 → 0.4.14
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/dist/cli/index.js +14 -0
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1048,6 +1048,19 @@ ${this.logo} ${APP_NAME} is ready! (${source})`);
|
|
|
1048
1048
|
open: Boolean(opts.open)
|
|
1049
1049
|
});
|
|
1050
1050
|
}
|
|
1051
|
+
async restart(opts) {
|
|
1052
|
+
const state = readServiceState();
|
|
1053
|
+
if (state && isProcessRunning(state.pid)) {
|
|
1054
|
+
console.log(`Restarting ${APP_NAME}...`);
|
|
1055
|
+
await this.stopService();
|
|
1056
|
+
} else if (state) {
|
|
1057
|
+
clearServiceState();
|
|
1058
|
+
console.log("Service state was stale and has been cleaned up.");
|
|
1059
|
+
} else {
|
|
1060
|
+
console.log("No running service found. Starting a new service.");
|
|
1061
|
+
}
|
|
1062
|
+
await this.start(opts);
|
|
1063
|
+
}
|
|
1051
1064
|
async serve(opts) {
|
|
1052
1065
|
const uiOverrides = {
|
|
1053
1066
|
enabled: true,
|
|
@@ -2470,6 +2483,7 @@ program.command("init").description(`Initialize ${APP_NAME2} configuration and w
|
|
|
2470
2483
|
program.command("gateway").description(`Start the ${APP_NAME2} gateway`).option("-p, --port <port>", "Gateway port", "18790").option("-v, --verbose", "Verbose output", false).option("--ui", "Enable UI server", false).option("--ui-host <host>", "UI host").option("--ui-port <port>", "UI port").option("--ui-open", "Open browser when UI starts", false).action(async (opts) => runtime.gateway(opts));
|
|
2471
2484
|
program.command("ui").description(`Start the ${APP_NAME2} UI with gateway`).option("--host <host>", "UI host").option("--port <port>", "UI port").option("--no-open", "Disable opening browser").action(async (opts) => runtime.ui(opts));
|
|
2472
2485
|
program.command("start").description(`Start the ${APP_NAME2} gateway + UI in the background`).option("--ui-host <host>", "UI host").option("--ui-port <port>", "UI port").option("--frontend", "Start UI frontend dev server").option("--frontend-port <port>", "UI frontend dev server port").option("--open", "Open browser after start", false).action(async (opts) => runtime.start(opts));
|
|
2486
|
+
program.command("restart").description(`Restart the ${APP_NAME2} background service`).option("--ui-host <host>", "UI host").option("--ui-port <port>", "UI port").option("--frontend", "Start UI frontend dev server").option("--frontend-port <port>", "UI frontend dev server port").option("--open", "Open browser after restart", false).action(async (opts) => runtime.restart(opts));
|
|
2473
2487
|
program.command("serve").description(`Run the ${APP_NAME2} gateway + UI in the foreground`).option("--ui-host <host>", "UI host").option("--ui-port <port>", "UI port").option("--frontend", "Start UI frontend dev server").option("--frontend-port <port>", "UI frontend dev server port").option("--open", "Open browser after start", false).action(async (opts) => runtime.serve(opts));
|
|
2474
2488
|
program.command("stop").description(`Stop the ${APP_NAME2} background service`).action(async () => runtime.stop());
|
|
2475
2489
|
program.command("agent").description("Interact with the agent directly").option("-m, --message <message>", "Message to send to the agent").option("-s, --session <session>", "Session ID", "cli:default").option("--no-markdown", "Disable Markdown rendering").action(async (opts) => runtime.agent(opts));
|