cli

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: MIT Imports: 33 Imported by: 0

Documentation

Overview

Package cli owns the linctl command-line surface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CommandPath added in v0.3.3

func CommandPath(command *cobra.Command) string

CommandPath returns the command path without the binary name prefix.

func Execute

func Execute(ctx context.Context, build BuildInfo) error

Execute runs linctl with process stdio.

func NewRootCommand

func NewRootCommand(ctx context.Context, build BuildInfo) *cobra.Command

NewRootCommand builds the linctl root command.

func SortedAvailableCommands added in v0.3.3

func SortedAvailableCommands(parent *cobra.Command) []*cobra.Command

SortedAvailableCommands returns the available child commands in stable path order.

Types

type BuildInfo

type BuildInfo struct {
	Version string
	Commit  string
	Date    string
}

BuildInfo contains version metadata injected by release builds.

type CommandBacking added in v0.3.3

type CommandBacking struct {
	OperationBacking string
	TargetScope      string
	GraphQLRoots     []CommandGraphQLRoot
}

CommandBacking is the domain-map side of a command's control-surface metadata.

type CommandGraphQLRoot added in v0.3.3

type CommandGraphQLRoot struct {
	Kind      string
	Field     string
	Operation string
}

CommandGraphQLRoot describes a GraphQL root field that backs a public command.

type CommandInfo added in v0.3.3

type CommandInfo struct {
	Path             string
	UseLine          string
	Short            string
	Aliases          []string
	Entity           string
	TargetArgs       []string
	Safety           CommandSafety
	CollectionKey    string
	DocCategory      string
	OperationBacking string
	TargetScope      string
	GraphQLRoots     []CommandGraphQLRoot
}

CommandInfo is the normalized command metadata used by generators and drift checks that need the public Cobra surface without re-walking it.

func CommandInventory added in v0.3.3

func CommandInventory(root *cobra.Command) []CommandInfo

CommandInventory returns available non-help commands in stable path order.

func EnrichCommandInventory added in v0.3.3

func EnrichCommandInventory(commands []CommandInfo, backingByPath map[string]CommandBacking) []CommandInfo

EnrichCommandInventory merges domain-map backing into the normalized command inventory without making Cobra registration depend on repo documentation.

type CommandSafety added in v0.3.3

type CommandSafety string

CommandSafety classifies a command's behavior for command-surface audits.

const (
	CommandSafetyRead    CommandSafety = "read"
	CommandSafetyWrite   CommandSafety = "write"
	CommandSafetyLocal   CommandSafety = "local"
	CommandSafetyUnknown CommandSafety = "unknown"
)

Command safety values used by the command metadata inventory.

Jump to

Keyboard shortcuts

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