Skip to content

Commit 6cfe6ac

Browse files
committed
Improved help text
1 parent 1105330 commit 6cfe6ac

File tree

1 file changed

+73
-15
lines changed

1 file changed

+73
-15
lines changed

cmd/docker-mcp/commands/catalog.go

Lines changed: 73 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ func catalogCommand() *cobra.Command {
1212
cmd := &cobra.Command{
1313
Use: "catalog",
1414
Aliases: []string{"catalogs"},
15-
Short: "Manage the catalog",
15+
Short: "Manage MCP server catalogs",
16+
Long: `Manage MCP server catalogs for organizing and configuring custom MCP servers alongside Docker's official catalog.`,
1617
}
1718
cmd.AddCommand(bootstrapCatalogCommand())
1819
cmd.AddCommand(importCatalogCommand())
@@ -32,8 +33,15 @@ func catalogCommand() *cobra.Command {
3233
func importCatalogCommand() *cobra.Command {
3334
return &cobra.Command{
3435
Use: "import <alias|url|file>",
35-
Short: "Import a catalog",
36-
Args: cobra.ExactArgs(1),
36+
Short: "Import a catalog from URL or file",
37+
Long: `Import an MCP server catalog from a URL or local file. The catalog will be downloaded
38+
and stored locally for use with the MCP gateway.`,
39+
Args: cobra.ExactArgs(1),
40+
Example: ` # Import from URL
41+
docker mcp catalog import https://example.com/my-catalog.yaml
42+
43+
# Import from local file
44+
docker mcp catalog import ./shared-catalog.yaml`,
3745
RunE: func(cmd *cobra.Command, args []string) error {
3846
return catalog.Import(cmd.Context(), args[0])
3947
},
@@ -60,8 +68,14 @@ func lsCatalogCommand() *cobra.Command {
6068
}
6169
cmd := &cobra.Command{
6270
Use: "ls",
63-
Short: "List configured catalogs",
71+
Short: "List all configured catalogs",
72+
Long: `List all configured catalogs including Docker's official catalog and any locally managed catalogs.`,
6473
Args: cobra.NoArgs,
74+
Example: ` # List all catalogs
75+
docker mcp catalog ls
76+
77+
# List catalogs in JSON format
78+
docker mcp catalog ls --json`,
6579
RunE: func(cmd *cobra.Command, _ []string) error {
6680
return catalog.Ls(cmd.Context(), opts.JSON)
6781
},
@@ -75,7 +89,11 @@ func rmCatalogCommand() *cobra.Command {
7589
return &cobra.Command{
7690
Use: "rm <name>",
7791
Short: "Remove a catalog",
78-
Args: cobra.ExactArgs(1),
92+
Long: `Remove a locally configured catalog. This will delete the catalog and all its server definitions.
93+
The Docker official catalog cannot be removed.`,
94+
Args: cobra.ExactArgs(1),
95+
Example: ` # Remove a catalog
96+
docker mcp catalog rm old-servers`,
7997
RunE: func(_ *cobra.Command, args []string) error {
8098
return catalog.Rm(args[0])
8199
},
@@ -85,7 +103,15 @@ func rmCatalogCommand() *cobra.Command {
85103
func updateCatalogCommand() *cobra.Command {
86104
return &cobra.Command{
87105
Use: "update [name]",
88-
Short: "Update a specific catalog or all catalogs if no name is provided",
106+
Short: "Update catalog(s) from remote sources",
107+
Long: `Update one or more catalogs by re-downloading from their original sources.
108+
If no name is provided, updates all catalogs that have remote sources.`,
109+
Args: cobra.MaximumNArgs(1),
110+
Example: ` # Update all catalogs
111+
docker mcp catalog update
112+
113+
# Update specific catalog
114+
docker mcp catalog update team-servers`,
89115
RunE: func(cmd *cobra.Command, args []string) error {
90116
return catalog.Update(cmd.Context(), args)
91117
},
@@ -97,9 +123,16 @@ func showCatalogCommand() *cobra.Command {
97123
Format catalog.Format
98124
}
99125
cmd := &cobra.Command{
100-
Use: "show <name>",
101-
Short: "Show a catalog",
102-
Args: cobra.MaximumNArgs(1),
126+
Use: "show [name]",
127+
Short: "Display catalog contents",
128+
Long: `Display the contents of a catalog including all server definitions and metadata.
129+
If no name is provided, shows the Docker official catalog.`,
130+
Args: cobra.MaximumNArgs(1),
131+
Example: ` # Show Docker's official catalog
132+
docker mcp catalog show
133+
134+
# Show a specific catalog in JSON format
135+
docker mcp catalog show my-catalog --format=json`,
103136
RunE: func(cmd *cobra.Command, args []string) error {
104137
name := catalog.DockerCatalogName
105138
if len(args) > 0 {
@@ -117,8 +150,14 @@ func showCatalogCommand() *cobra.Command {
117150
func forkCatalogCommand() *cobra.Command {
118151
return &cobra.Command{
119152
Use: "fork <src-catalog> <new-name>",
120-
Short: "Fork a catalog",
153+
Short: "Create a copy of an existing catalog",
154+
Long: `Create a new catalog by copying all servers from an existing catalog. Useful for creating variations of existing catalogs.`,
121155
Args: cobra.ExactArgs(2),
156+
Example: ` # Fork the Docker catalog to customize it
157+
docker mcp catalog fork docker-mcp my-custom-docker
158+
159+
# Fork a team catalog for personal use
160+
docker mcp catalog fork team-servers my-servers`,
122161
RunE: func(_ *cobra.Command, args []string) error {
123162
return catalog.Fork(args[0], args[1])
124163
},
@@ -128,8 +167,14 @@ func forkCatalogCommand() *cobra.Command {
128167
func createCatalogCommand() *cobra.Command {
129168
return &cobra.Command{
130169
Use: "create <name>",
131-
Short: "Create a new catalog",
170+
Short: "Create a new empty catalog",
171+
Long: `Create a new empty catalog for organizing custom MCP servers. The catalog will be stored locally and can be populated using 'docker mcp catalog add'.`,
132172
Args: cobra.ExactArgs(1),
173+
Example: ` # Create a new catalog for development servers
174+
docker mcp catalog create dev-servers
175+
176+
# Create a catalog for production monitoring tools
177+
docker mcp catalog create prod-monitoring`,
133178
RunE: func(_ *cobra.Command, args []string) error {
134179
return catalog.Create(args[0])
135180
},
@@ -139,8 +184,11 @@ func createCatalogCommand() *cobra.Command {
139184
func initCatalogCommand() *cobra.Command {
140185
return &cobra.Command{
141186
Use: "init",
142-
Short: "Initialize the catalog",
187+
Short: "Initialize the catalog system",
188+
Long: `Initialize the local catalog management system by creating the necessary configuration files and directories.`,
143189
Args: cobra.NoArgs,
190+
Example: ` # Initialize catalog system
191+
docker mcp catalog init`,
144192
RunE: func(cmd *cobra.Command, _ []string) error {
145193
return catalog.Init(cmd.Context())
146194
},
@@ -153,8 +201,15 @@ func addCatalogCommand() *cobra.Command {
153201
}
154202
cmd := &cobra.Command{
155203
Use: "add <catalog> <server-name> <catalog-file>",
156-
Short: "Add a server to your catalog",
157-
Args: cobra.ExactArgs(3),
204+
Short: "Add a server to a catalog",
205+
Long: `Add an MCP server definition to an existing catalog by copying it from another catalog file.
206+
The server definition includes all configuration, tools, and metadata.`,
207+
Args: cobra.ExactArgs(3),
208+
Example: ` # Add a server from another catalog file
209+
docker mcp catalog add my-catalog github-server ./github-catalog.yaml
210+
211+
# Add with force to overwrite existing server
212+
docker mcp catalog add my-catalog slack-bot ./team-catalog.yaml --force`,
158213
RunE: func(_ *cobra.Command, args []string) error {
159214
parsedArgs := catalog.ParseAddArgs(args[0], args[1], args[2])
160215
if err := catalog.ValidateArgs(*parsedArgs); err != nil {
@@ -172,8 +227,11 @@ func resetCatalogCommand() *cobra.Command {
172227
return &cobra.Command{
173228
Use: "reset",
174229
Aliases: []string{"empty"},
175-
Short: "Empty the catalog",
230+
Short: "Reset the catalog system",
231+
Long: `Reset the local catalog management system by removing all user-managed catalogs and configuration. This does not affect Docker's official catalog.`,
176232
Args: cobra.NoArgs,
233+
Example: ` # Reset all user catalogs
234+
docker mcp catalog reset`,
177235
RunE: func(cmd *cobra.Command, _ []string) error {
178236
return catalog.Reset(cmd.Context())
179237
},

0 commit comments

Comments
 (0)