CLI: add clawdbot update command and --update flag

This commit is contained in:
Claude
2026-01-10 18:18:10 +00:00
committed by Peter Steinberger
parent 9f9098406c
commit 777fb6b7bb
4 changed files with 362 additions and 0 deletions

View File

@@ -8,6 +8,7 @@ import { ensureClawdbotCliOnPath } from "../infra/path-env.js";
import { assertSupportedRuntime } from "../infra/runtime-guard.js";
import { installUnhandledRejectionHandler } from "../infra/unhandled-rejections.js";
import { enableConsoleCapture } from "../logging.js";
import { updateCommand } from "./update-cli.js";
export async function runCli(argv: string[] = process.argv) {
loadDotEnv({ quiet: true });
@@ -20,6 +21,12 @@ export async function runCli(argv: string[] = process.argv) {
// Enforce the minimum supported runtime before doing any work.
assertSupportedRuntime();
// Handle --update flag before full program parsing
if (argv.includes("--update")) {
await updateCommand({});
return;
}
const { buildProgram } = await import("./program.js");
const program = buildProgram();