cli

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2026 License: Apache-2.0, MIT Imports: 31 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 builds the agentcompute command tree.

The root command wires two transport subcommands onto the same transport-agnostic MCP server from internal/mcpserver: stdio, for clients that spawn the process and speak JSON-RPC over its standard streams, and http, for networked clients using the Streamable HTTP transport. Each transport lives in its own file (stdio.go, http.go) so a consumer can keep one transport and delete the other by removing a single file and its registration in NewRootCommand.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRootCommand

func NewRootCommand(options Options) *cobra.Command

NewRootCommand creates the agentcompute Cobra command tree.

The root command does no work on its own; it wires the two transport subcommands (stdio and http) onto the same MCP server. To produce a single-transport repository, delete the unwanted subcommand file and its registration call below.

Types

type BuildInfo

type BuildInfo struct {
	// Version is the release version.
	Version string
	// Commit is the source commit used to build the binary.
	Commit string
	// Date is the build timestamp.
	Date string
}

BuildInfo describes linker-injected build metadata printed by --version.

type Options

type Options struct {
	// In supplies the command input stream. For the stdio transport this is
	// the client's JSON-RPC message stream.
	In io.Reader
	// Out receives machine-readable command output, including the stdio
	// transport's JSON-RPC messages.
	Out io.Writer
	// Err receives diagnostics and human-readable status, including the MCP
	// server's logs.
	Err io.Writer
	// Build controls the root command version output.
	Build BuildInfo
	// Viper is the configuration instance used by the command tree. Flags are
	// bound to environment variables named after [templateinfo.EnvPrefix],
	// for example AGENTCOMPUTE_ADDR.
	Viper *viper.Viper
	// Dependencies optionally supplies caller-owned services for embedded transports.
	// Nil builds Incus dependencies from the required configuration file.
	Dependencies *mcpserver.Dependencies
}

Options customizes root command construction.

Jump to

Keyboard shortcuts

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