cmd

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CommandersGroupName = "us/cmd/commanders"

Variables

This section is empty.

Functions

func Module

func Module(extends ...di.Node) di.Node

Module wires root command creation and auto-registration for all Commander implementations.

func RegisterCommands

func RegisterCommands(params registerParams) error

func Use

func Use(name string, nodes ...di.Node) di.Node

Use conditionally includes nodes for the selected CLI command. Selection is inferred from process args (defaults to "serve" when no command is provided). Nested commands are supported via prefix matching, for example: Use("user") matches "user list", and Use("user list") matches "user list active".

func UseBasicCommands

func UseBasicCommands() di.Node

func WithDefaultName

func WithDefaultName(name string) di.Node

WithDefaultName configures the default command used when no subcommand is provided.

Types

type Commander

type Commander interface {
	Command() *cobra.Command // command instance
}

type HealthcheckCommand added in v1.6.0

type HealthcheckCommand struct {
	// contains filtered or unexported fields
}

func NewHealthcheckCommand added in v1.6.0

func NewHealthcheckCommand(shutdowner fx.Shutdowner) *HealthcheckCommand

func (*HealthcheckCommand) Command added in v1.6.0

func (s *HealthcheckCommand) Command() *cobra.Command

func (*HealthcheckCommand) Run added in v1.6.0

func (s *HealthcheckCommand) Run(cmd *cobra.Command, args []string) error

type HelpCommand

type HelpCommand struct {
	// contains filtered or unexported fields
}

func NewHelpCommand

func NewHelpCommand(shutdowner fx.Shutdowner) *HelpCommand

func (*HelpCommand) Command

func (s *HelpCommand) Command() *cobra.Command

func (*HelpCommand) Run

func (s *HelpCommand) Run(cmd *cobra.Command, args []string) error

type Root

type Root struct {
	*cobra.Command
}

func New

func New(cmd *cobra.Command) *Root

func (*Root) Register

func (r *Root) Register(commands ...Commander) error

func (*Root) RegisterOne

func (r *Root) RegisterOne(c Commander) error

func (*Root) Start

func (r *Root) Start(ctx context.Context) error

type VersionCommand

type VersionCommand struct {
	// contains filtered or unexported fields
}

func NewVersionCommand

func NewVersionCommand(shutdowner fx.Shutdowner) *VersionCommand

func (*VersionCommand) Command

func (s *VersionCommand) Command() *cobra.Command

func (*VersionCommand) Run

func (s *VersionCommand) Run(cmd *cobra.Command, args []string) error

Jump to

Keyboard shortcuts

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