99 "sort"
1010 "strings"
1111
12- "github.com/docker/model-runner/cmd/cli/commands/completion"
1312 "github.com/docker/model-runner/cmd/cli/pkg/types"
1413 "github.com/spf13/cobra"
1514)
@@ -63,7 +62,7 @@ var hostApps = map[string]hostApp{
6362 "opencode" : {envFn : openaiEnv (openaiPathSuffix )},
6463 "codex" : {envFn : openaiEnv ("/v1" )},
6564 "claude" : {envFn : anthropicEnv },
66- "clawdbot " : {configInstructions : clawdbotConfigInstructions },
65+ "openclaw " : {configInstructions : openclawConfigInstructions },
6766}
6867
6968// supportedApps is derived from the registries above.
@@ -89,10 +88,9 @@ func newLaunchCmd() *cobra.Command {
8988 c := & cobra.Command {
9089 Use : "launch APP [-- APP_ARGS...]" ,
9190 Short : "Launch an app configured to use Docker Model Runner" ,
92- Long : fmt .Sprintf (`Launch an app configured to use Docker Model Runner.
93-
91+ Long : fmt .Sprintf (`Launch an app configured to use Docker Model Runner.
92+
9493Supported apps: %s` , strings .Join (supportedApps , ", " )),
95- Short : "Launch an app configured to use Docker Model Runner" ,
9694 Args : cobra .MinimumNArgs (1 ),
9795 ValidArgs : supportedApps ,
9896 RunE : func (cmd * cobra.Command , args []string ) error {
@@ -221,7 +219,7 @@ func launchHostApp(cmd *cobra.Command, bin string, baseURL string, cli hostApp,
221219 }
222220
223221 if cli .envFn == nil {
224- return launchUnconfigurableHostApp (cmd , bin , baseURL , cli , dryRun )
222+ return launchUnconfigurableHostApp (cmd , bin , baseURL , cli , appArgs , dryRun )
225223 }
226224
227225 env := cli .envFn (baseURL )
@@ -236,7 +234,7 @@ func launchHostApp(cmd *cobra.Command, bin string, baseURL string, cli hostApp,
236234}
237235
238236// launchUnconfigurableHostApp handles host apps that need manual config rather than env vars.
239- func launchUnconfigurableHostApp (cmd * cobra.Command , bin string , baseURL string , cli hostApp , dryRun bool ) error {
237+ func launchUnconfigurableHostApp (cmd * cobra.Command , bin string , baseURL string , cli hostApp , appArgs [] string , dryRun bool ) error {
240238 enginesEP := baseURL + openaiPathSuffix
241239 cmd .Printf ("Configure %s to use Docker Model Runner:\n " , bin )
242240 cmd .Printf (" Base URL: %s\n " , enginesEP )
@@ -250,18 +248,19 @@ func launchUnconfigurableHostApp(cmd *cobra.Command, bin string, baseURL string,
250248 }
251249 }
252250 if dryRun {
251+ cmd .Printf ("Would run: %s %s\n " , bin , strings .Join (appArgs , " " ))
253252 return nil
254253 }
255- return runExternal (cmd , nil , bin )
254+ return runExternal (cmd , nil , bin , appArgs ... )
256255}
257256
258- // clawdbotConfigInstructions returns configuration commands for clawdbot .
259- func clawdbotConfigInstructions (baseURL string ) []string {
257+ // openclawConfigInstructions returns configuration commands for openclaw .
258+ func openclawConfigInstructions (baseURL string ) []string {
260259 ep := baseURL + openaiPathSuffix
261260 return []string {
262- fmt .Sprintf ("clawdbot config set models.providers.docker-model-runner.baseUrl %q" , ep ),
263- "clawdbot config set models.providers.docker-model-runner.api openai-completions" ,
264- fmt .Sprintf ("clawdbot config set models.providers.docker-model-runner.apiKey %s" , dummyAPIKey ),
261+ fmt .Sprintf ("openclaw config set models.providers.docker-model-runner.baseUrl %q" , ep ),
262+ "openclaw config set models.providers.docker-model-runner.api openai-completions" ,
263+ fmt .Sprintf ("openclaw config set models.providers.docker-model-runner.apiKey %s" , dummyAPIKey ),
265264 }
266265}
267266
0 commit comments