Documentation
¶
Index ¶
- Variables
- func ApplyBindings(cmd *cobra.Command, bindings []FlagBinding)
- func ApplyTransform(value any, transform string, args map[string]any) (any, error)
- func BuildDynamicCommands(servers []market.ServerDescriptor, runner executor.Runner, ...) []*cobra.Command
- func CollectBindings(cmd *cobra.Command, bindings []FlagBinding, existing map[string]any) (map[string]any, error)
- func MoveParam(params map[string]any, from, to string)
- func MustString(params map[string]any, key string) (string, error)
- func NewCuratedCommand(route Route, runner executor.Runner) *cobra.Command
- func NewDirectCommand(route Route, runner executor.Runner) *cobra.Command
- func NewFallbackCommands(runner executor.Runner) []*cobra.Command
- func NewPublicCommands(runner executor.Runner) []*cobra.Command
- func RegisterFallback(factory CommandFactory)
- func RegisterPublic(factory CommandFactory)
- func ServerEndpoints(servers []market.ServerDescriptor) map[string]string
- func ServerProductIDs(servers []market.ServerDescriptor) map[string]bool
- type CommandFactory
- type FlagBinding
- type Normalizer
- type Route
- type Target
- type ValueKind
Constants ¶
This section is empty.
Variables ¶
var NewGroupCommand = cobracmd.NewGroupCommand
NewGroupCommand delegates to cobracmd.NewGroupCommand for backward compatibility.
Functions ¶
func ApplyBindings ¶
func ApplyBindings(cmd *cobra.Command, bindings []FlagBinding)
func ApplyTransform ¶
ApplyTransform applies a named transform rule to a value. Supported transforms: iso8601_to_millis, csv_to_array, json_parse, enum_map.
func BuildDynamicCommands ¶
func BuildDynamicCommands(servers []market.ServerDescriptor, runner executor.Runner, detailsByID map[string][]market.DetailTool) []*cobra.Command
BuildDynamicCommands generates cobra commands from servers.json CLIOverlay metadata. Each server with non-skip CLIOverlay gets a top-level command with groups and tool overrides translated into subcommands with proper flag bindings and transforms.
detailsByID maps CLI server ID → []DetailTool from the MCP Detail API. When provided, tool Short/Long descriptions and typed flags are enriched from Detail API data.
Conversion rules reference: docs/mcp-to-cli-conversion.md
func CollectBindings ¶
func NewCuratedCommand ¶
NewCuratedCommand creates a DirectCommand with override priority so it wins over auto-generated MCP overlay commands during command tree merging.
func RegisterFallback ¶
func RegisterFallback(factory CommandFactory)
func RegisterPublic ¶
func RegisterPublic(factory CommandFactory)
func ServerEndpoints ¶
func ServerEndpoints(servers []market.ServerDescriptor) map[string]string
ServerEndpoints extracts product ID → endpoint URL mapping from servers.
func ServerProductIDs ¶
func ServerProductIDs(servers []market.ServerDescriptor) map[string]bool
ServerProductIDs extracts the set of product IDs from servers with CLI metadata.
Types ¶
type FlagBinding ¶
type Route ¶
type Route struct {
Use string
Aliases []string
Short string
Long string
Example string
Hidden bool
Target Target
Bindings []FlagBinding
Normalizer Normalizer
}
type ValueKind ¶
type ValueKind string
const ( ValueString ValueKind = "string" ValueInt ValueKind = "int" ValueFloat ValueKind = "float" ValueBool ValueKind = "bool" ValueStringSlice ValueKind = "string_slice" ValueIntSlice ValueKind = "int_slice" ValueFloatSlice ValueKind = "float_slice" ValueBoolSlice ValueKind = "bool_slice" ValueJSON ValueKind = "json" )