add more codex logic

This commit is contained in:
Shawn Morreau
2025-11-12 19:22:48 -05:00
parent 71698d3e07
commit 7aaebe9584
9 changed files with 948 additions and 907 deletions
+16
View File
@@ -0,0 +1,16 @@
import { spawnSync } from "child_process";
import { existsSync } from "fs";
function findCliPath(name: string): string | null {
const result = spawnSync("which", [name], { encoding: "utf-8" });
if (result.status === 0 && result.stdout) {
const cliPath = result.stdout.trim();
if (cliPath && existsSync(cliPath)) {
return cliPath;
}
}
return null;
}
console.log(findCliPath("codei"));