feat: fold gateway service commands into gateway
This commit is contained in:
@@ -785,7 +785,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
if (result.reason === "not-git-install") {
|
||||
defaultRuntime.log(
|
||||
theme.warn(
|
||||
`Skipped: this Clawdbot install isn't a git checkout, and the package manager couldn't be detected. Update via your package manager, then run \`${formatCliCommand("clawdbot doctor")}\` and \`${formatCliCommand("clawdbot daemon restart")}\`.`,
|
||||
`Skipped: this Clawdbot install isn't a git checkout, and the package manager couldn't be detected. Update via your package manager, then run \`${formatCliCommand("clawdbot doctor")}\` and \`${formatCliCommand("clawdbot gateway restart")}\`.`,
|
||||
),
|
||||
);
|
||||
defaultRuntime.log(
|
||||
@@ -877,11 +877,11 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
defaultRuntime.log(theme.warn("Skipping plugin updates: config is invalid."));
|
||||
}
|
||||
|
||||
// Restart daemon if requested
|
||||
// Restart service if requested
|
||||
if (opts.restart) {
|
||||
if (!opts.json) {
|
||||
defaultRuntime.log("");
|
||||
defaultRuntime.log(theme.heading("Restarting daemon..."));
|
||||
defaultRuntime.log(theme.heading("Restarting service..."));
|
||||
}
|
||||
try {
|
||||
const { runDaemonRestart } = await import("./daemon-cli.js");
|
||||
@@ -905,7 +905,7 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
defaultRuntime.log(theme.warn(`Daemon restart failed: ${String(err)}`));
|
||||
defaultRuntime.log(
|
||||
theme.muted(
|
||||
`You may need to restart the daemon manually: ${formatCliCommand("clawdbot daemon restart")}`,
|
||||
`You may need to restart the service manually: ${formatCliCommand("clawdbot gateway restart")}`,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -915,13 +915,13 @@ export async function updateCommand(opts: UpdateCommandOptions): Promise<void> {
|
||||
if (result.mode === "npm" || result.mode === "pnpm") {
|
||||
defaultRuntime.log(
|
||||
theme.muted(
|
||||
`Tip: Run \`${formatCliCommand("clawdbot doctor")}\`, then \`${formatCliCommand("clawdbot daemon restart")}\` to apply updates to a running gateway.`,
|
||||
`Tip: Run \`${formatCliCommand("clawdbot doctor")}\`, then \`${formatCliCommand("clawdbot gateway restart")}\` to apply updates to a running gateway.`,
|
||||
),
|
||||
);
|
||||
} else {
|
||||
defaultRuntime.log(
|
||||
theme.muted(
|
||||
`Tip: Run \`${formatCliCommand("clawdbot daemon restart")}\` to apply updates to a running gateway.`,
|
||||
`Tip: Run \`${formatCliCommand("clawdbot gateway restart")}\` to apply updates to a running gateway.`,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -937,7 +937,7 @@ export function registerUpdateCli(program: Command) {
|
||||
.command("update")
|
||||
.description("Update Clawdbot to the latest version")
|
||||
.option("--json", "Output result as JSON", false)
|
||||
.option("--restart", "Restart the gateway daemon after a successful update", false)
|
||||
.option("--restart", "Restart the gateway service after a successful update", false)
|
||||
.option("--channel <stable|beta|dev>", "Persist update channel (git + npm)")
|
||||
.option("--tag <dist-tag|version>", "Override npm dist-tag or version for this update")
|
||||
.option("--timeout <seconds>", "Timeout for each update step in seconds (default: 1200)")
|
||||
@@ -948,7 +948,7 @@ export function registerUpdateCli(program: Command) {
|
||||
["clawdbot update --channel beta", "Switch to beta channel (git + npm)"],
|
||||
["clawdbot update --channel dev", "Switch to dev channel (git + npm)"],
|
||||
["clawdbot update --tag beta", "One-off update to a dist-tag or version"],
|
||||
["clawdbot update --restart", "Update and restart the daemon"],
|
||||
["clawdbot update --restart", "Update and restart the service"],
|
||||
["clawdbot update --json", "Output result as JSON"],
|
||||
["clawdbot update --yes", "Non-interactive (accept downgrade prompts)"],
|
||||
["clawdbot --update", "Shorthand for clawdbot update"],
|
||||
|
||||
Reference in New Issue
Block a user