Skip to content

feat: list-models subcommand for full CLI #1291

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat: list-models subcommand for full CLI #1291

wants to merge 1 commit into from

Conversation

bolinfest
Copy link
Collaborator

@bolinfest bolinfest commented Jun 9, 2025

This PR introduces a list-models subcommand to get the list of models available for the current provider. On one hand, this is perhaps not quite as seamless as having a /model command in the TUI that does filtering and can update your config.toml file for you (see #1251), but it is friendlier to programmatic use and makes it easier to select the right model before launching the TUI at all.

Codex wrote the bulk of this PR, so for posterity, here are the instructions I gave Codex:

In codex-cli, there is a /model command that is used to fetch the list of models for the user's given model provider. The results are shown in the UI.

We want something like this ported to the rust codebase in the codex-rs/ folder. Specifically, codex-rs/cli/ should have a list-models subcommand
that prints the list of models to stdout and exits. It should read the Config like other subcommands and support an optional --provider flag
that can override the model_provider option in Config. The list of models should be read by the specified provider. (Config should ensure
there the default provider, openai, is specified so this value is never empty.)

This new logic should be added in codex-rs/common under a custom feature as we will likely want to reuse it in codex-rs/tui/ in the future,
though for now, only the list-models subcommand in codex-rs/cli/ will use it.

Then in a follow-up:

run cargo clippy --tests and fix any issues. run just fmt from codex-rs when done, as well

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