Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/opencode/src/cli/cmd/tui/context/args.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createSimpleContext } from "./helper"

export interface Args {
model?: string
variant?: string
agent?: string
prompt?: string
continue?: boolean
Expand Down
10 changes: 10 additions & 0 deletions packages/opencode/src/cli/cmd/tui/context/local.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,16 @@ export const { use: useLocal, provider: LocalProvider } = createSimpleContext({
}
})

// Initialize variant from CLI args
const args = useArgs()
let variantInitialized = false
createEffect(() => {
if (variantInitialized) return
if (!model.ready || !args.variant || !model.current()) return
variantInitialized = true
model.variant.set(args.variant)
})

const result = {
model,
agent,
Expand Down
5 changes: 5 additions & 0 deletions packages/opencode/src/cli/cmd/tui/thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ export const TuiThreadCommand = cmd({
.option("agent", {
type: "string",
describe: "agent to use",
})
.option("variant", {
type: "string",
describe: "model variant (provider-specific reasoning effort, e.g., high, max, minimal)",
}),
handler: async (args) => {
// Resolve relative paths against PWD to preserve behavior when using --cwd flag
Expand Down Expand Up @@ -95,6 +99,7 @@ export const TuiThreadCommand = cmd({
sessionID: args.session,
agent: args.agent,
model: args.model,
variant: args.variant,
prompt,
},
onExit: async () => {
Expand Down