Documentation
¶
Index ¶
- func AuditLogPath() string
- func InstanceFromFlags(cmd *cobra.Command) *tracker.Instance
- func LoadAllInstances(dir string) ([]tracker.Instance, error)
- func PrintConnectedTrackers(w io.Writer, loader func() ([]tracker.Instance, error))
- func PrintExamples(w io.Writer)
- func PrintJSON(w io.Writer, v any) error
- func ResolveAutoProvider(ctx context.Context, cmd *cobra.Command, keyHint string, ...) (tracker.Provider, string, func(), error)
- func ResolveProvider(cmd *cobra.Command, kind string, deps Deps) (tracker.Provider, func(), error)
- func SetupHelp(rootCmd *cobra.Command, loader func() ([]tracker.Instance, error))
- func SplitIDs(ids string) []string
- type Deps
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AuditLogPath ¶
func AuditLogPath() string
AuditLogPath returns the path to the audit log file (~/.human/audit.log), creating the directory if needed.
func InstanceFromFlags ¶
InstanceFromFlags builds a tracker instance from root persistent flags, returning nil when insufficient flags are provided.
func LoadAllInstances ¶
LoadAllInstances collects tracker instances from all provider configs.
func PrintConnectedTrackers ¶
PrintConnectedTrackers appends a "Connected trackers:" section to the help output. Errors are silently ignored so that help always works.
func PrintExamples ¶
PrintExamples prints the quick command and provider examples.
func ResolveAutoProvider ¶
func ResolveAutoProvider(ctx context.Context, cmd *cobra.Command, keyHint string, allowFindFallback bool, deps Deps) (tracker.Provider, string, func(), error)
ResolveAutoProvider loads all instances, applies flag overrides, and resolves the provider without requiring a fixed kind. It uses tracker.Resolve for auto-detection and falls back to FindTracker + ResolveByKind for ambiguous get commands.
func ResolveProvider ¶
ResolveProvider loads instances, applies CLI flag overrides, and resolves the provider for the given kind using the tracker name from persistent flags.
Types ¶
type Deps ¶
type Deps struct {
LoadInstances func(dir string) ([]tracker.Instance, error)
InstanceFromFlags func(cmd *cobra.Command) *tracker.Instance
AuditLogPath func() string
}
Deps holds injectable dependencies for command builders that need tracker instance loading and resolution.
func DefaultDeps ¶
func DefaultDeps() Deps
DefaultDeps returns a Deps using the real implementations.