commands

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const TreeFlagName = "tree"

TreeFlagName is the persistent flag name that triggers a tree dump.

Variables

View Source
var ErrNonInteractiveRequired = errors.New("non-interactive mode required: provide flags to skip prompts or run in a terminal")

ErrNonInteractiveRequired is returned when a command would prompt but stdin is not a TTY and no non-interactive bypass flags were provided.

Functions

func FilterTreeFlag added in v0.2.15

func FilterTreeFlag(args []string) []string

FilterTreeFlag returns argv with the --tree token stripped so cobra's command resolution can ignore it.

func HasTreeFlag added in v0.2.15

func HasTreeFlag(args []string) bool

HasTreeFlag reports whether argv requests a command-tree dump.

func IsInteractive added in v0.3.1

func IsInteractive() bool

IsInteractive returns true when huh prompts can be shown.

func PrintCommandTree added in v0.2.15

func PrintCommandTree(w io.Writer, cmd *cobra.Command)

PrintCommandTree prints the command, its subcommands, and their flags as a connected tree. Long lines are wrapped with prefix continuation so the vertical bars are never broken by overflowing text.

func RegisterAPI

func RegisterAPI(rootCmd *cobra.Command)

RegisterAPI registers the API command and all subcommands.

func RegisterAuth added in v0.1.17

func RegisterAuth(rootCmd *cobra.Command)

RegisterAuth registers the auth command and all subcommands.

func RegisterCache added in v0.2.0

func RegisterCache(rootCmd *cobra.Command)

RegisterCache registers the cache command group.

func RegisterClear added in v0.2.0

func RegisterClear(rootCmd *cobra.Command)

RegisterClear registers the clear command.

func RegisterCompare added in v0.1.6

func RegisterCompare(rootCmd *cobra.Command)

RegisterCompare registers the compare command.

func RegisterCompletion

func RegisterCompletion(rootCmd *cobra.Command)

RegisterCompletion registers the completion command.

func RegisterConfig

func RegisterConfig(rootCmd *cobra.Command)

RegisterConfig registers the config command.

func RegisterDocs added in v0.3.5

func RegisterDocs(rootCmd *cobra.Command)

RegisterDocs registers documentation generation commands.

func RegisterExport

func RegisterExport(rootCmd *cobra.Command)

RegisterExport registers the export command.

func RegisterImport

func RegisterImport(rootCmd *cobra.Command)

RegisterImport registers the import command.

func RegisterMigrate

func RegisterMigrate(rootCmd *cobra.Command)

RegisterMigrate registers the migrate command.

func RegisterSkills added in v0.2.0

func RegisterSkills(rootCmd *cobra.Command)

RegisterSkills registers the skills command group.

func RegisterVersion

func RegisterVersion(rootCmd *cobra.Command)

RegisterVersion registers the version command.

func RequireInteractive added in v0.3.1

func RequireInteractive() error

RequireInteractive fails when not a TTY (for CI/scripts).

func ResolveTreeTarget added in v0.2.15

func ResolveTreeTarget(root *cobra.Command, args []string) *cobra.Command

ResolveTreeTarget locates the command the user is asking about. Positional args and unknown flags are ignored — the tree dump describes shape, not invocation.

func SetBuildInfo

func SetBuildInfo(info BuildInfo)

SetBuildInfo sets build information (called from main.go)

func ShouldSkipConfirm added in v0.3.1

func ShouldSkipConfirm(cmd *cobra.Command, force bool) bool

ShouldSkipConfirm returns true when the user passed --force, --yes, or global --yes.

func WithGlobalFlags

func WithGlobalFlags(ctx context.Context, flags GlobalFlags) context.Context

WithGlobalFlags adds global flags to the context.

Types

type BuildInfo

type BuildInfo struct {
	Version   string
	BuildDate string
	Commit    string
	GoVersion string
	Platform  string
}

BuildInfo holds build-time information

type GlobalFlags

type GlobalFlags struct {
	ConfigFile         string
	ClientID           string
	ClientSecret       string
	APIURL             string
	TargetClientID     string
	TargetClientSecret string
	TargetAPIURL       string
	Debug              bool
	NoColor            bool
	Quiet              bool
	Verbose            bool
	Yes                bool
	NoEnvFile          bool
}

GlobalFlags holds global CLI flags.

func GetGlobalFlags

func GetGlobalFlags(ctx context.Context) GlobalFlags

GetGlobalFlags retrieves global flags from context.

Jump to

Keyboard shortcuts

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