Skip to content

Commit 5119e15

Browse files
authored
Update docs in CLI help and generated cmd docs (#87)
1 parent 74e044f commit 5119e15

File tree

15 files changed

+46
-55
lines changed

15 files changed

+46
-55
lines changed

cmd/add.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ func NewAddCmd(baseCmd *cmd.BaseCmd, opt ...cmdopts.CmdOption) (*cobra.Command,
4848
Use: "add <server-name>",
4949
Short: "Adds an MCP server dependency to the project",
5050
Long: "Adds an MCP server dependency to the project. " +
51-
"mcpd will search the registry for the named server and attempt to return information " +
52-
"on the version specified, or 'latest' if no version specified",
51+
"`mcpd` will search the registry for the named server and attempt to return information " +
52+
"on the version specified, or 'latest' if no version specified", // TODO: Remove 'latest' reference when we have our own registry
5353
RunE: c.run,
5454
}
5555

@@ -71,14 +71,14 @@ func NewAddCmd(baseCmd *cmd.BaseCmd, opt ...cmdopts.CmdOption) (*cobra.Command,
7171
&c.Runtime,
7272
"runtime",
7373
"",
74-
"Optional, specify the runtime of the server package (e.g. uvx, npx)",
74+
"Optional, specify the runtime of the server package (e.g. `uvx`, `npx`)",
7575
)
7676

7777
cobraCommand.Flags().StringVar(
7878
&c.Source,
7979
"source",
8080
"",
81-
"Optional, specify the source registry of the server package (e.g. mcpm)",
81+
"Optional, specify the source registry of the server package (e.g. `mcpm`)",
8282
)
8383

8484
return cobraCommand, nil

cmd/config/args/clear.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ func NewClearCmd(baseCmd *cmd.BaseCmd, opt ...options.CmdOption) (*cobra.Command
3131

3232
cobraCmd := &cobra.Command{
3333
Use: "clear <server-name>",
34-
Short: "Clears configured command line arguments (flags) for an MCP server",
35-
Long: "Clears configured command line arguments (flags) for an MCP server, " +
36-
"from the runtime context configuration file (e.g. ~/.config/mcpd/secrets.dev.toml)",
34+
Short: "Clears configured command line arguments for an MCP server",
35+
Long: "Clears configured command line arguments for an MCP server, " +
36+
"from the runtime context configuration file (e.g. `~/.config/mcpd/secrets.dev.toml`)",
3737
RunE: c.run,
3838
Args: cobra.MinimumNArgs(1), // server-name
3939
}

cmd/config/args/list.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ func NewListCmd(baseCmd *cmd.BaseCmd, opt ...options.CmdOption) (*cobra.Command,
3030

3131
cobraCmd := &cobra.Command{
3232
Use: "list <server-name>",
33-
Short: "Lists the configured command line arguments (flags) for a specific MCP server",
34-
Long: "Lists the configured command line arguments (flags) for a specific MCP server, " +
35-
"using the runtime context configuration file (e.g. ~/.config/mcpd/secrets.dev.toml)",
33+
Short: "Lists the configured command line arguments for a specific MCP server",
34+
Long: "Lists the configured command line arguments for a specific MCP server, " +
35+
"using the runtime context configuration file (e.g. `~/.config/mcpd/secrets.dev.toml`)",
3636
RunE: c.run,
3737
Args: cobra.MinimumNArgs(1), // server-name
3838
}

cmd/config/args/remove.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ func NewRemoveCmd(baseCmd *cmd.BaseCmd, opt ...options.CmdOption) (*cobra.Comman
3535
cobraCmd := &cobra.Command{
3636
Use: "remove <server-name> -- --arg [--arg ...]",
3737
Example: "remove time -- --local-timezone",
38-
Short: "Remove command line arguments (flags) for an MCP server",
39-
Long: "Remove command line arguments (flags) for a specified MCP server in the " +
40-
"runtime context configuration file (e.g. ~/.config/mcpd/secrets.dev.toml)",
38+
Short: "Remove command line arguments for an MCP server",
39+
Long: "Remove command line arguments for a specified MCP server in the " +
40+
"runtime context configuration file (e.g. `~/.config/mcpd/secrets.dev.toml`)",
4141
RunE: c.run,
4242
Args: cobra.MinimumNArgs(2), // server-name + --arg ...
4343
}

cmd/config/args/set.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ func NewSetCmd(baseCmd *cmd.BaseCmd, opt ...cmdopts.CmdOption) (*cobra.Command,
3131

3232
cobraCmd := &cobra.Command{
3333
Use: "set <server-name> -- --arg=value [--arg=value ...]",
34-
Short: "Set startup command line arguments (flags) for an MCP server",
35-
Long: "Set startup command line arguments (flags) for an MCP server in the " +
36-
"runtime context configuration file (e.g. ~/.config/mcpd/secrets.dev.toml)",
34+
Short: "Set startup command line arguments for an MCP server",
35+
Long: "Set startup command line arguments for an MCP server in the " +
36+
"runtime context configuration file (e.g. `~/.config/mcpd/secrets.dev.toml`)",
3737
RunE: c.run,
3838
Args: func(cmd *cobra.Command, args []string) error {
3939
if cmd.ArgsLenAtDash() < 1 || strings.TrimSpace(args[0]) == "" {

cmd/config/env/clear.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func NewClearCmd(baseCmd *cmd.BaseCmd, opt ...options.CmdOption) (*cobra.Command
3333
Use: "clear <server-name>",
3434
Short: "Clears configured environment variables for an MCP server",
3535
Long: "Clears environment variables for a specified MCP server from the " +
36-
"runtime context configuration file (e.g. ~/.config/mcpd/secrets.dev.toml)",
36+
"runtime context configuration file (e.g. `~/.config/mcpd/secrets.dev.toml`)",
3737
RunE: c.run,
3838
Args: cobra.MinimumNArgs(1), // server-name
3939
}

cmd/config/env/list.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func NewListCmd(baseCmd *cmd.BaseCmd, opt ...options.CmdOption) (*cobra.Command,
3636
Use: "list <server-name>",
3737
Short: "Lists configured environment variables for a specific MCP server",
3838
Long: "Lists configured environment variables for a specific MCP server, using the " +
39-
"runtime context configuration file (e.g. ~/.config/mcpd/secrets.dev.toml)",
39+
"runtime context configuration file (e.g. `~/.config/mcpd/secrets.dev.toml`)",
4040
RunE: c.run,
4141
Args: cobra.MinimumNArgs(1), // server-name
4242
}

cmd/config/env/remove.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func NewRemoveCmd(baseCmd *cmd.BaseCmd, opt ...options.CmdOption) (*cobra.Comman
3636
Use: "remove <server-name> KEY [KEY ...]",
3737
Short: "Remove environment variables for an MCP server",
3838
Long: "Remove environment variables for a specified MCP server in the " +
39-
"runtime context configuration file (e.g. ~/.config/mcpd/secrets.dev.toml)",
39+
"runtime context configuration file (e.g. `~/.config/mcpd/secrets.dev.toml`)",
4040
RunE: c.run,
4141
Args: cobra.MinimumNArgs(2), // server-name + KEY ...
4242
}

cmd/config/env/set.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func NewSetCmd(baseCmd *cmd.BaseCmd, opt ...options.CmdOption) (*cobra.Command,
3434
Use: "set <server-name> KEY=VALUE [KEY=VALUE ...]",
3535
Short: "Set or update environment variables for an MCP server",
3636
Long: "Set or update environment variables for a specified MCP server in the " +
37-
"runtime context configuration file (e.g. ~/.config/mcpd/secrets.dev.toml)",
37+
"runtime context configuration file (e.g. `~/.config/mcpd/secrets.dev.toml`)",
3838
RunE: c.run,
3939
Args: cobra.MinimumNArgs(2), // server_name and KEY=VALUE
4040
}

cmd/config/export/export.go

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,19 @@ func NewCmd(baseCmd *cmd.BaseCmd, opt ...options.CmdOption) (*cobra.Command, err
6767
}
6868

6969
func (c *Cmd) longDescription() string {
70-
return `Exports current configuration, generating a pair of safe and portable configuration files.
71-
72-
Using a project's required configuration (e.g. .mcpd.toml) and the locally configured runtime values from the execution context file (e.g. ~/.config/mcpd/secrets.dev.toml), the export command outputs two files:
73-
74-
Environment Contract:
75-
- Lists all required and configured environment variables as secure, namespaced placeholders
76-
e.g. MCPD__{SERVER_NAME}__{ENV_VAR}
77-
- Creates placeholders for command line arguments to be populated with env vars
78-
e.g. MCPD__{SERVER_NAME}__ARG_{ARG_NAME}
79-
- This file is intended for the platform operator or CI/CD system
80-
81-
Portable Execution Context:
82-
- A new secrets .toml file that defines sanitized runtime args and env sections for each server using the placeholders aligned with the environment contract
83-
- These files are safe to check into version control if required.
84-
85-
"This allows running an mcpd project in any environment, cleanly separating the configuration structure from the secret values`
70+
return "Exports current configuration, generating a pair of safe and portable configuration files.\n\n" +
71+
"Using a project's required configuration (e.g. `.mcpd.toml`) and the locally configured runtime values from the " +
72+
"execution context file (e.g. `~/.config/mcpd/secrets.dev.toml`), the export command outputs two files:\n\n" +
73+
"Environment Contract:\n\n" +
74+
"Lists all required and configured environment variables as secure, namespaced placeholders:\n\n" +
75+
"`MCPD__{SERVER_NAME}__{ENV_VAR}` - Creates placeholders for command line arguments to be populated with env vars\n\n" +
76+
"`MCPD__{SERVER_NAME}__ARG_{ARG_NAME}` - This file is intended for the platform operator or CI/CD system\n\n" +
77+
"Portable Execution Context:\n\n" +
78+
"- A new secrets `.toml` file that defines sanitized runtime args and env sections for each server using the " +
79+
"placeholders aligned with the environment contract\n" +
80+
"- These files are safe to check into version control if required.\n\n" +
81+
"This allows running an mcpd project in any environment, cleanly separating the configuration structure " +
82+
"from the secret values"
8683
}
8784

8885
func (c *Cmd) run(cmd *cobra.Command, args []string) error {

0 commit comments

Comments
 (0)