Browse Source

feat: add --variant flag to run command (#6805)

Co-authored-by: shuv <[email protected]>
Co-authored-by: Aiden Cline <[email protected]>
shuv 1 tháng trước cách đây
mục cha
commit
72cef0d9e7

+ 6 - 0
packages/opencode/src/cli/cmd/run.ts

@@ -87,6 +87,10 @@ export const RunCommand = cmd({
         type: "number",
         type: "number",
         describe: "port for the local server (defaults to random port if no value provided)",
         describe: "port for the local server (defaults to random port if no value provided)",
       })
       })
+      .option("variant", {
+        type: "string",
+        describe: "model variant (provider-specific reasoning effort, e.g., high, max, minimal)",
+      })
   },
   },
   handler: async (args) => {
   handler: async (args) => {
     let message = [...args.message, ...(args["--"] || [])]
     let message = [...args.message, ...(args["--"] || [])]
@@ -254,6 +258,7 @@ export const RunCommand = cmd({
           model: args.model,
           model: args.model,
           command: args.command,
           command: args.command,
           arguments: message,
           arguments: message,
+          variant: args.variant,
         })
         })
       } else {
       } else {
         const modelParam = args.model ? Provider.parseModel(args.model) : undefined
         const modelParam = args.model ? Provider.parseModel(args.model) : undefined
@@ -261,6 +266,7 @@ export const RunCommand = cmd({
           sessionID,
           sessionID,
           agent: resolvedAgent,
           agent: resolvedAgent,
           model: modelParam,
           model: modelParam,
+          variant: args.variant,
           parts: [...fileParts, { type: "text", text: message }],
           parts: [...fileParts, { type: "text", text: message }],
         })
         })
       }
       }