|
9 | 9 | "strings"
|
10 | 10 |
|
11 | 11 | "github.com/docker/cli/cli-plugins/plugin"
|
| 12 | + "github.com/docker/cli/cli/command" |
12 | 13 | "github.com/spf13/cobra"
|
13 | 14 |
|
14 | 15 | "github.com/docker/mcp-gateway/cmd/docker-mcp/backup"
|
@@ -43,7 +44,7 @@ Examples:
|
43 | 44 | `
|
44 | 45 |
|
45 | 46 | // rootCommand returns the root command for the init plugin
|
46 |
| -func rootCommand(ctx context.Context, cwd string, docker docker.Client) *cobra.Command { |
| 47 | +func rootCommand(ctx context.Context, cwd string, dockerCli command.Cli) *cobra.Command { |
47 | 48 | cmd := &cobra.Command{
|
48 | 49 | Use: "mcp [OPTIONS]",
|
49 | 50 | TraverseChildren: true,
|
@@ -74,15 +75,17 @@ func rootCommand(ctx context.Context, cwd string, docker docker.Client) *cobra.C
|
74 | 75 | return []string{"--help"}, cobra.ShellCompDirectiveNoFileComp
|
75 | 76 | })
|
76 | 77 |
|
77 |
| - cmd.AddCommand(secret.NewSecretsCmd(docker)) |
| 78 | + dockerClient := docker.NewClient(dockerCli) |
| 79 | + |
| 80 | + cmd.AddCommand(secret.NewSecretsCmd(dockerClient)) |
78 | 81 | cmd.AddCommand(policy.NewPolicyCmd())
|
79 | 82 | cmd.AddCommand(oauth.NewOAuthCmd())
|
80 | 83 | cmd.AddCommand(client.NewClientCmd(cwd))
|
81 | 84 | cmd.AddCommand(catalog.NewCatalogCmd())
|
82 | 85 | cmd.AddCommand(versionCommand())
|
83 |
| - cmd.AddCommand(gatewayCommand(docker)) |
84 |
| - cmd.AddCommand(configCommand(docker)) |
85 |
| - cmd.AddCommand(serverCommand(docker)) |
| 86 | + cmd.AddCommand(gatewayCommand(dockerClient)) |
| 87 | + cmd.AddCommand(configCommand(dockerClient)) |
| 88 | + cmd.AddCommand(serverCommand(dockerClient)) |
86 | 89 | cmd.AddCommand(toolsCommand())
|
87 | 90 |
|
88 | 91 | if os.Getenv("DOCKER_MCP_SHOW_HIDDEN") == "1" {
|
|
0 commit comments