Files
oh-my-pi/packages/coding-agent/src/cli.ts
T
can1357 92fc4f2d9a fix(coding-agent): fixed CLI invocation with flags only to route to default command
- Fixed CLI invocation with flags only (e.g. `pi --model=codex`) to route to the default command instead of erroring.
2026-02-05 14:34:32 +01:00

19 lines
620 B
TypeScript
Executable File

#!/usr/bin/env bun
/**
* CLI entry point for the refactored coding agent.
* Uses main.ts with AgentSession and new mode modules.
*
* Test with: npx tsx src/cli-new.ts [args...]
*/
import { run } from "@oclif/core";
import { APP_NAME } from "./config";
process.title = APP_NAME;
const argv = process.argv.slice(2);
const runArgv = argv.length === 0 || argv[0]?.startsWith("-") ? ["index", ...argv] : argv;
run(runArgv, import.meta.url).catch((error: unknown) => {
const message = error instanceof Error ? (error.stack ?? error.message) : String(error);
process.stderr.write(`${message}\n`);
process.exit(1);
});