Documentation
¶
Overview ¶
Package cmd implements the CLI subcommands.
Commands are designed to be embeddable: smithy-cli embeds Commands directly into its own root CLI so that `smithy agent <subcommand>` routes to the same code paths as `agentsmithy <subcommand>`.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseLogLevel ¶
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 for the standalone agentsmithy binary.
type Commands ¶
type Commands struct {
Serve ServeCmd `cmd:"" help:"Start the agent server."`
Validate ValidateCmd `cmd:"" help:"Validate config file."`
Setup SetupCmd `cmd:"" help:"Start the config-authoring MCP assistant."`
}
Commands holds the subcommands, safe to embed into a host CLI.
type ConfigFlag ¶
type ConfigFlag struct {
Config string `help:"Path to config." default:".agentsmithy.yaml" type:"path" short:"c"`
}
ConfigFlag is the standard config-path mixin for subcommands that load an .agentsmithy.yaml file.
type ServeCmd ¶
type ServeCmd struct {
ConfigFlag
Transport string `help:"Transport to use (one of: ${enum})." enum:"a2a,stdio,mcp-stdio,mcp-http,none" default:"a2a"`
Addr string `help:"Listen address (HTTP-like transports)." default:":8080"`
Watch bool `help:"Watch config file and hot-reload on change." default:"false"`
Once string `help:"(stdio only) Send a single prompt, print the reply, then exit." short:"o"`
Verbose bool `help:"(stdio only) Print tool calls and intermediate steps." short:"v"`
}
ServeCmd starts the agent server.
`--transport` selects the wire protocol:
- a2a (default): A2A JSON-RPC server over HTTP.
- stdio: line REPL over stdin/stdout for dev/CI use.
- mcp-stdio: expose the agent as an MCP tool over stdin/stdout. This is the path VS Code, Claude Desktop, etc. spawn. Required for `provider: borrowed`, which round-trips completions back to the connecting client via sampling/createMessage.
- mcp-http: same MCP surface over streamable HTTP.
type SetupCmd ¶
type SetupCmd struct{}
SetupCmd starts an MCP server for config-authoring sessions. It does not require an existing .agentsmithy.yaml.