MCPcopy Create free account
hub / github.com/docker/docker-agent / newModelsCmd

Function newModelsCmd

cmd/root/models.go:64–87  ·  view source on GitHub ↗
(opts ...modelsCmdOption)

Source from the content-addressed store, hash-verified

62type modelsCmdOption func(*config.RuntimeConfig)
63
64func newModelsCmd(opts ...modelsCmdOption) *cobra.Command {
65 cmd := &cobra.Command{
66 Use: "models",
67 Short: "List available models",
68 Long: `List models available for use with --model flag.
69
70Shows models that can be passed to 'docker agent run --model' or
71'docker agent new --model'. By default shows models from providers
72you have credentials for. Use --all to include all providers.`,
73 GroupID: "core",
74 }
75
76 listCmd := newModelsListCmd(opts...)
77 cmd.AddCommand(listCmd)
78
79 // Default to "list" when no subcommand given.
80 cmd.RunE = listCmd.RunE
81
82 // Copy the flags from the list command so they work on the bare
83 // "docker agent models --provider openai" form as well.
84 cmd.Flags().AddFlagSet(listCmd.Flags())
85
86 return cmd
87}
88
89func newModelsListCmd(opts ...modelsCmdOption) *cobra.Command {
90 var flags modelsListFlags

Calls 1

newModelsListCmdFunction · 0.85