cli

package
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package cli provides the command-line plumbing shared by MCP servers built on this repo: a flag value that turns a comma-separated list of toolset keys and profile names into the methods to enable.

Profiles themselves are not registered here. They are a per-server policy, so each server registers its own through toolsets.RegisterProfile before parsing flags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Methods

type Methods struct {
	// contains filtered or unexported fields
}

Methods is a slice of toolsets.Method that implements the flag.Value interface, allowing it to be used as a command-line flag type.

func NewMethods

func NewMethods(initial ...toolsets.Method) *Methods

NewMethods creates a new Methods instance with the specified initial methods.

func (*Methods) Profiles

func (m *Methods) Profiles() []string

Profiles returns the list of enabled profiles.

func (*Methods) Set

func (m *Methods) Set(value string) error

Set parses a comma-separated string of method names and updates the Methods slice. It supports individual method names, as well as profile names that expand into multiple methods. If an invalid method or profile name is encountered, it returns an error.

func (Methods) String

func (m Methods) String() string

String returns a comma-separated string representation of the Methods slice.

func (*Methods) Toolsets

func (m *Methods) Toolsets() []toolsets.Method

Toolsets returns the list of enabled toolset methods.

Jump to

Keyboard shortcuts

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