cli

package
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli assembles the mcp command tree.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

Execute runs the mcp command line using os.Args.

func NewRootCommand

func NewRootCommand() *cobra.Command

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL