feat: projcet Initialization
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { spawn } from 'node:child_process'
|
||||
|
||||
const commands = {
|
||||
codex: ['codex'],
|
||||
'claude-code': ['claude'],
|
||||
gemini: ['gemini']
|
||||
}
|
||||
|
||||
export function resolveAgentCommand(agent) {
|
||||
return commands[agent] ?? [agent]
|
||||
}
|
||||
|
||||
export async function commandExists(command) {
|
||||
return new Promise((resolve) => {
|
||||
const child = spawn('which', [command], { stdio: 'ignore' })
|
||||
child.on('close', (code) => resolve(code === 0))
|
||||
child.on('error', () => resolve(false))
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user