summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-07-07 16:24:22 -0400
committerDax Raad <[email protected]>2025-07-07 16:24:37 -0400
commit7cfa297a78a549ac45b98c3126bc2c1d6a5a22ac (patch)
tree1fe0108c1995ff051b50249039f0d2fe7ab5da87
parent661b74def671bb4c604d54162bad9230aa3472c0 (diff)
downloadopencode-7cfa297a78a549ac45b98c3126bc2c1d6a5a22ac.tar.gz
opencode-7cfa297a78a549ac45b98c3126bc2c1d6a5a22ac.zip
wip: model and prompt flags for tui
-rw-r--r--packages/opencode/src/cli/cmd/tui.ts25
1 files changed, 20 insertions, 5 deletions
diff --git a/packages/opencode/src/cli/cmd/tui.ts b/packages/opencode/src/cli/cmd/tui.ts
index f0ec4a53b..886863a1f 100644
--- a/packages/opencode/src/cli/cmd/tui.ts
+++ b/packages/opencode/src/cli/cmd/tui.ts
@@ -15,10 +15,21 @@ export const TuiCommand = cmd({
command: "$0 [project]",
describe: "start opencode tui",
builder: (yargs) =>
- yargs.positional("project", {
- type: "string",
- describe: "path to start opencode in",
- }),
+ yargs
+ .positional("project", {
+ type: "string",
+ describe: "path to start opencode in",
+ })
+ .option("model", {
+ type: "string",
+ alias: ["m"],
+ describe: "model to use in the format of provider/model",
+ })
+ .option("prompt", {
+ alias: ["p"],
+ type: "string",
+ describe: "prompt to use",
+ }),
handler: async (args) => {
while (true) {
const cwd = args.project ? path.resolve(args.project) : process.cwd()
@@ -60,7 +71,11 @@ export const TuiCommand = cmd({
cmd,
})
const proc = Bun.spawn({
- cmd: [...cmd, ...process.argv.slice(2)],
+ cmd: [
+ ...cmd,
+ ...(args.model ? ["--model", args.model] : []),
+ ...(args.prompt ? ["--prompt", args.prompt] : []),
+ ],
cwd,
stdout: "inherit",
stderr: "inherit",