feat: add --dev/--profile CLI profiles

This commit is contained in:
Peter Steinberger
2026-01-05 01:25:37 +01:00
parent f601dac30d
commit c6de1b1f7d
19 changed files with 516 additions and 25 deletions

View File

@@ -5,7 +5,18 @@ import { fileURLToPath } from "node:url";
import { resolveUserPath } from "../utils.js";
export const DEFAULT_AGENT_WORKSPACE_DIR = path.join(os.homedir(), "clawd");
export function resolveDefaultAgentWorkspaceDir(
env: NodeJS.ProcessEnv = process.env,
homedir: () => string = os.homedir,
): string {
const profile = env.CLAWDBOT_PROFILE?.trim();
if (profile && profile.toLowerCase() !== "default") {
return path.join(homedir(), `clawd-${profile}`);
}
return path.join(homedir(), "clawd");
}
export const DEFAULT_AGENT_WORKSPACE_DIR = resolveDefaultAgentWorkspaceDir();
export const DEFAULT_AGENTS_FILENAME = "AGENTS.md";
export const DEFAULT_SOUL_FILENAME = "SOUL.md";
export const DEFAULT_TOOLS_FILENAME = "TOOLS.md";