cmd

package
v0.1.0-rc4 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cmd implements the CLI subcommands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseLogLevel

func ParseLogLevel(l LogLevel) slog.Level

ParseLogLevel maps the CLI log-level flag to slog.Level.

Types

type CLI

type CLI struct {
	LogLevel LogLevel `help:"Log level (one of: ${enum})." default:"info" enum:"debug,info,warn,error" short:"l"`
	Commands
}

CLI is the root Kong CLI struct.

type Commands

type Commands struct {
	Serve    ServeCmd    `cmd:"" help:"Run MCP server."`
	Validate ValidateCmd `cmd:"" help:"Validate config file."`
	Sources  SourcesCmd  `cmd:"" help:"Manage sources."`
	Setup    SetupCmd    `cmd:"" help:"Start config-authoring MCP server assistant."`
}

Commands holds the subcommands and config, safe to embed.

type ConfigFlag

type ConfigFlag struct {
	Config string `help:"Path to config." default:".mcpsmithy.yaml" type:"path" short:"c"`
}

type LogLevel

type LogLevel string

LogLevel represents a supported log verbosity level.

const (
	LogLevelDebug LogLevel = "debug"
	LogLevelInfo  LogLevel = "info"
	LogLevelWarn  LogLevel = "warn"
	LogLevelError LogLevel = "error"
)

type ServeCmd

type ServeCmd struct {
	ConfigFlag
	Transport string `help:"Transport to use (one of: ${enum})." default:"stdio" enum:"stdio,http"`
	Addr      string `help:"Listen address (HTTP transport only)." default:":8080"`
	Watch     bool   `help:"Watch config file and hot-reload on change." default:"false"`
}

ServeCmd starts the MCP server.

func (*ServeCmd) Run

func (cmd *ServeCmd) Run(ctx context.Context) error

Run executes the serve command.

type SetupCmd

type SetupCmd struct{}

SetupCmd starts an MCP server for config-authoring sessions. It does not require an existing .mcpsmithy.yaml.

func (*SetupCmd) Run

func (s *SetupCmd) Run(ctx context.Context) error

Run starts the setup server on stdio.

type SourcesCmd

type SourcesCmd struct {
	Pull SourcesPullCmd `cmd:"" help:"Fetch external sources and write them to disk."`
}

SourcesCmd is the command group for source management.

type SourcesPullCmd

type SourcesPullCmd struct {
	ConfigFlag
}

SourcesPullCmd fetches all sources and writes them to disk.

func (*SourcesPullCmd) Run

func (cmd *SourcesPullCmd) Run(ctx context.Context) error

Run executes sources pull.

type ValidateCmd

type ValidateCmd struct {
	ConfigFlag
}

ValidateCmd validates the config file.

func (*ValidateCmd) Run

func (cmd *ValidateCmd) Run(ctx context.Context) error

Run executes validate.

Jump to

Keyboard shortcuts

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