cli

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2026 License: Apache-2.0 Imports: 41 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cli is the command line front door: it defines the Cobra commands, maps results to exit codes and carries the build version, commit and date injected by ldflags.

Index

Constants

View Source
const (
	// ExitOK: nothing matched fail_on.
	ExitOK = 0
	// ExitFindings: at least one unsuppressed finding matched fail_on.
	ExitFindings = 1
	// ExitUsage: a usage error or a fatal runtime error.
	ExitUsage = 2
)

Exit codes. Only this package maps outcomes to exit codes.

Variables

View Source
var (
	Version = defaultVersion
	Commit  = defaultCommit
	Date    = defaultDate
)

Build metadata, injected at link time by GoReleaser through ldflags:

-X github.com/aiagentpro/tokenhound/internal/cli.Version=...

When a value is not injected (go install, make build), BuildInfo falls back to the module version and VCS stamps the Go toolchain embeds.

Functions

func BuildInfo

func BuildInfo() (version, commit, date string)

BuildInfo returns the version, commit and date of this binary: the ldflags values when set, otherwise the values recorded by the Go toolchain.

func NewRoot

func NewRoot(stdout, stderr io.Writer) *cobra.Command

NewRoot returns the root command with production dependencies.

func Run

func Run(args []string, stdout, stderr io.Writer) int

Run executes the CLI with args and returns the process exit code.

Types

This section is empty.

Jump to

Keyboard shortcuts

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