registry

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(cmd Command)

Register adds a command to the global CLI registry.

Registration is expected to happen from package init functions and panics on programmer errors such as duplicate names.

func Run

func Run(cfg *config.Config, args []string) (bool, error)

Run looks up and executes a registered command.

The boolean result reports whether a matching command was found.

func Usage

func Usage() string

Usage renders grouped CLI usage text for all registered commands.

Types

type Command

type Command interface {
	Name() string
	Summary() string
	Group() string
	Details() []string
	RequiresConfig() bool
	Run(cfg *config.Config, args []string) error
}

Command is the common interface implemented by all Foundry CLI commands.

func Lookup

func Lookup(args []string) (Command, bool)

Lookup resolves a command from os.Args-style input.

type Info

type Info struct {
	Name           string
	Summary        string
	Group          string
	Details        []string
	RequiresConfig bool
}

Info is the serializable command metadata used to build usage output.

func List

func List() []Info

List returns all registered commands sorted by group and name.

Jump to

Keyboard shortcuts

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