cli: opencode models <provider> filter from v1 is rejected in v2 ("Unexpected positional argument")
Los mantenedores suelen responder en 1 día
@nilparra-dev ya está trabajando en esto.
Desde el 4/12/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- cli
Línea de trabajo
Lee la especificación del comando models en packages/cli/src/commands/commands.ts:348 y la especificación de la CLI de Rust en packages/cli-rs/crates/cli/src/args.rs:416; actualmente, ninguna declara un argumento para el proveedor. Compáralas con el comando V1 y la documentación citados en el issue y luego identifica cómo gestiona la CLI actual los argumentos de los comandos. Se considera terminado cuando el filtro de proveedor funciona o una alternativa documentada y unas instrucciones de migración abordan el argumento rechazado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
OpenCode 1 documented an optional provider argument for opencode models (opencode models [provider], e.g. opencode models vultr). OpenCode 2 rejects that argument, so the documented command exits 1 after printing help instead of listing the provider's models, and V2 has no equivalent filter flag.
Environment
- opencode version: 2.4.4 (matches the latest release,
v2.4.4) - Client: CLI (
opencode models,opencode run) against both the shared background service and a server started withopencode serve - Model and provider:
vultr(provider supplied by the@vultr/model-provider-opencodeplugin); the argument failure is provider-independent - OS: Darwin 27.2.0 (darwin arm64)
- Terminal:
TERM=xterm-256color;TERM_PROGRAM/COLORTERMunset (non-TTY shell, so the app itself is Unavailable) - Shell: /bin/zsh
- Install/channel:
latest; two installs on this machine —~/.opencode/bin/opencodev2.4.4 and the desktop app's bundled~/Library/Application Support/ai.opencode.desktop/cli/2.4.4-arm64/opencode-cli serve --service - Active plugins:
vultr.model-provider(@vultr/[email protected], stateactive) plus built-ins (opencode.tool.input.repair,opencode.config.worktree, …). Nothing inpluginsof~/.config/opencode/cli.json, and no local plugin dirs.
Reproduction
- Run
opencode models— printsprovider/modellines for every enabled provider, including the plugin's models. Works. - Run
opencode models vultr— the V1 form for filtering to one provider. - Run
opencode models anthropic— same failure, so it is not provider-specific. - Run
opencode models --help—USAGE opencode models [flags], with only the global server flags (--standalone,--server, …).
Step 2 exits with code 1 and prints the models help, then the global flag list, then:
ERROR
Unexpected positional argument: "vultr"
Expected Behavior
Either:
opencode models [provider]keeps V1's behaviour and filters the list to that provider; or- V2 ships a documented replacement (e.g.
opencode models --provider <id>), and the V1→V2 migration guide states that the positional filter was dropped and what to use instead.
Actual Behavior
The positional argument is rejected (exit 1), and the error text appears only after the full help dump, so it reads like the command is broken rather than like an unsupported argument. There is no flag to filter by provider either, so opencode models | grep '^vultr/' is the only way to get the list V1 produced with one command.
This is not the only V1 surface of this command that is gone (--refresh and --verbose — see #53682), and V2's CLI docs (https://opencode.ai/docs/cli) do not document models at all, so the V1 page is what users and third-party guides still follow.
Additional Context
Spec in a v2 checkout (branch local, 185232200c, version 2.4.4):
packages/cli/src/commands/commands.ts:348— themodelsspec declares onlyglobalFlags: ServerFlags: no positional argument, no--refresh, no--verbose.packages/cli-rs/crates/cli/src/args.rs:416—Spec::new("models", "List all available models").globals(SERVER_FLAGS).
V1 behaviour and docs (the filter is still documented there):
- V1 CLI docs: https://opencode.ai/v1/docs/cli — "You can optionally pass a provider ID to filter models by that provider." with the example
opencode models anthropic. - V1 implementation,
packages/opencode/src/cli/cmd/models.ts(package removed in44b6938b2a):
export const ModelsCommand = effectCmd({
command: "models [provider]",
describe: "list all available models",
builder: (yargs) =>
yargs
.positional("provider", { describe: "provider ID to filter models by", type: "string", array: false })
.option("verbose", { … })
.option("refresh", { … }),
Related issues, none of which covers this:
- #53682 —
opencode models --refresh/--verboseremoved in the V2 rewrite (same command, the flags rather than the positional argument). - #56218 —
opencode -m provider/modelno longer accepted on the root command (same class of V1 CLI surface loss). - #49986 — V1 config
whitelist/blacklistmodel filtering dropped in V2 (config surface, not the CLI).
Why this matters beyond convenience: provider integration guides aimed at OpenCode users still print the V1 command. Vultr's OpenCode integration page, for example, tells users to run opencode models vultr to check that its plugin's live model list was picked up. On OpenCode 2 that command fails with the message above, which looks like a broken provider rather than a removed CLI argument — exactly when the user is trying to verify a provider fix.
Reproducibility: consistent on 2.4.4, with the shared service, with --standalone, and against an explicit --server <url>. No config or plugin is needed to reproduce the argument rejection itself.
- Lenguaje dominante
- TypeScript
- Estrellas
- 230k
- Forks
- 31.3k
- Merge medio
- 5 h 44 min
- PR fusionados (30 d)
- 529
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de anomalyco/opencode
-
area/desktop type/feature version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
anomalyco/opencode#68437 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area/tui platform/linux type/feature version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
anomalyco/opencode#68301 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
goal: session started with /goal gets a truncated objective as its title, not a generated titleAbiertoarea/plugins platform/windows type/feature version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
anomalyco/opencode#68298 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Web UI: Pressing Ctrl+<key> with Caps Lock active triggers Ctrl+Shift+<key> shortcutsPosiblemente ocupada @saurabhbhoir456 la tomó hoy. Abiertoarea/web platform/windows type/bug version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
anomalyco/opencode#68237 · 6 comentarios ·
Los mantenedores suelen responder en 1 día
-
area/desktop inference/go platform/macos type/bug version/v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
anomalyco/opencode#68121 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de anomalyco/opencode
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ranxianglei/billion-context#8319 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
JimLiu/open-artifact#126 ·
-
Claude Code: replace stub has no cut cue, a 6128 B Bash output reads as the one line `END6000`Abiertobug repro-ready
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
mksglu/context-mode#1454 ·
-
pending triage
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
laststance/design-world#98 ·
Los mantenedores suelen responder en 1 día