mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 18:31:26 +00:00
refactor: rename to openclaw
This commit is contained in:
@@ -20,7 +20,7 @@ import {
|
||||
} from "../commands/onboard-helpers.js";
|
||||
import { formatCliCommand } from "../cli/command-format.js";
|
||||
import type { OnboardOptions } from "../commands/onboard-types.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { resolveGatewayService } from "../daemon/service.js";
|
||||
import { isSystemdUserServiceAvailable } from "../daemon/systemd.js";
|
||||
import { ensureControlUiAssetsBuilt } from "../infra/control-ui-assets.js";
|
||||
@@ -37,8 +37,8 @@ import type { WizardPrompter } from "./prompts.js";
|
||||
type FinalizeOnboardingOptions = {
|
||||
flow: WizardFlow;
|
||||
opts: OnboardOptions;
|
||||
baseConfig: MoltbotConfig;
|
||||
nextConfig: MoltbotConfig;
|
||||
baseConfig: OpenClawConfig;
|
||||
nextConfig: OpenClawConfig;
|
||||
workspaceDir: string;
|
||||
settings: GatewayWizardSettings;
|
||||
prompter: WizardPrompter;
|
||||
@@ -214,8 +214,8 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
await prompter.note(
|
||||
[
|
||||
"Docs:",
|
||||
"https://docs.molt.bot/gateway/health",
|
||||
"https://docs.molt.bot/gateway/troubleshooting",
|
||||
"https://docs.openclaw.ai/gateway/health",
|
||||
"https://docs.openclaw.ai/gateway/troubleshooting",
|
||||
].join("\n"),
|
||||
"Health check help",
|
||||
);
|
||||
@@ -277,7 +277,7 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
tokenParam ? `Web UI (with token): ${authedUrl}` : undefined,
|
||||
`Gateway WS: ${links.wsUrl}`,
|
||||
gatewayStatusLine,
|
||||
"Docs: https://docs.molt.bot/web/control-ui",
|
||||
"Docs: https://docs.openclaw.ai/web/control-ui",
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join("\n"),
|
||||
@@ -305,9 +305,9 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
await prompter.note(
|
||||
[
|
||||
"Gateway token: shared auth for the Gateway + Control UI.",
|
||||
"Stored in: ~/.clawdbot/moltbot.json (gateway.auth.token) or CLAWDBOT_GATEWAY_TOKEN.",
|
||||
"Web UI stores a copy in this browser's localStorage (moltbot.control.settings.v1).",
|
||||
`Get the tokenized link anytime: ${formatCliCommand("moltbot dashboard --no-open")}`,
|
||||
"Stored in: ~/.openclaw/openclaw.json (gateway.auth.token) or OPENCLAW_GATEWAY_TOKEN.",
|
||||
"Web UI stores a copy in this browser's localStorage (openclaw.control.settings.v1).",
|
||||
`Get the tokenized link anytime: ${formatCliCommand("openclaw dashboard --no-open")}`,
|
||||
].join("\n"),
|
||||
"Token",
|
||||
);
|
||||
@@ -337,7 +337,7 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
if (seededInBackground) {
|
||||
await prompter.note(
|
||||
`Web UI seeded in the background. Open later with: ${formatCliCommand(
|
||||
"moltbot dashboard --no-open",
|
||||
"openclaw dashboard --no-open",
|
||||
)}`,
|
||||
"Web UI",
|
||||
);
|
||||
@@ -364,8 +364,8 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
[
|
||||
`Dashboard link (with token): ${authedUrl}`,
|
||||
controlUiOpened
|
||||
? "Opened in your browser. Keep that tab to control Moltbot."
|
||||
: "Copy/paste this URL in a browser on this machine to control Moltbot.",
|
||||
? "Opened in your browser. Keep that tab to control OpenClaw."
|
||||
: "Copy/paste this URL in a browser on this machine to control OpenClaw.",
|
||||
controlUiOpenHint,
|
||||
]
|
||||
.filter(Boolean)
|
||||
@@ -374,7 +374,7 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
);
|
||||
} else {
|
||||
await prompter.note(
|
||||
`When you're ready: ${formatCliCommand("moltbot dashboard --no-open")}`,
|
||||
`When you're ready: ${formatCliCommand("openclaw dashboard --no-open")}`,
|
||||
"Later",
|
||||
);
|
||||
}
|
||||
@@ -383,14 +383,15 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
}
|
||||
|
||||
await prompter.note(
|
||||
["Back up your agent workspace.", "Docs: https://docs.molt.bot/concepts/agent-workspace"].join(
|
||||
"\n",
|
||||
),
|
||||
[
|
||||
"Back up your agent workspace.",
|
||||
"Docs: https://docs.openclaw.ai/concepts/agent-workspace",
|
||||
].join("\n"),
|
||||
"Workspace backup",
|
||||
);
|
||||
|
||||
await prompter.note(
|
||||
"Running agents on your computer is risky — harden your setup: https://docs.molt.bot/security",
|
||||
"Running agents on your computer is risky — harden your setup: https://docs.openclaw.ai/security",
|
||||
"Security",
|
||||
);
|
||||
|
||||
@@ -422,8 +423,8 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
[
|
||||
`Dashboard link (with token): ${authedUrl}`,
|
||||
controlUiOpened
|
||||
? "Opened in your browser. Keep that tab to control Moltbot."
|
||||
: "Copy/paste this URL in a browser on this machine to control Moltbot.",
|
||||
? "Opened in your browser. Keep that tab to control OpenClaw."
|
||||
: "Copy/paste this URL in a browser on this machine to control OpenClaw.",
|
||||
controlUiOpenHint,
|
||||
]
|
||||
.filter(Boolean)
|
||||
@@ -443,33 +444,33 @@ export async function finalizeOnboardingWizard(options: FinalizeOnboardingOption
|
||||
webSearchKey
|
||||
? "API key: stored in config (tools.web.search.apiKey)."
|
||||
: "API key: provided via BRAVE_API_KEY env var (Gateway environment).",
|
||||
"Docs: https://docs.molt.bot/tools/web",
|
||||
"Docs: https://docs.openclaw.ai/tools/web",
|
||||
].join("\n")
|
||||
: [
|
||||
"If you want your agent to be able to search the web, you’ll need an API key.",
|
||||
"",
|
||||
"Moltbot uses Brave Search for the `web_search` tool. Without a Brave Search API key, web search won’t work.",
|
||||
"OpenClaw uses Brave Search for the `web_search` tool. Without a Brave Search API key, web search won’t work.",
|
||||
"",
|
||||
"Set it up interactively:",
|
||||
`- Run: ${formatCliCommand("moltbot configure --section web")}`,
|
||||
`- Run: ${formatCliCommand("openclaw configure --section web")}`,
|
||||
"- Enable web_search and paste your Brave Search API key",
|
||||
"",
|
||||
"Alternative: set BRAVE_API_KEY in the Gateway environment (no config changes).",
|
||||
"Docs: https://docs.molt.bot/tools/web",
|
||||
"Docs: https://docs.openclaw.ai/tools/web",
|
||||
].join("\n"),
|
||||
"Web search (optional)",
|
||||
);
|
||||
|
||||
await prompter.note(
|
||||
'What now: https://molt.bot/showcase ("What People Are Building").',
|
||||
'What now: https://openclaw.ai/showcase ("What People Are Building").',
|
||||
"What now",
|
||||
);
|
||||
|
||||
await prompter.outro(
|
||||
controlUiOpened
|
||||
? "Onboarding complete. Dashboard opened with your token; keep that tab to control Moltbot."
|
||||
? "Onboarding complete. Dashboard opened with your token; keep that tab to control OpenClaw."
|
||||
: seededInBackground
|
||||
? "Onboarding complete. Web UI seeded in the background; open it anytime with the tokenized link above."
|
||||
: "Onboarding complete. Use the tokenized dashboard link above to control Moltbot.",
|
||||
: "Onboarding complete. Use the tokenized dashboard link above to control OpenClaw.",
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { randomToken } from "../commands/onboard-helpers.js";
|
||||
import type { GatewayAuthChoice } from "../commands/onboard-types.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import { findTailscaleBinary } from "../infra/tailscale.js";
|
||||
import type { RuntimeEnv } from "../runtime.js";
|
||||
import type {
|
||||
@@ -12,8 +12,8 @@ import type { WizardPrompter } from "./prompts.js";
|
||||
|
||||
type ConfigureGatewayOptions = {
|
||||
flow: WizardFlow;
|
||||
baseConfig: MoltbotConfig;
|
||||
nextConfig: MoltbotConfig;
|
||||
baseConfig: OpenClawConfig;
|
||||
nextConfig: OpenClawConfig;
|
||||
localPort: number;
|
||||
quickstartGateway: QuickstartGatewayDefaults;
|
||||
prompter: WizardPrompter;
|
||||
@@ -21,7 +21,7 @@ type ConfigureGatewayOptions = {
|
||||
};
|
||||
|
||||
type ConfigureGatewayResult = {
|
||||
nextConfig: MoltbotConfig;
|
||||
nextConfig: OpenClawConfig;
|
||||
settings: GatewayWizardSettings;
|
||||
};
|
||||
|
||||
@@ -145,7 +145,9 @@ export async function configureGatewayForOnboarding(
|
||||
let tailscaleResetOnExit = flow === "quickstart" ? quickstartGateway.tailscaleResetOnExit : false;
|
||||
if (tailscaleMode !== "off" && flow !== "quickstart") {
|
||||
await prompter.note(
|
||||
["Docs:", "https://docs.molt.bot/gateway/tailscale", "https://docs.molt.bot/web"].join("\n"),
|
||||
["Docs:", "https://docs.openclaw.ai/gateway/tailscale", "https://docs.openclaw.ai/web"].join(
|
||||
"\n",
|
||||
),
|
||||
"Tailscale",
|
||||
);
|
||||
tailscaleResetOnExit = Boolean(
|
||||
|
||||
@@ -77,7 +77,7 @@ vi.mock("../tui/tui.js", () => ({
|
||||
describe("runOnboardingWizard", () => {
|
||||
it("exits when config is invalid", async () => {
|
||||
readConfigFileSnapshot.mockResolvedValueOnce({
|
||||
path: "/tmp/.clawdbot/moltbot.json",
|
||||
path: "/tmp/.openclaw/openclaw.json",
|
||||
exists: true,
|
||||
raw: "{}",
|
||||
parsed: {},
|
||||
@@ -174,7 +174,7 @@ describe("runOnboardingWizard", () => {
|
||||
it("launches TUI without auto-delivery when hatching", async () => {
|
||||
runTui.mockClear();
|
||||
|
||||
const workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-onboard-"));
|
||||
const workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-onboard-"));
|
||||
await fs.writeFile(path.join(workspaceDir, DEFAULT_BOOTSTRAP_FILENAME), "{}");
|
||||
|
||||
const select: WizardPrompter["select"] = vi.fn(async (opts) => {
|
||||
@@ -230,7 +230,7 @@ describe("runOnboardingWizard", () => {
|
||||
it("offers TUI hatch even without BOOTSTRAP.md", async () => {
|
||||
runTui.mockClear();
|
||||
|
||||
const workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "moltbot-onboard-"));
|
||||
const workspaceDir = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-onboard-"));
|
||||
|
||||
const select: WizardPrompter["select"] = vi.fn(async (opts) => {
|
||||
if (opts.message === "How do you want to hatch your bot?") return "tui";
|
||||
|
||||
@@ -27,7 +27,7 @@ import type {
|
||||
ResetScope,
|
||||
} from "../commands/onboard-types.js";
|
||||
import { formatCliCommand } from "../cli/command-format.js";
|
||||
import type { MoltbotConfig } from "../config/config.js";
|
||||
import type { OpenClawConfig } from "../config/config.js";
|
||||
import {
|
||||
DEFAULT_GATEWAY_PORT,
|
||||
readConfigFileSnapshot,
|
||||
@@ -53,11 +53,11 @@ async function requireRiskAcknowledgement(params: {
|
||||
[
|
||||
"Security warning — please read.",
|
||||
"",
|
||||
"Moltbot is a hobby project and still in beta. Expect sharp edges.",
|
||||
"OpenClaw is a hobby project and still in beta. Expect sharp edges.",
|
||||
"This bot can read files and run actions if tools are enabled.",
|
||||
"A bad prompt can trick it into doing unsafe things.",
|
||||
"",
|
||||
"If you’re not comfortable with basic security and access control, don’t run Moltbot.",
|
||||
"If you’re not comfortable with basic security and access control, don’t run OpenClaw.",
|
||||
"Ask someone experienced to help before enabling tools or exposing it to the internet.",
|
||||
"",
|
||||
"Recommended baseline:",
|
||||
@@ -67,10 +67,10 @@ async function requireRiskAcknowledgement(params: {
|
||||
"- Use the strongest available model for any bot with tools or untrusted inboxes.",
|
||||
"",
|
||||
"Run regularly:",
|
||||
"moltbot security audit --deep",
|
||||
"moltbot security audit --fix",
|
||||
"openclaw security audit --deep",
|
||||
"openclaw security audit --fix",
|
||||
"",
|
||||
"Must read: https://docs.molt.bot/gateway/security",
|
||||
"Must read: https://docs.openclaw.ai/gateway/security",
|
||||
].join("\n"),
|
||||
"Security",
|
||||
);
|
||||
@@ -90,11 +90,11 @@ export async function runOnboardingWizard(
|
||||
prompter: WizardPrompter,
|
||||
) {
|
||||
printWizardHeader(runtime);
|
||||
await prompter.intro("Moltbot onboarding");
|
||||
await prompter.intro("OpenClaw onboarding");
|
||||
await requireRiskAcknowledgement({ opts, prompter });
|
||||
|
||||
const snapshot = await readConfigFileSnapshot();
|
||||
let baseConfig: MoltbotConfig = snapshot.valid ? snapshot.config : {};
|
||||
let baseConfig: OpenClawConfig = snapshot.valid ? snapshot.config : {};
|
||||
|
||||
if (snapshot.exists && !snapshot.valid) {
|
||||
await prompter.note(summarizeExistingConfig(baseConfig), "Invalid config");
|
||||
@@ -103,19 +103,19 @@ export async function runOnboardingWizard(
|
||||
[
|
||||
...snapshot.issues.map((iss) => `- ${iss.path}: ${iss.message}`),
|
||||
"",
|
||||
"Docs: https://docs.molt.bot/gateway/configuration",
|
||||
"Docs: https://docs.openclaw.ai/gateway/configuration",
|
||||
].join("\n"),
|
||||
"Config issues",
|
||||
);
|
||||
}
|
||||
await prompter.outro(
|
||||
`Config invalid. Run \`${formatCliCommand("moltbot doctor")}\` to repair it, then re-run onboarding.`,
|
||||
`Config invalid. Run \`${formatCliCommand("openclaw doctor")}\` to repair it, then re-run onboarding.`,
|
||||
);
|
||||
runtime.exit(1);
|
||||
return;
|
||||
}
|
||||
|
||||
const quickstartHint = `Configure details later via ${formatCliCommand("moltbot configure")}.`;
|
||||
const quickstartHint = `Configure details later via ${formatCliCommand("openclaw configure")}.`;
|
||||
const manualHint = "Configure port, network, Tailscale, and auth options.";
|
||||
const explicitFlowRaw = opts.flow?.trim();
|
||||
const normalizedExplicitFlow = explicitFlowRaw === "manual" ? "advanced" : explicitFlowRaw;
|
||||
@@ -278,8 +278,8 @@ export async function runOnboardingWizard(
|
||||
const localUrl = `ws://127.0.0.1:${localPort}`;
|
||||
const localProbe = await probeGatewayReachable({
|
||||
url: localUrl,
|
||||
token: baseConfig.gateway?.auth?.token ?? process.env.CLAWDBOT_GATEWAY_TOKEN,
|
||||
password: baseConfig.gateway?.auth?.password ?? process.env.CLAWDBOT_GATEWAY_PASSWORD,
|
||||
token: baseConfig.gateway?.auth?.token ?? process.env.OPENCLAW_GATEWAY_TOKEN,
|
||||
password: baseConfig.gateway?.auth?.password ?? process.env.OPENCLAW_GATEWAY_PASSWORD,
|
||||
});
|
||||
const remoteUrl = baseConfig.gateway?.remote?.url?.trim() ?? "";
|
||||
const remoteProbe = remoteUrl
|
||||
@@ -335,7 +335,7 @@ export async function runOnboardingWizard(
|
||||
|
||||
const workspaceDir = resolveUserPath(workspaceInput.trim() || DEFAULT_WORKSPACE);
|
||||
|
||||
let nextConfig: MoltbotConfig = {
|
||||
let nextConfig: OpenClawConfig = {
|
||||
...baseConfig,
|
||||
agents: {
|
||||
...baseConfig.agents,
|
||||
|
||||
Reference in New Issue
Block a user