cmd

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 44 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithClient

func WithClient(ctx server.Cmd, fn func(*httpclient.Client, string) error) error

WithClient returns auth client configured from the global HTTP flags.

Types

type AgentCommands

type AgentCommands struct {
	ListAgents ListAgentsCommand `cmd:"" name:"agents" help:"List agents." group:"TOOLS & AGENTS"`
	GetAgent   GetAgentCommand   `cmd:"" name:"agent" help:"Get an agent by name." group:"TOOLS & AGENTS"`
	CallAgent  CallAgentCommand  `cmd:"" name:"agent-call" help:"Call an agent by name." group:"TOOLS & AGENTS"`
}

type AskCommand

type AskCommand struct {
	schema.GeneratorMeta `embed:""`
	Text                 string   `arg:"" help:"User input text"`
	File                 []string `name:"file" help:"Path or glob pattern for files to attach (may be repeated)" optional:""`
	Stream               bool     `name:"stream" help:"Stream the response as it is generated." default:"true" negatable:""`
	Out                  string   `name:"out" type:"dir" help:"Path to write response attachments (defaults to stdout)" optional:""`
}

func (*AskCommand) Run

func (cmd *AskCommand) Run(ctx server.Cmd) (err error)

type AskCommands

type AskCommands struct {
	Ask AskCommand `cmd:"" name:"ask" help:"Send a stateless text request to a model." group:"RESPONSES"`
}

type CallAgentCommand

type CallAgentCommand struct {
	Name  string `arg:"" name:"name" help:"Agent name"`
	Input string `arg:"" name:"input" help:"JSON input payload" optional:""`
}

func (*CallAgentCommand) Run

func (cmd *CallAgentCommand) Run(ctx server.Cmd) (err error)

type CallToolCommand

type CallToolCommand struct {
	Name  string `arg:"" name:"name" help:"Tool name"`
	Input string `arg:"" name:"input" help:"JSON input payload" optional:""`
}

func (*CallToolCommand) Run

func (cmd *CallToolCommand) Run(ctx server.Cmd) (err error)

type ChannelCommand

type ChannelCommand struct {
	Session uuid.UUID `name:"session" help:"Session ID (defaults to the stored current session)." optional:""`
}

func (*ChannelCommand) Run

func (cmd *ChannelCommand) Run(ctx server.Cmd) (err error)

type ChannelCommands

type ChannelCommands struct {
	SessionUI ChannelCommand `cmd:"" name:"session-ui" help:"Open the interactive session UI for an existing session." group:"RESPONSES"`
}

type ChatCommand

type ChatCommand struct {
	Session       uuid.UUID `name:"session" help:"Session ID (defaults to the stored current session)" optional:""`
	Text          string    `arg:"" help:"User input text"`
	Tools         []string  `name:"tool" help:"Tool names to include (may be repeated; nil means all, empty means none)" optional:""`
	MaxIterations uint      `name:"max-iterations" help:"Maximum tool-calling iterations (0 uses default)" optional:""`
	SystemPrompt  string    `name:"system-prompt" help:"Per-request system prompt appended to the session prompt" optional:""`
	Stream        bool      `name:"stream" help:"Stream the response as it is generated." default:"true" negatable:""`
	Out           string    `name:"out" type:"dir" help:"Path to write response attachments (defaults to stdout)" optional:""`
}

func (*ChatCommand) Run

func (cmd *ChatCommand) Run(ctx server.Cmd) (err error)

type ChatCommands

type ChatCommands struct {
	Chat ChatCommand `cmd:"" name:"chat" help:"Send a message within an existing session." group:"RESPONSES"`
}

type ConnectorCommands

type ConnectorCommands struct {
	ListConnectors  ListConnectorsCommand  `cmd:"" name:"connectors" help:"List connectors." group:"CONNECTORS"`
	CreateConnector CreateConnectorCommand `cmd:"" name:"connector-create" help:"Create a connector." group:"CONNECTORS"`
	DeleteConnector DeleteConnectorCommand `cmd:"" name:"connector-delete" help:"Delete a connector by URL." group:"CONNECTORS"`
	GetConnector    GetConnectorCommand    `cmd:"" name:"connector" help:"Get a connector by URL." group:"CONNECTORS"`
	UpdateConnector UpdateConnectorCommand `cmd:"" name:"connector-update" help:"Update connector metadata." group:"CONNECTORS"`
}

