cmd

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2026 License: Apache-2.0 Imports: 26 Imported by: 1 module, 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 cmd has the workspaces' flags, and their registry, for the server

Index

Constants

View Source
const (
	// FilerName is the name of the workspace of the folder, which is its
	// namespace's, and its MCP server's
	FilerName = "files"

	// FilerTitle is the title of the workspace of the folder
	FilerTitle = "Files"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientCommands

type ClientCommands struct {
	WorkspaceCommands
}

ClientCommands are the commands which call the workspaces' API

type FilerFlags

type FilerFlags struct {
	Path        string `name:"path" help:"Folder whose files are a workspace, or none, when it's not set." type:"path"`
	Description string `` /* 126-byte string literal not displayed */
}

FilerFlags are the flags of the filer, which is a workspace, of the files of a folder, in the server, when its path is set

func (FilerFlags) WithFiler

func (flags FilerFlags) WithFiler(ctx server.Cmd, tools *toolkit.Toolkit, fn func(*filer.Server) error) error

WithFiler serves the folder, when its path is set, as an MCP server of its files, with the command's version, which its client is connected to, in memory, and connected again, should the server close its session, and whose namespace is added to the toolkit, so it's a workspace, and calls the function with the server, which it runs, or nil, when its path isn't set. Once the function returns, the namespace is removed, and the client disconnected.

type Flags

type Flags struct{}

Flags are the workspaces' flags for the server, which has none yet

func (Flags) WithWorkspaces

func (flags Flags) WithWorkspaces(ctx server.Cmd, srv *servercmd.RunServer, fn func(*workspace.Registry) error, opts ...workspace.Opt) error

WithWorkspaces creates the registry of the server's workspaces, with the options, such as the broadcaster its changes are published to, registers its HTTP handlers with the server, when there is one, and calls the function with it, returning any error. Its watches end when the function returns.

type WorkspaceCommands

type WorkspaceCommands struct {
	Workspaces WorkspaceListCmd     `cmd:"" name:"workspaces" help:"List the workspaces, such as MCP connectors with resources." group:"WORKSPACES"`
	Workspace  WorkspaceGetCmd      `cmd:"" name:"workspace" help:"Get a workspace by name." group:"WORKSPACES"`
	Read       WorkspaceReadCmd     `` /* 156-byte string literal not displayed */
	Resources  WorkspaceResourceCmd `` /* 158-byte string literal not displayed */
}

WorkspaceCommands list the workspaces, and their folders and resources

type WorkspaceGetCmd

type WorkspaceGetCmd struct {
	Name string `arg:"" name:"name" help:"Name of the workspace, which is its namespace's."`
}

func (*WorkspaceGetCmd) Run

func (cmd *WorkspaceGetCmd) Run(ctx server.Cmd) error

Run prints the workspace

type WorkspaceListCmd

type WorkspaceListCmd struct{}

func (*WorkspaceListCmd) Run

func (cmd *WorkspaceListCmd) Run(ctx server.Cmd) error

Run lists the workspaces

type WorkspaceReadCmd

type WorkspaceReadCmd struct {
	URI    string `arg:"" name:"uri" help:"URI of the resource, as it's listed, resource://<workspace>/<uri>."`
	Format string `` /* 155-byte string literal not displayed */
	Offset uint64 `name:"offset" help:"With markdown, the byte of its Markdown the part starts at, which is a part's next."`
	Limit  uint64 `name:"limit" help:"With markdown, the most bytes of its Markdown which are read."`
	Output string `name:"output" short:"o" help:"File to write the content to, or standard output, when it's omitted, or -." type:"path"`
}

func (*WorkspaceReadCmd) Run

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

Run reads the resource, by its URI, whose workspace is in it, and writes its content to the file, or standard output

type WorkspaceResourceCmd

type WorkspaceResourceCmd struct {
	Name string `` /* 132-byte string literal not displayed */
	schema.ListRequest
}

func (*WorkspaceResourceCmd) Run

func (cmd *WorkspaceResourceCmd) Run(ctx server.Cmd) error

Run lists a page of the workspace's folders and resources, and says the cursor of the next, when there is one

Jump to

Keyboard shortcuts

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