refactor: rename to openclaw
This commit is contained in:
@@ -84,7 +84,7 @@ export async function runDaemonInstall(opts: DaemonInstallOptions) {
|
||||
if (!json) {
|
||||
defaultRuntime.log(`Gateway service already ${service.loadedText}.`);
|
||||
defaultRuntime.log(
|
||||
`Reinstall with: ${formatCliCommand("moltbot gateway install --force")}`,
|
||||
`Reinstall with: ${formatCliCommand("openclaw gateway install --force")}`,
|
||||
);
|
||||
}
|
||||
return;
|
||||
@@ -94,7 +94,7 @@ export async function runDaemonInstall(opts: DaemonInstallOptions) {
|
||||
const { programArguments, workingDirectory, environment } = await buildGatewayInstallPlan({
|
||||
env: process.env,
|
||||
port,
|
||||
token: opts.token || cfg.gateway?.auth?.token || process.env.CLAWDBOT_GATEWAY_TOKEN,
|
||||
token: opts.token || cfg.gateway?.auth?.token || process.env.OPENCLAW_GATEWAY_TOKEN,
|
||||
runtime: runtimeRaw,
|
||||
warn: (message) => {
|
||||
if (json) warnings.push(message);
|
||||
|
||||
@@ -18,7 +18,7 @@ export function registerDaemonCli(program: Command) {
|
||||
.addHelpText(
|
||||
"after",
|
||||
() =>
|
||||
`\n${theme.muted("Docs:")} ${formatDocsLink("/cli/gateway", "docs.molt.bot/cli/gateway")}\n`,
|
||||
`\n${theme.muted("Docs:")} ${formatDocsLink("/cli/gateway", "docs.openclaw.ai/cli/gateway")}\n`,
|
||||
);
|
||||
|
||||
daemon
|
||||
|
||||
@@ -51,13 +51,11 @@ export function pickProbeHostForBind(
|
||||
}
|
||||
|
||||
const SAFE_DAEMON_ENV_KEYS = [
|
||||
"MOLTBOT_STATE_DIR",
|
||||
"MOLTBOT_CONFIG_PATH",
|
||||
"CLAWDBOT_PROFILE",
|
||||
"CLAWDBOT_STATE_DIR",
|
||||
"CLAWDBOT_CONFIG_PATH",
|
||||
"CLAWDBOT_GATEWAY_PORT",
|
||||
"CLAWDBOT_NIX_MODE",
|
||||
"OPENCLAW_PROFILE",
|
||||
"OPENCLAW_STATE_DIR",
|
||||
"OPENCLAW_CONFIG_PATH",
|
||||
"OPENCLAW_GATEWAY_PORT",
|
||||
"OPENCLAW_NIX_MODE",
|
||||
];
|
||||
|
||||
export function filterDaemonEnv(env: Record<string, string> | undefined): Record<string, string> {
|
||||
@@ -131,7 +129,7 @@ export function renderRuntimeHints(
|
||||
}
|
||||
})();
|
||||
if (runtime.missingUnit) {
|
||||
hints.push(`Service not installed. Run: ${formatCliCommand("moltbot gateway install", env)}`);
|
||||
hints.push(`Service not installed. Run: ${formatCliCommand("openclaw gateway install", env)}`);
|
||||
if (fileLog) hints.push(`File logs: ${fileLog}`);
|
||||
return hints;
|
||||
}
|
||||
@@ -142,10 +140,10 @@ export function renderRuntimeHints(
|
||||
hints.push(`Launchd stdout (if installed): ${logs.stdoutPath}`);
|
||||
hints.push(`Launchd stderr (if installed): ${logs.stderrPath}`);
|
||||
} else if (process.platform === "linux") {
|
||||
const unit = resolveGatewaySystemdServiceName(env.CLAWDBOT_PROFILE);
|
||||
const unit = resolveGatewaySystemdServiceName(env.OPENCLAW_PROFILE);
|
||||
hints.push(`Logs: journalctl --user -u ${unit}.service -n 200 --no-pager`);
|
||||
} else if (process.platform === "win32") {
|
||||
const task = resolveGatewayWindowsTaskName(env.CLAWDBOT_PROFILE);
|
||||
const task = resolveGatewayWindowsTaskName(env.OPENCLAW_PROFILE);
|
||||
hints.push(`Logs: schtasks /Query /TN "${task}" /V /FO LIST`);
|
||||
}
|
||||
}
|
||||
@@ -154,10 +152,10 @@ export function renderRuntimeHints(
|
||||
|
||||
export function renderGatewayServiceStartHints(env: NodeJS.ProcessEnv = process.env): string[] {
|
||||
const base = [
|
||||
formatCliCommand("moltbot gateway install", env),
|
||||
formatCliCommand("moltbot gateway", env),
|
||||
formatCliCommand("openclaw gateway install", env),
|
||||
formatCliCommand("openclaw gateway", env),
|
||||
];
|
||||
const profile = env.CLAWDBOT_PROFILE;
|
||||
const profile = env.OPENCLAW_PROFILE;
|
||||
switch (process.platform) {
|
||||
case "darwin": {
|
||||
const label = resolveGatewayLaunchAgentLabel(profile);
|
||||
|
||||
@@ -8,7 +8,6 @@ import type { GatewayBindMode, GatewayControlUiConfig } from "../../config/types
|
||||
import { readLastGatewayErrorLine } from "../../daemon/diagnostics.js";
|
||||
import type { FindExtraGatewayServicesOptions } from "../../daemon/inspect.js";
|
||||
import { findExtraGatewayServices } from "../../daemon/inspect.js";
|
||||
import { findLegacyGatewayServices } from "../../daemon/legacy.js";
|
||||
import { resolveGatewayService } from "../../daemon/service.js";
|
||||
import type { ServiceConfigAudit } from "../../daemon/service-audit.js";
|
||||
import { auditGatewayServiceConfig } from "../../daemon/service-audit.js";
|
||||
@@ -93,7 +92,6 @@ export type DaemonStatus = {
|
||||
error?: string;
|
||||
url?: string;
|
||||
};
|
||||
legacyServices: Array<{ label: string; detail: string }>;
|
||||
extraServices: Array<{ label: string; detail: string; scope: string }>;
|
||||
};
|
||||
|
||||
@@ -210,9 +208,6 @@ export async function gatherDaemonStatus(
|
||||
}
|
||||
: undefined;
|
||||
|
||||
const legacyServices = await findLegacyGatewayServices(
|
||||
process.env as Record<string, string | undefined>,
|
||||
).catch(() => []);
|
||||
const extraServices = await findExtraGatewayServices(
|
||||
process.env as Record<string, string | undefined>,
|
||||
{ deep: Boolean(opts.deep) },
|
||||
@@ -226,11 +221,11 @@ export async function gatherDaemonStatus(
|
||||
url: probeUrl,
|
||||
token:
|
||||
opts.rpc.token ||
|
||||
mergedDaemonEnv.CLAWDBOT_GATEWAY_TOKEN ||
|
||||
mergedDaemonEnv.OPENCLAW_GATEWAY_TOKEN ||
|
||||
daemonCfg.gateway?.auth?.token,
|
||||
password:
|
||||
opts.rpc.password ||
|
||||
mergedDaemonEnv.CLAWDBOT_GATEWAY_PASSWORD ||
|
||||
mergedDaemonEnv.OPENCLAW_GATEWAY_PASSWORD ||
|
||||
daemonCfg.gateway?.auth?.password,
|
||||
timeoutMs,
|
||||
json: opts.rpc.json,
|
||||
@@ -271,7 +266,6 @@ export async function gatherDaemonStatus(
|
||||
...(portCliStatus ? { portCli: portCliStatus } : {}),
|
||||
lastError,
|
||||
...(rpc ? { rpc: { ...rpc, url: probeUrl } } : {}),
|
||||
legacyServices,
|
||||
extraServices,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ export function printDaemonStatus(status: DaemonStatus, opts: { json: boolean })
|
||||
const errorText = (value: string) => colorize(rich, theme.error, value);
|
||||
const spacer = () => defaultRuntime.log("");
|
||||
|
||||
const { service, rpc, legacyServices, extraServices } = status;
|
||||
const { service, rpc, extraServices } = status;
|
||||
const serviceStatus = service.loaded
|
||||
? okText(service.loadedText)
|
||||
: warnText(service.notLoadedText);
|
||||
@@ -100,7 +100,7 @@ export function printDaemonStatus(status: DaemonStatus, opts: { json: boolean })
|
||||
}
|
||||
defaultRuntime.error(
|
||||
warnText(
|
||||
`Recommendation: run "${formatCliCommand("moltbot doctor")}" (or "${formatCliCommand("moltbot doctor --repair")}").`,
|
||||
`Recommendation: run "${formatCliCommand("openclaw doctor")}" (or "${formatCliCommand("openclaw doctor --repair")}").`,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ export function printDaemonStatus(status: DaemonStatus, opts: { json: boolean })
|
||||
);
|
||||
defaultRuntime.error(
|
||||
errorText(
|
||||
`Fix: rerun \`${formatCliCommand("moltbot gateway install --force")}\` from the same --profile / CLAWDBOT_STATE_DIR you expect.`,
|
||||
`Fix: rerun \`${formatCliCommand("openclaw gateway install --force")}\` from the same --profile / OPENCLAW_STATE_DIR you expect.`,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -230,14 +230,14 @@ export function printDaemonStatus(status: DaemonStatus, opts: { json: boolean })
|
||||
|
||||
if (service.runtime?.cachedLabel) {
|
||||
const env = (service.command?.environment ?? process.env) as NodeJS.ProcessEnv;
|
||||
const labelValue = resolveGatewayLaunchAgentLabel(env.CLAWDBOT_PROFILE);
|
||||
const labelValue = resolveGatewayLaunchAgentLabel(env.OPENCLAW_PROFILE);
|
||||
defaultRuntime.error(
|
||||
errorText(
|
||||
`LaunchAgent label cached but plist missing. Clear with: launchctl bootout gui/$UID/${labelValue}`,
|
||||
),
|
||||
);
|
||||
defaultRuntime.error(
|
||||
errorText(`Then reinstall: ${formatCliCommand("moltbot gateway install")}`),
|
||||
errorText(`Then reinstall: ${formatCliCommand("openclaw gateway install")}`),
|
||||
);
|
||||
spacer();
|
||||
}
|
||||
@@ -273,7 +273,7 @@ export function printDaemonStatus(status: DaemonStatus, opts: { json: boolean })
|
||||
}
|
||||
if (process.platform === "linux") {
|
||||
const env = (service.command?.environment ?? process.env) as NodeJS.ProcessEnv;
|
||||
const unit = resolveGatewaySystemdServiceName(env.CLAWDBOT_PROFILE);
|
||||
const unit = resolveGatewaySystemdServiceName(env.OPENCLAW_PROFILE);
|
||||
defaultRuntime.error(
|
||||
errorText(`Logs: journalctl --user -u ${unit}.service -n 200 --no-pager`),
|
||||
);
|
||||
@@ -287,15 +287,6 @@ export function printDaemonStatus(status: DaemonStatus, opts: { json: boolean })
|
||||
spacer();
|
||||
}
|
||||
|
||||
if (legacyServices.length > 0) {
|
||||
defaultRuntime.error(errorText("Legacy gateway services detected:"));
|
||||
for (const svc of legacyServices) {
|
||||
defaultRuntime.error(`- ${errorText(svc.label)} (${svc.detail})`);
|
||||
}
|
||||
defaultRuntime.error(errorText(`Cleanup: ${formatCliCommand("moltbot doctor")}`));
|
||||
spacer();
|
||||
}
|
||||
|
||||
if (extraServices.length > 0) {
|
||||
defaultRuntime.error(errorText("Other gateway-like services detected (best effort):"));
|
||||
for (const svc of extraServices) {
|
||||
@@ -307,7 +298,7 @@ export function printDaemonStatus(status: DaemonStatus, opts: { json: boolean })
|
||||
spacer();
|
||||
}
|
||||
|
||||
if (legacyServices.length > 0 || extraServices.length > 0) {
|
||||
if (extraServices.length > 0) {
|
||||
defaultRuntime.error(
|
||||
errorText(
|
||||
"Recommendation: run a single gateway per machine for most setups. One gateway supports multiple agents (see docs: /gateway#multiple-gateways-same-host).",
|
||||
@@ -321,6 +312,6 @@ export function printDaemonStatus(status: DaemonStatus, opts: { json: boolean })
|
||||
spacer();
|
||||
}
|
||||
|
||||
defaultRuntime.log(`${label("Troubles:")} run ${formatCliCommand("moltbot status")}`);
|
||||
defaultRuntime.log(`${label("Troubleshooting:")} https://docs.molt.bot/troubleshooting`);
|
||||
defaultRuntime.log(`${label("Troubles:")} run ${formatCliCommand("openclaw status")}`);
|
||||
defaultRuntime.log(`${label("Troubleshooting:")} https://docs.openclaw.ai/troubleshooting`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user