type CreateConnectorCommand

type CreateConnectorCommand struct {
	URL string `arg:"" name:"url" help:"MCP server endpoint URL"`
	schema.ConnectorMeta
}

func (*CreateConnectorCommand) Run

func (cmd *CreateConnectorCommand) Run(ctx server.Cmd) (err error)

type CreateProviderCommand

type CreateProviderCommand struct {
	schema.ProviderInsert `embed:""`
}

func (*CreateProviderCommand) Run

func (cmd *CreateProviderCommand) Run(ctx server.Cmd) (err error)

type CreateSessionCommand

type CreateSessionCommand struct {
	schema.SessionInsert `embed:""`
}

func (*CreateSessionCommand) Run

func (cmd *CreateSessionCommand) Run(ctx server.Cmd) (err error)

type DeleteConnectorCommand

type DeleteConnectorCommand struct {
	URL string `arg:"" name:"url" help:"MCP server endpoint URL"`
}

func (*DeleteConnectorCommand) Run

func (cmd *DeleteConnectorCommand) Run(ctx server.Cmd) (err error)

type DeleteModelCommand

type DeleteModelCommand struct {
	Name     string `arg:"" name:"name" help:"Model name to delete"`
	Provider string `name:"provider" help:"Provider name" optional:""`
}

func (*DeleteModelCommand) Run

func (cmd *DeleteModelCommand) Run(ctx server.Cmd) (err error)

type DeleteProviderCommand

type DeleteProviderCommand struct {
	Name string `arg:"" name:"name" help:"Provider name"`
}

func (*DeleteProviderCommand) Run

func (cmd *DeleteProviderCommand) Run(ctx server.Cmd) (err error)

type DeleteSessionCommand

type DeleteSessionCommand struct {
	ID uuid.UUID `arg:"" name:"id" help:"Session ID."`
}

func (*DeleteSessionCommand) Run

func (cmd *DeleteSessionCommand) Run(ctx server.Cmd) (err error)

type DownloadModelCommand

type DownloadModelCommand struct {
	Name     string `arg:"" name:"name" help:"Model name to download"`
	Provider string `name:"provider" help:"Provider name" optional:""`
	Progress bool   `name:"progress" help:"Show download progress" default:"true" negatable:""`
}

func (*DownloadModelCommand) Run

func (cmd *DownloadModelCommand) Run(ctx server.Cmd) (err error)

type EmbeddingCommand

type EmbeddingCommand struct {
	schema.EmbeddingRequest `embed:""`
	CSV                     string `` /* 147-byte string literal not displayed */
	Out                     string `name:"out" type:"file" placeholder:"FILE" help:"Path to output CSV file (defaults to stdout)" optional:""`
}

func (*EmbeddingCommand) Run

func (cmd *EmbeddingCommand) Run(ctx server.Cmd) (err error)

type EmbeddingCommands

type EmbeddingCommands struct {
	Embedding EmbeddingCommand `` /* 126-byte string literal not displayed */
}

type GetAgentCommand

type GetAgentCommand struct {
	Name string `arg:"" name:"name" help:"Agent name"`
}

func (*GetAgentCommand) Run

func (cmd *GetAgentCommand) Run(ctx server.Cmd) (err error)

type GetConnectorCommand

type GetConnectorCommand struct {
	URL string `arg:"" name:"url" help:"MCP server endpoint URL"`
}

func (*GetConnectorCommand) Run

func (cmd *GetConnectorCommand) Run(ctx server.Cmd) (err error)

type GetModelCommand

type GetModelCommand struct {
	Name      string `arg:"" name:"name" help:"Model name" optional:""`
	Provider  string `name:"provider" help:"Provider name" optional:""`
	Default   bool   `name:"default" help:"Save as the default model" optional:""`
	Embedding bool   `name:"embedding" help:"Use the embedding model defaults instead of the completion model defaults" optional:""`
}

