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.
+1, --model on the root TUI would be useful. I launch opencode against a local OpenAI-compatible server through a shell alias that pins a model and reasoning variant (provider/model#variant); since v2 that alias fails with Unrecognized flag: --model in command opencode, so I have to open the TUI and pick the model with /models every time.
I'm also unsure whether removing it was deliberate. opencode mini and opencode run both still accept -m/--model (and --agent), so if the flag was meant to be retired, why do they keep it? If it wasn't, it would be good to restore it on the root command so all three entry points take the same launch flags. Either way, a note in the v2 migration docs would help people whose scripts or aliases break.
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.Grey2k commentedon Nov 1, 2026
Thanks for fixing this - missing --model breaks a lot of automation which are developed for v1 (herdr plugins etc.)
rsanchezc-pg commentedon Nov 6, 2026
Bumping this one, it would be super helpful to get it fixed.
jamescube87 commentedon Nov 7, 2026
This is the most urgent issue to fix. I hope it can be addressed as soon as possible.
reagle commentedon Nov 11, 2026
+1,
--modelon the root TUI would be useful. I launch opencode against a local OpenAI-compatible server through a shell alias that pins a model and reasoning variant (provider/model#variant); since v2 that alias fails withUnrecognized flag: --model in command opencode, so I have to open the TUI and pick the model with/modelsevery time.I'm also unsure whether removing it was deliberate.
opencode miniandopencode runboth still accept-m/--model(and--agent), so if the flag was meant to be retired, why do they keep it? If it wasn't, it would be good to restore it on the root command so all three entry points take the same launch flags. Either way, a note in the v2 migration docs would help people whose scripts or aliases break.🤖 Generated with Claude Code