Skip to content

Commit 4d67c5e

Browse files
feat: add variant flag to tui command
1 parent a7cae8f commit 4d67c5e

4 files changed

Lines changed: 18 additions & 9 deletions

File tree

‎packages/opencode/src/cli/cmd/tui/app.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ function App() {
252252
})
253253
local.model.set({ providerID, modelID }, { recent: true })
254254
}
255+
if (args.variant) local.model.variant.set(args.variant)
255256
if (args.sessionID) {
256257
route.navigate({
257258
type: "session",

‎packages/opencode/src/cli/cmd/tui/context/args.tsx‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { createSimpleContext } from "./helper"
22

33
export interface Args {
44
model?: string
5+
variant?: string
56
agent?: string
67
prompt?: string
78
continue?: boolean

‎packages/opencode/src/cli/cmd/tui/thread.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ export const TuiThreadCommand = cmd({
7171
.option("agent", {
7272
type: "string",
7373
describe: "agent to use",
74+
})
75+
.option("variant", {
76+
type: "string",
77+
describe: "model variant (provider-specific reasoning effort, e.g., high, max, minimal)",
7478
}),
7579
handler: async (args) => {
7680
// Resolve relative paths against PWD to preserve behavior when using --cwd flag
@@ -149,6 +153,7 @@ export const TuiThreadCommand = cmd({
149153
sessionID: args.session,
150154
agent: args.agent,
151155
model: args.model,
156+
variant: args.variant,
152157
prompt,
153158
},
154159
onExit: async () => {

‎packages/web/src/content/docs/cli.mdx‎

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,16 @@ opencode [project]
2929

3030
#### Flags
3131

32-
| Flag | Short | Description |
33-
| ------------ | ----- | ------------------------------------------ |
34-
| `--continue` | `-c` | Continue the last session |
35-
| `--session` | `-s` | Session ID to continue |
36-
| `--prompt` | | Prompt to use |
37-
| `--model` | `-m` | Model to use in the form of provider/model |
38-
| `--agent` | | Agent to use |
39-
| `--port` | | Port to listen on |
40-
| `--hostname` | | Hostname to listen on |
32+
| Flag | Short | Description |
33+
| ------------ | ----- | -------------------------------------------------------------- |
34+
| `--continue` | `-c` | Continue the last session |
35+
| `--session` | `-s` | Session ID to continue |
36+
| `--prompt` | | Prompt to use |
37+
| `--model` | `-m` | Model to use in the form of provider/model |
38+
| `--variant` | | Model variant (provider-specific reasoning effort, e.g., high) |
39+
| `--agent` | | Agent to use |
40+
| `--port` | | Port to listen on |
41+
| `--hostname` | | Hostname to listen on |
4142

4243
---
4344

@@ -341,6 +342,7 @@ opencode run --attach http://localhost:4096 "Explain async/await in JavaScript"
341342
| `--session` | `-s` | Session ID to continue |
342343
| `--share` | | Share the session |
343344
| `--model` | `-m` | Model to use in the form of provider/model |
345+
| `--variant` | | Model variant (provider-specific reasoning effort, e.g., high) |
344346
| `--agent` | | Agent to use |
345347
| `--file` | `-f` | File(s) to attach to message |
346348
| `--format` | | Format: default (formatted) or json (raw JSON events) |

0 commit comments

Comments
 (0)