func (*GetModelCommand) Run

func (cmd *GetModelCommand) Run(ctx server.Cmd) (err error)

type GetProviderCommand

type GetProviderCommand struct {
	Name string `arg:"" name:"name" help:"Provider name"`
}

func (*GetProviderCommand) Run

func (cmd *GetProviderCommand) Run(ctx server.Cmd) (err error)

type GetSessionCommand

type GetSessionCommand struct {
	ID      uuid.UUID `arg:"" name:"id" help:"Session ID (defaults to the stored current session)." optional:""`
	Default bool      `name:"default" help:"Save as the default session" optional:""`
}

func (*GetSessionCommand) Run

func (cmd *GetSessionCommand) Run(ctx server.Cmd) (err error)

type GetToolCommand

type GetToolCommand struct {
	Name string `arg:"" name:"name" help:"Tool name"`
}

func (*GetToolCommand) Run

func (cmd *GetToolCommand) Run(ctx server.Cmd) (err error)

type ListAgentsCommand

type ListAgentsCommand struct {
	schema.AgentListRequest `embed:""`
}

func (*ListAgentsCommand) Run

func (cmd *ListAgentsCommand) Run(ctx server.Cmd) (err error)

type ListConnectorsCommand

type ListConnectorsCommand struct {
	schema.ConnectorListRequest `embed:""`
}

func (*ListConnectorsCommand) Run

func (cmd *ListConnectorsCommand) Run(ctx server.Cmd) (err error)

type ListMessagesCommand

type ListMessagesCommand struct {
	Session                   uuid.UUID `arg:"" name:"id" help:"Session ID (defaults to the stored current session)." optional:""`
	schema.MessageListRequest `embed:""`
}

func (*ListMessagesCommand) Run

func (cmd *ListMessagesCommand) Run(ctx server.Cmd) (err error)

type ListModelsCommand

type ListModelsCommand struct {
	schema.ModelListRequest `embed:""`
}

func (*ListModelsCommand) Run

func (cmd *ListModelsCommand) Run(ctx server.Cmd) (err error)

type ListProvidersCommand

type ListProvidersCommand struct {
	schema.ProviderListRequest `embed:""`
}

func (*ListProvidersCommand) Run

func (cmd *ListProvidersCommand) Run(ctx server.Cmd) (err error)

type ListSessionsCommand

type ListSessionsCommand struct {
	schema.SessionListRequest `embed:""`
}

func (*ListSessionsCommand) Run

func (cmd *ListSessionsCommand) Run(ctx server.Cmd) (err error)

type ListToolsCommand

type ListToolsCommand struct {
	schema.ToolListRequest `embed:""`
}

func (*ListToolsCommand) Run

func (cmd *ListToolsCommand) Run(ctx server.Cmd) (err error)

type ModelCommands

type ModelCommands struct {
	ListModels    ListModelsCommand    `cmd:"" name:"models" help:"List models." group:"MODELS"`
	DownloadModel DownloadModelCommand `cmd:"" name:"model-download" help:"Download a model." group:"MODELS"`
	DeleteModel   DeleteModelCommand   `cmd:"" name:"model-delete" help:"Delete a model by name." group:"MODELS"`
	GetModel      GetModelCommand      `cmd:"" name:"model" help:"Get a model by name." group:"MODELS"`
}

type PostgresFlags

type PostgresFlags struct {
	Url      string `name:"url" env:"PG_URL" help:"PostgreSQL connection URL"`
	Password string `name:"password" env:"PG_PASSWORD" help:"PostgreSQL password"`
}

func (*PostgresFlags) Connect

func (cmd *PostgresFlags) Connect(ctx server.Cmd) (pg.PoolConn, error)

Connect to the database and return a connection pool, or nil if no URL is set.

type ProviderCommands

