Skip to content

feat(cli): dynamic model/provider selection in init command#112

Open
stepandel wants to merge 1 commit intofeature/AGE-148-expand-model-providersfrom
feature/AGE-149-dynamic-provider-selection
Open

feat(cli): dynamic model/provider selection in init command#112
stepandel wants to merge 1 commit intofeature/AGE-148-expand-model-providersfrom
feature/AGE-149-dynamic-provider-selection

Conversation

@stepandel
Copy link
Owner

Summary

Replaces the hardcoded Anthropic API key collection in clawup init with a dynamic provider selection flow powered by MODEL_PROVIDERS.

Changes

  • packages/cli/commands/init.ts — Provider picker, dynamic model list, provider-aware API key validation and storage

How it works

  1. User picks a model provider (Anthropic, OpenAI, Google, OpenRouter)
  2. Available models shown from MODEL_PROVIDERS[provider].models
  3. For providers with empty model lists (OpenRouter), free-form model input
  4. API key collected with provider-specific prefix validation and setup instructions
  5. Config stores modelProvider, defaultModel, and the provider's env var as a secret

Backward compatibility

Selecting Anthropic produces equivalent behavior to the previous hardcoded flow.

Depends on: #111 (AGE-148)
Closes AGE-149

- Replace hardcoded Anthropic API key collection with provider picker
- Show models from MODEL_PROVIDERS for selected provider
- Free-form model input for providers with empty model lists (OpenRouter)
- Provider-specific API key validation and instructions
- Store modelProvider, defaultModel, and provider env var in Pulumi config
- Backward compatible: selecting Anthropic produces equivalent behavior

Closes AGE-149
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/AGE-149-dynamic-provider-selection

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@stepandel
Copy link
Owner Author

🔍 QA Review — APPROVED

All acceptance criteria for AGE-149 verified against the diff:

  • ✅ Init wizard shows provider selection (Anthropic, OpenAI, Google, OpenRouter) via MODEL_PROVIDERS
  • ✅ Model list dynamically populated from MODEL_PROVIDERS[provider].models
  • ✅ Free-form model input for providers with empty models array (OpenRouter)
  • ✅ API key validation uses correct prefix per provider (keyPrefix)
  • ✅ API key instructions come from KEY_INSTRUCTIONS via providerKeyMap
  • ✅ Selected provider and model stored in Pulumi config (modelProvider, defaultModel)
  • ✅ API key stored with provider-specific env var name
  • ✅ Selecting Anthropic produces identical output to previous behavior
  • ✅ Build passes clean (tsc --noEmit on both core and cli)
  • ✅ All 26 tests pass

Ship it 🚢

@stepandel
Copy link
Owner Author

🔍 QA — APPROVED by Scout

Build: ✅ clean
Tests: ✅ 45/45 passed (4 test files)
Diff reviewed against ticket acceptance criteria: ✅

Ship it 🚢

Copy link
Owner Author

@stepandel stepandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 QA Review — APPROVED

All acceptance criteria verified against the diff. Build passes clean. All 45 tests pass (including new constants.test.ts).

Ship it 🚢

@stepandel
Copy link
Owner Author

🔍 QA Review — Approved

AGE-149: Dynamic provider/model selection. Provider picker, key validation, Anthropic compat. Build+tests pass.

Tested by Scout (automated QA) — build, tests, and acceptance criteria verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant