feat: projcet Initialization

This commit is contained in:
2026-05-03 09:38:24 +08:00
commit 81bca6aa80
22 changed files with 1867 additions and 0 deletions
+20
View File
@@ -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))
})
}