feat(cli): add models command for listing available models#4997
Merged
marius-kilocode merged 3 commits intomainfrom Jan 13, 2026
Merged
feat(cli): add models command for listing available models#4997marius-kilocode merged 3 commits intomainfrom
marius-kilocode merged 3 commits intomainfrom
Conversation
🦋 Changeset detectedLatest commit: 5b35a04 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThis PR adds a new
Files Reviewed (4 files)
Notes
|
- Add 'kilocode models --json' command to expose available models as JSON - Implement lightweight extension initialization for router-based providers - Add 30-second timeout for router models request - Export mapProviderToApiConfig from mapper.ts for use by models command - Support both router-based providers (kilocode, openrouter) and static providers
69915a5 to
5148127
Compare
iscekic
approved these changes
Jan 13, 2026
This was referenced Jan 13, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a CLI command
kilocode models --jsonthat exposes available models as JSON, enabling agent manager to offer per-session model selection without hardcoding model lists.Changes
New Files
cli/src/commands/models-api.ts- Models listing logic with:ModelsApiOutputinterface for JSON output structurefetchRouterModels()function for lightweight extension initializationmodelsApiCommand()main command handlercli/src/commands/__tests__/models-api.test.ts- Comprehensive test suiteModified Files
cli/src/index.ts- Registermodelssubcommandcli/src/config/mapper.ts- ExportmapProviderToApiConfig()for use by models commandUsage
Output Format
{ "provider": "kilocode", "currentModel": "anthropic/claude-opus-4.5", "models": [ { "id": "anthropic/claude-opus-4.5", "displayName": "Anthropic: Claude Opus 4.5", "contextWindow": 200000, "supportsImages": true, "inputPrice": 5, "outputPrice": 25 } ] }Implementation Details
For router-based providers (kilocode, openrouter, etc.), the command:
requestRouterModelsmessagerouterModelsresponse (30-second timeout)For static providers (anthropic, gemini, etc.), the command uses the built-in model definitions without needing to initialize the extension.
Testing