mirror of
https://github.com/wu736139669/hapi.git
synced 2026-08-06 06:41:56 +00:00
feat: add --model parameter support to command handlers
Pass model selection through command pipeline to enable model switching during runtime close #83, close #64
This commit is contained in:
@@ -41,6 +41,13 @@ export const claudeCommand: CommandDefinition = {
|
||||
} else if (arg === '--dangerously-skip-permissions') {
|
||||
options.permissionMode = 'bypassPermissions'
|
||||
unknownArgs.push(arg)
|
||||
} else if (arg === '--model') {
|
||||
const model = args[++i]
|
||||
if (!model) {
|
||||
throw new Error('Missing --model value')
|
||||
}
|
||||
options.model = model
|
||||
unknownArgs.push('--model', model)
|
||||
} else if (arg === '--started-by') {
|
||||
options.startedBy = args[++i] as 'runner' | 'terminal'
|
||||
} else {
|
||||
|
||||
@@ -17,6 +17,7 @@ export const codexCommand: CommandDefinition = {
|
||||
codexArgs?: string[]
|
||||
permissionMode?: CodexPermissionMode
|
||||
resumeSessionId?: string
|
||||
model?: string
|
||||
} = {}
|
||||
const unknownArgs: string[] = []
|
||||
|
||||
@@ -36,6 +37,13 @@ export const codexCommand: CommandDefinition = {
|
||||
} else if (arg === '--yolo' || arg === '--dangerously-bypass-approvals-and-sandbox') {
|
||||
options.permissionMode = 'yolo'
|
||||
unknownArgs.push(arg)
|
||||
} else if (arg === '--model') {
|
||||
const model = commandArgs[++i]
|
||||
if (!model) {
|
||||
throw new Error('Missing --model value')
|
||||
}
|
||||
options.model = model
|
||||
unknownArgs.push('--model', model)
|
||||
} else {
|
||||
unknownArgs.push(arg)
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ export const geminiCommand: CommandDefinition = {
|
||||
startedBy?: 'runner' | 'terminal'
|
||||
startingMode?: 'local' | 'remote'
|
||||
permissionMode?: GeminiPermissionMode
|
||||
model?: string
|
||||
} = {}
|
||||
|
||||
for (let i = 0; i < commandArgs.length; i++) {
|
||||
@@ -29,6 +30,12 @@ export const geminiCommand: CommandDefinition = {
|
||||
}
|
||||
} else if (arg === '--yolo') {
|
||||
options.permissionMode = 'yolo'
|
||||
} else if (arg === '--model') {
|
||||
const model = commandArgs[++i]
|
||||
if (!model) {
|
||||
throw new Error('Missing --model value')
|
||||
}
|
||||
options.model = model
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user