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

@@ -5,7 +5,7 @@ import { isTruthyEnvValue } from "./env.js";
import { resolveBrewPathDirs } from "./brew.js";
type EnsureClawdbotPathOpts = {
type EnsureMoltbotPathOpts = {
execPath?: string;
cwd?: string;
homeDir?: string;
@@ -48,7 +48,7 @@ function mergePath(params: { existing: string; prepend: string[] }): string {
return merged.join(path.delimiter);
}
function candidateBinDirs(opts: EnsureClawdbotPathOpts): string[] {
function candidateBinDirs(opts: EnsureMoltbotPathOpts): string[] {
const execPath = opts.execPath ?? process.execPath;
const cwd = opts.cwd ?? process.cwd();
const homeDir = opts.homeDir ?? os.homedir();
@@ -56,19 +56,19 @@ function candidateBinDirs(opts: EnsureClawdbotPathOpts): string[] {
const candidates: string[] = [];
// Bundled macOS app: `clawdbot` lives next to the executable (process.execPath).
// Bundled macOS app: `moltbot` lives next to the executable (process.execPath).
try {
const execDir = path.dirname(execPath);
const siblingClawdbot = path.join(execDir, "clawdbot");
if (isExecutable(siblingClawdbot)) candidates.push(execDir);
const siblingMoltbot = path.join(execDir, "moltbot");
if (isExecutable(siblingMoltbot)) candidates.push(execDir);
} catch {
// ignore
}
// Project-local installs (best effort): if a `node_modules/.bin/clawdbot` exists near cwd,
// Project-local installs (best effort): if a `node_modules/.bin/moltbot` exists near cwd,
// include it. This helps when running under launchd or other minimal PATH environments.
const localBinDir = path.join(cwd, "node_modules", ".bin");
if (isExecutable(path.join(localBinDir, "clawdbot"))) candidates.push(localBinDir);
if (isExecutable(path.join(localBinDir, "moltbot"))) candidates.push(localBinDir);
const miseDataDir = process.env.MISE_DATA_DIR ?? path.join(homeDir, ".local", "share", "mise");
const miseShims = path.join(miseDataDir, "shims");
@@ -91,10 +91,10 @@ function candidateBinDirs(opts: EnsureClawdbotPathOpts): string[] {
}
/**
* Best-effort PATH bootstrap so skills that require the `clawdbot` CLI can run
* Best-effort PATH bootstrap so skills that require the `moltbot` CLI can run
* under launchd/minimal environments (and inside the macOS app bundle).
*/
export function ensureClawdbotCliOnPath(opts: EnsureClawdbotPathOpts = {}) {
export function ensureMoltbotCliOnPath(opts: EnsureMoltbotPathOpts = {}) {
if (isTruthyEnvValue(process.env.CLAWDBOT_PATH_BOOTSTRAPPED)) return;
process.env.CLAWDBOT_PATH_BOOTSTRAPPED = "1";