type ProviderCommands struct {
	ListProviders  ListProvidersCommand  `cmd:"" name:"providers" help:"List providers." group:"PROVIDERS"`
	CreateProvider CreateProviderCommand `cmd:"" name:"provider-create" help:"Create a provider." group:"PROVIDERS"`
	DeleteProvider DeleteProviderCommand `cmd:"" name:"provider-delete" help:"Delete a provider by name." group:"PROVIDERS"`
	GetProvider    GetProviderCommand    `cmd:"" name:"provider" help:"Get a provider by name." group:"PROVIDERS"`
	UpdateProvider UpdateProviderCommand `cmd:"" name:"provider-update" help:"Update provider metadata." group:"PROVIDERS"`
}

type RunServer

type RunServer struct {
	cmd.RunServer

	// Postgres connection flags
	PostgresFlags `embed:"" prefix:"pg."`

	// Schemas for tenancy
	Schema struct {
		Auth   string `name:"auth" help:"PostgreSQL schema for auth data." default:"auth"`
		LLM    string `name:"llm" help:"PostgreSQL schema for LLM data." default:"llm"`
		Memory string `name:"memory" help:"PostgreSQL schema for memory data." default:"memory"`
	} `embed:"" prefix:"schema."`

	// Home Assistant connector options
	HomeAssistant struct {
		Endpoint string `help:"Home Assistant endpoint URL." env:"HA_ENDPOINT"`
		APIKey   string `help:"Home Assistant long-lived access token." env:"HA_TOKEN"`
	} `embed:"" prefix:"homeassistant."`

	// Other flags
	Passphrases []string `name:"passphrase" env:"${ENV_NAME}_PASSPHRASES" help:"One or more passphrases used to encrypt credentials. "`
	Auth        bool     `name:"auth" help:"Enable authentication for protected endpoints." default:"true" negatable:""`
	Memory      bool     `name:"memory" help:"Enable memory and related endpoints." default:"true" negatable:""`
}

func (*RunServer) Run

func (runner *RunServer) Run(ctx server.Cmd) error

type SessionCommands

type SessionCommands struct {
	ListSessions  ListSessionsCommand  `cmd:"" name:"sessions" help:"List sessions." group:"SESSIONS"`
	ListMessages  ListMessagesCommand  `cmd:"" name:"session-messages" help:"List messages for a session." group:"SESSIONS"`
	CreateSession CreateSessionCommand `cmd:"" name:"session-create" help:"Create a new session." group:"SESSIONS"`
	GetSession    GetSessionCommand    `cmd:"" name:"session" help:"Get a session by ID or the stored current session." group:"SESSIONS"`
	UpdateSession UpdateSessionCommand `cmd:"" name:"session-update" help:"Update session metadata." group:"SESSIONS"`
	DeleteSession DeleteSessionCommand `cmd:"" name:"session-delete" help:"Delete a session by ID." group:"SESSIONS"`
}

type ToolCommands

type ToolCommands struct {
	ListTools ListToolsCommand `cmd:"" name:"tools" help:"List tools." group:"TOOLS & AGENTS"`
	GetTool   GetToolCommand   `cmd:"" name:"tool" help:"Get a tool by name." group:"TOOLS & AGENTS"`
	CallTool  CallToolCommand  `cmd:"" name:"tool-call" help:"Call a tool by name." group:"TOOLS & AGENTS"`
}

type UpdateConnectorCommand

type UpdateConnectorCommand struct {
	URL string `arg:"" name:"url" help:"MCP server endpoint URL"`
	schema.ConnectorMeta
}

func (*UpdateConnectorCommand) Run

func (cmd *UpdateConnectorCommand) Run(ctx server.Cmd) (err error)

type UpdateProviderCommand

type UpdateProviderCommand struct {
	Name                string `arg:"" name:"name" help:"Provider name"`
	schema.ProviderMeta `embed:""`
}

func (*UpdateProviderCommand) Run

func (cmd *UpdateProviderCommand) Run(ctx server.Cmd) (err error)

type UpdateSessionCommand

type UpdateSessionCommand struct {
	ID                 uuid.UUID `arg:"" name:"id" help:"Session ID (defaults to the stored current session)." optional:""`
	schema.SessionMeta `embed:""`
}

func (*UpdateSessionCommand) Run

func (cmd *UpdateSessionCommand) Run(ctx server.Cmd) (err error)

Jump to

Keyboard shortcuts

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