cli

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package cli provides a command registry so feature packages can self-register cobra commands via init() without touching main.go. This enables parallel development across worktrees with zero merge conflicts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All() []func() *cobra.Command

All returns all registered command factories. main.go calls this after all packages are imported.

func Get

func Get(name string) func() *cobra.Command

Get returns the command factory registered with the given Use name. Returns nil if not found. Use this to pick specific commands in a desired order rather than relying on import/init order.

func GetMany

func GetMany(names ...string) []func() *cobra.Command

GetMany returns command factories for the given names in order. Unknown names are skipped silently.

func Register

func Register(fn func() *cobra.Command)

Register adds a command factory to the registry. Feature packages call this in their init() functions.

func Remaining

func Remaining(exclude ...string) []func() *cobra.Command

Remaining returns command factories whose Use name is NOT in the provided set. Useful for adding any not-yet-added commands after an explicit ordered list.

Types

This section is empty.

Jump to

Keyboard shortcuts

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