Skip to content

Feature Request: Add a command to list available models in machine-readable format (e.g., --list-models --json) #27847

@serkanince

Description

@serkanince

What would you like to be added?

I would like to request a new command or flag (for example: gemini models --output-format json or gemini --list-models) that outputs a list of all currently available Gemini models in a structured, machine-readable format like JSON.

The output should ideally include:

  • Model ID (to be used with the -m flag)
  • Display Name
  • Short Description
  • Context Limits (input/output token limits)

Why is this needed?

This feature is essential for developers building integrations or orchestrators around the Gemini CLI

Currently, third-party applications have to hardcode model names (e.g., gemini-1.5-pro, gemini-2.0-flash), which is problematic because:

  1. New models are released frequently, making hardcoded lists quickly outdated.
  2. Model availability varies based on the user's account, subscription plan, or region.
  3. The existing interactive /model command is great for human users in a REPL but cannot be programmatically parsed by external tools.

Having a machine-readable way to discover models will allow apps to dynamically populate selection menus and ensure users always have access to the latest models available to them.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/non-interactiveIssues related to GitHub Actions, SDK, 3P Integrations, Shell Scripting, Command line automationeffort/small1 day or less: trivial logic, UI adjustments, docskind/enhancementpriority/p3Backlog - a good idea but not currently a priority.status/bot-triaged
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions