fix(models): add missing --claude-code flag to models command
The models command was missing the --claude-code provider flag, preventing users from setting Claude Code models via CLI. While the backend already supported claude-code as a provider hint, there was no command-line flag to trigger it. Changes: - Added --claude-code option to models command alongside existing provider flags - Updated provider flags validation to include claudeCode option - Added claude-code to providerHint logic for all three model roles (main, research, fallback) - Updated error message to include --claude-code in list of mutually exclusive flags - Added example usage in help text This allows users to properly set Claude Code models using commands like: task-master models --set-main sonnet --claude-code task-master models --set-main opus --claude-code Without this flag, users would get "Model ID not found" errors when trying to set claude-code models, as the system couldn't determine the correct provider for generic model names like "sonnet" or "opus".
This commit is contained in:
committed by
Ralph Khreish
parent
e69ac5d5cf
commit
3fa91f56e5
@@ -3404,6 +3404,10 @@ ${result.result}
|
|||||||
'--bedrock',
|
'--bedrock',
|
||||||
'Allow setting a custom Bedrock model ID (use with --set-*) '
|
'Allow setting a custom Bedrock model ID (use with --set-*) '
|
||||||
)
|
)
|
||||||
|
.option(
|
||||||
|
'--claude-code',
|
||||||
|
'Allow setting a Claude Code model ID (use with --set-*)'
|
||||||
|
)
|
||||||
.option(
|
.option(
|
||||||
'--azure',
|
'--azure',
|
||||||
'Allow setting a custom Azure OpenAI model ID (use with --set-*) '
|
'Allow setting a custom Azure OpenAI model ID (use with --set-*) '
|
||||||
@@ -3423,6 +3427,7 @@ Examples:
|
|||||||
$ task-master models --set-main my-custom-model --ollama # Set custom Ollama model for main role
|
$ task-master models --set-main my-custom-model --ollama # Set custom Ollama model for main role
|
||||||
$ task-master models --set-main anthropic.claude-3-sonnet-20240229-v1:0 --bedrock # Set custom Bedrock model for main role
|
$ task-master models --set-main anthropic.claude-3-sonnet-20240229-v1:0 --bedrock # Set custom Bedrock model for main role
|
||||||
$ task-master models --set-main some/other-model --openrouter # Set custom OpenRouter model for main role
|
$ task-master models --set-main some/other-model --openrouter # Set custom OpenRouter model for main role
|
||||||
|
$ task-master models --set-main sonnet --claude-code # Set Claude Code model for main role
|
||||||
$ task-master models --set-main gpt-4o --azure # Set custom Azure OpenAI model for main role
|
$ task-master models --set-main gpt-4o --azure # Set custom Azure OpenAI model for main role
|
||||||
$ task-master models --set-main claude-3-5-sonnet@20241022 --vertex # Set custom Vertex AI model for main role
|
$ task-master models --set-main claude-3-5-sonnet@20241022 --vertex # Set custom Vertex AI model for main role
|
||||||
$ task-master models --setup # Run interactive setup`
|
$ task-master models --setup # Run interactive setup`
|
||||||
@@ -3437,12 +3442,13 @@ Examples:
|
|||||||
const providerFlags = [
|
const providerFlags = [
|
||||||
options.openrouter,
|
options.openrouter,
|
||||||
options.ollama,
|
options.ollama,
|
||||||
options.bedrock
|
options.bedrock,
|
||||||
|
options.claudeCode
|
||||||
].filter(Boolean).length;
|
].filter(Boolean).length;
|
||||||
if (providerFlags > 1) {
|
if (providerFlags > 1) {
|
||||||
console.error(
|
console.error(
|
||||||
chalk.red(
|
chalk.red(
|
||||||
'Error: Cannot use multiple provider flags (--openrouter, --ollama, --bedrock) simultaneously.'
|
'Error: Cannot use multiple provider flags (--openrouter, --ollama, --bedrock, --claude-code) simultaneously.'
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
@@ -3484,7 +3490,9 @@ Examples:
|
|||||||
? 'ollama'
|
? 'ollama'
|
||||||
: options.bedrock
|
: options.bedrock
|
||||||
? 'bedrock'
|
? 'bedrock'
|
||||||
: undefined
|
: options.claudeCode
|
||||||
|
? 'claude-code'
|
||||||
|
: undefined
|
||||||
});
|
});
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
console.log(chalk.green(`✅ ${result.data.message}`));
|
console.log(chalk.green(`✅ ${result.data.message}`));
|
||||||
@@ -3506,7 +3514,9 @@ Examples:
|
|||||||
? 'ollama'
|
? 'ollama'
|
||||||
: options.bedrock
|
: options.bedrock
|
||||||
? 'bedrock'
|
? 'bedrock'
|
||||||
: undefined
|
: options.claudeCode
|
||||||
|
? 'claude-code'
|
||||||
|
: undefined
|
||||||
});
|
});
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
console.log(chalk.green(`✅ ${result.data.message}`));
|
console.log(chalk.green(`✅ ${result.data.message}`));
|
||||||
@@ -3530,7 +3540,9 @@ Examples:
|
|||||||
? 'ollama'
|
? 'ollama'
|
||||||
: options.bedrock
|
: options.bedrock
|
||||||
? 'bedrock'
|
? 'bedrock'
|
||||||
: undefined
|
: options.claudeCode
|
||||||
|
? 'claude-code'
|
||||||
|
: undefined
|
||||||
});
|
});
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
console.log(chalk.green(`✅ ${result.data.message}`));
|
console.log(chalk.green(`✅ ${result.data.message}`));
|
||||||
|
|||||||
Reference in New Issue
Block a user