v2: `opencode -m provider/model` no longer accepted on root command (worked in v1) · Issue #56218 · anomalyco/opencode · GitHub
Skip to content

v2: opencode -m provider/model no longer accepted on root command (worked in v1) #56218

Open

Description

@rorynolan

In v1, opencode -m <provider/model> started the TUI with that model (and --agent selected an agent). In v2 the root command rejects it:

$ opencode -m fireworks-ai/accounts/fireworks/routers/glm-5p3-fast
ERROR
  Unrecognized flag: -m in command opencode

-m / --model exists only on opencode run. The root command now lists only -c, -s, --prompt, --auto, --standalone and --server.

Questions

  • Is dropping -m / --agent from the root command intentional?
  • If so, what is the supported way to launch the TUI with a given model without editing config?
  • Does OPENCODE_CONFIG_CONTENT still work in v2? The v2 config docs do not mention env vars.

Restoring -m / --agent on the root command, or adding a model env var, would help scripted workflows.

Version: opencode v2.0.31 (macOS)

Activity

  1. opencode-agent commented on Oct 16, 2026

    @opencode-agent
    Contributor

    Thanks for the report! You're asking for opencode -m <provider/model> and --agent to work on the root (TUI) command again, as they did in v1, so scripts can start the TUI with a specific model or agent.

    In v2.0.31, --model and --agent are defined only on opencode run. The root command never got them, so that's why you see Unrecognized flag. Maintainers will consider bringing them back.

    Related:

    On your OPENCODE_CONFIG_CONTENT question: v2 still reads it and applies it as an inline config layer on top of your config files. It's mentioned in the config docs as "Inline config". Until this is decided, it may let you set the model per launch without editing your config files.

  2. rorynolan commented on Oct 16, 2026

    @rorynolan
    Author

    Tested on v2.0.31: OPENCODE_CONFIG_CONTENT='{"model":"..."}' opencode has no effect, so it is not a workaround for the missing root -m. This matches #36990, which lists OPENCODE_CONFIG_CONTENT as ignored in v2.

    So there is currently no way to choose the TUI model per launch without editing a config file. Restoring root -m (#48163) or OPENCODE_CONFIG_CONTENT would each fix that.

  3. telsoncc commented on Oct 20, 2026

    @telsoncc

    Same issue on Windows 11 with OpenCode V2.

    My workflow relies on launching the TUI with a specific model from PowerShell aliases and scripts, for example:

    opencode -m "provider/model"

    This worked in V1 and is currently not possible in V2 without editing a config file. /models works after opening the TUI, but it adds a manual step to every session.

    PR #48163 would solve the model-selection part of this issue. Please consider merging it and also restoring --agent for the root command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions