refactor: rename clawdbot to moltbot with legacy compat

This commit is contained in:
Peter Steinberger
2026-01-27 12:19:58 +00:00
parent 83460df96f
commit 6d16a658e5
1839 changed files with 11250 additions and 11199 deletions

View File

@@ -71,9 +71,7 @@ export async function ensureConfigReady(params: {
params.runtime.error(legacyIssues.map((issue) => ` ${error(issue)}`).join("\n"));
}
params.runtime.error("");
params.runtime.error(
`${muted("Run:")} ${commandText(formatCliCommand("clawdbot doctor --fix"))}`,
);
params.runtime.error(`${muted("Run:")} ${commandText(formatCliCommand("moltbot doctor --fix"))}`);
if (!allowInvalid) {
params.runtime.exit(1);
}

View File

@@ -8,24 +8,21 @@ import type { ProgramContext } from "./context.js";
const CLI_NAME = resolveCliName();
const EXAMPLES = [
["moltbot channels login --verbose", "Link personal WhatsApp Web and show QR + connection logs."],
[
"clawdbot channels login --verbose",
"Link personal WhatsApp Web and show QR + connection logs.",
],
[
'clawdbot message send --target +15555550123 --message "Hi" --json',
'moltbot message send --target +15555550123 --message "Hi" --json',
"Send via your web session and print JSON result.",
],
["clawdbot gateway --port 18789", "Run the WebSocket Gateway locally."],
["clawdbot --dev gateway", "Run a dev Gateway (isolated state/config) on ws://127.0.0.1:19001."],
["clawdbot gateway --force", "Kill anything bound to the default gateway port, then start it."],
["clawdbot gateway ...", "Gateway control via WebSocket."],
["moltbot gateway --port 18789", "Run the WebSocket Gateway locally."],
["moltbot --dev gateway", "Run a dev Gateway (isolated state/config) on ws://127.0.0.1:19001."],
["moltbot gateway --force", "Kill anything bound to the default gateway port, then start it."],
["moltbot gateway ...", "Gateway control via WebSocket."],
[
'clawdbot agent --to +15555550123 --message "Run summary" --deliver',
'moltbot agent --to +15555550123 --message "Run summary" --deliver',
"Talk directly to the agent using the Gateway; optionally send the WhatsApp reply.",
],
[
'clawdbot message send --channel telegram --target @mychat --message "Hi"',
'moltbot message send --channel telegram --target @mychat --message "Hi"',
"Send via your Telegram bot.",
],
] as const;

View File

@@ -51,19 +51,19 @@ export function registerAgentCommands(program: Command, args: { agentChannelOpti
`
${theme.heading("Examples:")}
${formatHelpExamples([
['clawdbot agent --to +15555550123 --message "status update"', "Start a new session."],
['clawdbot agent --agent ops --message "Summarize logs"', "Use a specific agent."],
['moltbot agent --to +15555550123 --message "status update"', "Start a new session."],
['moltbot agent --agent ops --message "Summarize logs"', "Use a specific agent."],
[
'clawdbot agent --session-id 1234 --message "Summarize inbox" --thinking medium',
'moltbot agent --session-id 1234 --message "Summarize inbox" --thinking medium',
"Target a session with explicit thinking level.",
],
[
'clawdbot agent --to +15555550123 --message "Trace logs" --verbose on --json',
'moltbot agent --to +15555550123 --message "Trace logs" --verbose on --json',
"Enable verbose logging and JSON output.",
],
['clawdbot agent --to +15555550123 --message "Summon reply" --deliver', "Deliver reply."],
['moltbot agent --to +15555550123 --message "Summon reply" --deliver', "Deliver reply."],
[
'clawdbot agent --agent ops --message "Generate report" --deliver --reply-channel slack --reply-to "#reports"',
'moltbot agent --agent ops --message "Generate report" --deliver --reply-channel slack --reply-to "#reports"',
"Send reply to a different channel/target.",
],
])}
@@ -155,11 +155,11 @@ ${theme.muted("Docs:")} ${formatDocsLink("/cli/agent", "docs.molt.bot/cli/agent"
`
${theme.heading("Examples:")}
${formatHelpExamples([
['clawdbot agents set-identity --agent main --name "Clawd" --emoji "🦞"', "Set name + emoji."],
["clawdbot agents set-identity --agent main --avatar avatars/clawd.png", "Set avatar path."],
["clawdbot agents set-identity --workspace ~/clawd --from-identity", "Load from IDENTITY.md."],
['moltbot agents set-identity --agent main --name "Clawd" --emoji "🦞"', "Set name + emoji."],
["moltbot agents set-identity --agent main --avatar avatars/clawd.png", "Set avatar path."],
["moltbot agents set-identity --workspace ~/clawd --from-identity", "Load from IDENTITY.md."],
[
"clawdbot agents set-identity --identity-file ~/clawd/IDENTITY.md --agent main",
"moltbot agents set-identity --identity-file ~/clawd/IDENTITY.md --agent main",
"Use a specific IDENTITY.md.",
],
])}

View File

@@ -31,17 +31,17 @@ export function registerMessageCommands(program: Command, ctx: ProgramContext) {
`
${theme.heading("Examples:")}
${formatHelpExamples([
['clawdbot message send --target +15555550123 --message "Hi"', "Send a text message."],
['moltbot message send --target +15555550123 --message "Hi"', "Send a text message."],
[
'clawdbot message send --target +15555550123 --message "Hi" --media photo.jpg',
'moltbot message send --target +15555550123 --message "Hi" --media photo.jpg',
"Send a message with media.",
],
[
'clawdbot message poll --channel discord --target channel:123 --poll-question "Snack?" --poll-option Pizza --poll-option Sushi',
'moltbot message poll --channel discord --target channel:123 --poll-question "Snack?" --poll-option Pizza --poll-option Sushi',
"Create a Discord poll.",
],
[
'clawdbot message react --channel discord --target 123 --message-id 456 --emoji "✅"',
'moltbot message react --channel discord --target 123 --message-id 456 --emoji "✅"',
"React to a message.",
],
])}

View File

@@ -10,7 +10,7 @@ import { runCommandWithRuntime } from "../cli-utils.js";
export function registerSetupCommand(program: Command) {
program
.command("setup")
.description("Initialize ~/.clawdbot/clawdbot.json and the agent workspace")
.description("Initialize ~/.clawdbot/moltbot.json and the agent workspace")
.addHelpText(
"after",
() =>

View File

@@ -39,15 +39,15 @@ export function registerStatusHealthSessionsCommands(program: Command) {
"after",
() =>
`\n${theme.heading("Examples:")}\n${formatHelpExamples([
["clawdbot status", "Show channel health + session summary."],
["clawdbot status --all", "Full diagnosis (read-only)."],
["clawdbot status --json", "Machine-readable output."],
["clawdbot status --usage", "Show model provider usage/quota snapshots."],
["moltbot status", "Show channel health + session summary."],
["moltbot status --all", "Full diagnosis (read-only)."],
["moltbot status --json", "Machine-readable output."],
["moltbot status --usage", "Show model provider usage/quota snapshots."],
[
"clawdbot status --deep",
"moltbot status --deep",
"Run channel probes (WA + Telegram + Discord + Slack + Signal).",
],
["clawdbot status --deep --timeout 5000", "Tighten probe timeout."],
["moltbot status --deep --timeout 5000", "Tighten probe timeout."],
])}`,
)
.addHelpText(
@@ -119,10 +119,10 @@ export function registerStatusHealthSessionsCommands(program: Command) {
"after",
() =>
`\n${theme.heading("Examples:")}\n${formatHelpExamples([
["clawdbot sessions", "List all sessions."],
["clawdbot sessions --active 120", "Only last 2 hours."],
["clawdbot sessions --json", "Machine-readable output."],
["clawdbot sessions --store ./tmp/sessions.json", "Use a specific session store."],
["moltbot sessions", "List all sessions."],
["moltbot sessions --active 120", "Only last 2 hours."],
["moltbot sessions --json", "Machine-readable output."],
["moltbot sessions --store ./tmp/sessions.json", "Use a specific session store."],
])}\n\n${theme.muted(
"Shows token usage per session when the agent reports it; set agents.defaults.contextTokens to see % of your model window.",
)}`,

View File

@@ -42,7 +42,7 @@ describe("registerSubCliCommands", () => {
});
it("registers only the primary placeholder and dispatches", async () => {
process.argv = ["node", "clawdbot", "acp"];
process.argv = ["node", "moltbot", "acp"];
const program = new Command();
registerSubCliCommands(program, process.argv);
@@ -55,7 +55,7 @@ describe("registerSubCliCommands", () => {
});
it("registers placeholders for all subcommands when no primary", () => {
process.argv = ["node", "clawdbot"];
process.argv = ["node", "moltbot"];
const program = new Command();
registerSubCliCommands(program, process.argv);
@@ -66,9 +66,9 @@ describe("registerSubCliCommands", () => {
});
it("re-parses argv for lazy subcommands", async () => {
process.argv = ["node", "clawdbot", "nodes", "list"];
process.argv = ["node", "moltbot", "nodes", "list"];
const program = new Command();
program.name("clawdbot");
program.name("moltbot");
registerSubCliCommands(program, process.argv);
expect(program.commands.map((cmd) => cmd.name())).toEqual(["nodes"]);
@@ -80,9 +80,9 @@ describe("registerSubCliCommands", () => {
});
it("replaces placeholder when registering a subcommand by name", async () => {
process.argv = ["node", "clawdbot", "acp", "--help"];
process.argv = ["node", "moltbot", "acp", "--help"];
const program = new Command();
program.name("clawdbot");
program.name("moltbot");
registerSubCliCommands(program, process.argv);
await registerSubCliByName(program, "acp");
@@ -90,7 +90,7 @@ describe("registerSubCliCommands", () => {
const names = program.commands.map((cmd) => cmd.name());
expect(names.filter((name) => name === "acp")).toHaveLength(1);
await program.parseAsync(["node", "clawdbot", "acp"], { from: "user" });
await program.parseAsync(["node", "moltbot", "acp"], { from: "user" });
expect(registerAcpCli).toHaveBeenCalledTimes(1);
expect(acpAction).toHaveBeenCalledTimes(1);
});

View File

@@ -1,5 +1,5 @@
import type { Command } from "commander";
import type { ClawdbotConfig } from "../../config/config.js";
import type { MoltbotConfig } from "../../config/config.js";
import { isTruthyEnvValue } from "../../infra/env.js";
import { buildParseArgv, getPrimaryCommand, hasHelpOrVersion } from "../argv.js";
import { resolveActionArgs } from "./helpers.js";
@@ -22,7 +22,7 @@ const shouldEagerRegisterSubcommands = (_argv: string[]) => {
return isTruthyEnvValue(process.env.CLAWDBOT_DISABLE_LAZY_SUBCOMMANDS);
};
const loadConfig = async (): Promise<ClawdbotConfig> => {
const loadConfig = async (): Promise<MoltbotConfig> => {
const mod = await import("../../config/config.js");
return mod.loadConfig();
};