92fc4f2d9a
- Fixed CLI invocation with flags only (e.g. `pi --model=codex`) to route to the default command instead of erroring.
19 lines
620 B
TypeScript
Executable File
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);
|
|
});
|