Skip to content

Commit b1aa058

Browse files
committed
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".
1 parent ee6f458 commit b1aa058

1 file changed

Lines changed: 17 additions & 5 deletions

File tree

scripts/modules/commands.js

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,6 +3262,10 @@ ${result.result}
32623262
'--bedrock',
32633263
'Allow setting a custom Bedrock model ID (use with --set-*) '
32643264
)
3265+
.option(
3266+
'--claude-code',
3267+
'Allow setting a Claude Code model ID (use with --set-*)'
3268+
)
32653269
.addHelpText(
32663270
'after',
32673271
`
@@ -3273,6 +3277,7 @@ Examples:
32733277
$ task-master models --set-main my-custom-model --ollama # Set custom Ollama model for main role
32743278
$ task-master models --set-main anthropic.claude-3-sonnet-20240229-v1:0 --bedrock # Set custom Bedrock model for main role
32753279
$ task-master models --set-main some/other-model --openrouter # Set custom OpenRouter model for main role
3280+
$ task-master models --set-main sonnet --claude-code # Set Claude Code model for main role
32763281
$ task-master models --setup # Run interactive setup`
32773282
)
32783283
.action(async (options) => {
@@ -3285,12 +3290,13 @@ Examples:
32853290
const providerFlags = [
32863291
options.openrouter,
32873292
options.ollama,
3288-
options.bedrock
3293+
options.bedrock,
3294+
options.claudeCode
32893295
].filter(Boolean).length;
32903296
if (providerFlags > 1) {
32913297
console.error(
32923298
chalk.red(
3293-
'Error: Cannot use multiple provider flags (--openrouter, --ollama, --bedrock) simultaneously.'
3299+
'Error: Cannot use multiple provider flags (--openrouter, --ollama, --bedrock, --claude-code) simultaneously.'
32943300
)
32953301
);
32963302
process.exit(1);
@@ -3332,7 +3338,9 @@ Examples:
33323338
? 'ollama'
33333339
: options.bedrock
33343340
? 'bedrock'
3335-
: undefined
3341+
: options.claudeCode
3342+
? 'claude-code'
3343+
: undefined
33363344
});
33373345
if (result.success) {
33383346
console.log(chalk.green(`✅ ${result.data.message}`));
@@ -3354,7 +3362,9 @@ Examples:
33543362
? 'ollama'
33553363
: options.bedrock
33563364
? 'bedrock'
3357-
: undefined
3365+
: options.claudeCode
3366+
? 'claude-code'
3367+
: undefined
33583368
});
33593369
if (result.success) {
33603370
console.log(chalk.green(`✅ ${result.data.message}`));
@@ -3378,7 +3388,9 @@ Examples:
33783388
? 'ollama'
33793389
: options.bedrock
33803390
? 'bedrock'
3381-
: undefined
3391+
: options.claudeCode
3392+
? 'claude-code'
3393+
: undefined
33823394
});
33833395
if (result.success) {
33843396
console.log(chalk.green(`✅ ${result.data.message}`));

0 commit comments

Comments
 (0)