-
Notifications
You must be signed in to change notification settings - Fork 1.5k
CLI - Model list pagination, filtering and sorting #4121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 78db59c 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds pagination, filtering, and sorting capabilities to the /model list command in the CLI, resolving issue #3743. The implementation introduces state management for model list operations and extends the command with new subcommands for navigation and filtering.
Key changes:
- Added pagination (10 items per page) with navigation commands (next, prev, page)
- Implemented sorting options (name, context, price, preferred)
- Added filtering by capabilities (images, cache, reasoning, free)
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
cli/vitest.config.ts |
Updated test file pattern to allow co-located tests (src/**/*.test.ts) |
cli/src/state/atoms/modelList.ts |
New state management atoms for pagination, filters, and sort options |
cli/src/state/atoms/index.ts |
Exported new model list atoms and types |
cli/src/state/hooks/useCommandContext.ts |
Integrated model list state into command context |
cli/src/commands/core/types.ts |
Added model list state properties to CommandContext interface |
cli/src/commands/model.ts |
Implemented pagination, sorting, filtering logic and new list subcommands |
cli/src/commands/__tests__/model.test.ts |
Added comprehensive test coverage for pagination, sorting, and filtering |
cli/src/commands/__tests__/helpers/mockContext.ts |
Updated mock context with model list state defaults |
.changeset/public-radios-pull.md |
Added changeset for the feature |
pandemicsyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one question inline, but preapproved because theres a good chance im wrong 😁
|
Out of curiosity: Why can we not use the scrollable autocomplete box underneath the CommandInput for this? |
pandemicsyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
![]()

Context
Resolve: #3743
Implementation
Screenshots