You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
v2: opencode -m provider/model no longer accepted on root command (worked in v1) #56218
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.
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.
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.
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.
Activity
opencode-agent commentedon Oct 16, 2026
Thanks for the report! You're asking for
opencode -m <provider/model>and--agentto 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,
--modeland--agentare defined only onopencode run. The root command never got them, so that's why you seeUnrecognized flag. Maintainers will consider bringing them back.Related:
--model/-mto the root command and passes it to the TUI (it doesn't cover--agent)--varianton the root commandOn your
OPENCODE_CONFIG_CONTENTquestion: 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.rorynolan commentedon Oct 16, 2026
Tested on v2.0.31:
OPENCODE_CONFIG_CONTENT='{"model":"..."}' opencodehas no effect, so it is not a workaround for the missing root-m. This matches #36990, which listsOPENCODE_CONFIG_CONTENTas 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) orOPENCODE_CONFIG_CONTENTwould each fix that.telsoncc commentedon Oct 20, 2026
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:
This worked in V1 and is currently not possible in V2 without editing a config file.
/modelsworks 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
--agentfor the root command.