Documentation
¶
Overview ¶
Package cli assembles the mcp command tree.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewRootCommand ¶
NewRootCommand builds the mcp root command with all persistent flags bound into a fresh GlobalFlags value. The flags pointer is stored on the root command's context, which cobra passes to every executed subcommand, so commands reach it with FlagsFrom without NewRootCommand exposing it directly.
Types ¶
type GlobalFlags ¶
type GlobalFlags struct {
Command string
URL string
Auth string
AuthFlow string
Protocol string
ClientID string
ClientSecret string
Timeout time.Duration
JSON bool
Plain bool
Interactive bool
}
GlobalFlags holds the values of the persistent flags shared by every mcp subcommand. NewRootCommand binds the flags into it.
func FlagsFrom ¶
func FlagsFrom(cmd *cobra.Command) *GlobalFlags
FlagsFrom returns the GlobalFlags NewRootCommand bound, reachable from any command in the tree through cobra's propagated context. It returns nil for commands built outside NewRootCommand.