cli

package
v0.5.7 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 164 Imported by: ? 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

Index

Constants

View Source
const (
	ExitSuccess    = apicontract.ExitSuccess
	ExitError      = apicontract.ExitError
	ExitUsageError = apicontract.ExitUsageError
	ExitFuzzMatch  = apicontract.ExitFuzzMatch
	ExitFailOnGate = apicontract.ExitFailOnGate
	ExitIncomplete = apicontract.ExitIncomplete
)

Process exit codes. The table itself lives in pkg/apicontract, shared with the REST API's error vocabulary; these names keep pkg/cli's call sites short.

`1` used to mean both "the scan crashed" and "the scan worked and found a high-severity finding" — opposite outcomes that a CI job or an agent has to react to differently, and could not tell apart. Splitting them is the whole change; the rest of the table is written down so a consumer can rely on it.

0  success
1  error
2  usage error (bad flag, bad combination)
3  fuzz --fail-on-match matched
4  --fail-on <severity> gate tripped
5  incomplete: the work ran but did not finish (timed_out, budget_exhausted,
   partial). A scan with --fail-on-partial (implied by --fail-on) exits 5
   when its coverage was partial.

When several apply the first wins: error (1) > gate (4) > incomplete (5).

--soft-fail still forces 0 everywhere, unchanged: a caller that has opted out of exit-code gating opted out of all of it.

View Source
const AgentSchemaVersion = apicontract.SchemaVersion

AgentSchemaVersion is the contract version of every -j/--json envelope. A consumer gates on it; it is bumped on any breaking field change.

Its absence was the real problem. A driver could not write one parser, because different commands (and different vigolium versions) named the same thing differently — the row array was `data` or `records` or `traffic` or `results` or `http_records` depending on where you asked, and drift was discovered as a parse failure in production rather than as a version check at startup. There is now one shape, one canonical name per field, and a number to check.

View Source
const DiscoveryAuthors = "@j3ssie"

DiscoveryAuthors credits the discovery and spidering phases.

Variables

View Source
var (
	Name               = "vigolium"
	Description        = "High-fidelity vulnerability scanner that combines speed, modularity, and precision"
	Author             = "@j3ssie"
	InitialContributor = "@theblackturtle"
	Version            = "v0.5.7"
	Commit             = ""
	BuildTime          = ""
)

Functions

func CheckFollowUpArgv added in v0.5.7

func CheckFollowUpArgv(root *cobra.Command, argv []string, sourceDB string) error

CheckFollowUpArgv reports why argv is not a safe follow-up for a document read from dbPath: it must name a real command, that command must be a read (kind read or stream) that sends no traffic, and when the source named a database the follow-up must name the same one. Used by the contract tests on every query_argv a command emits.

It parses argv against the shared command tree, so calls are serialised.

func DocExamples added in v0.5.7

func DocExamples() ([]doclex.Command, error)

DocExamples returns every documented invocation that lexes in the embedded skill bundle, every command's Example and Long, and the --full-example tour, for a test that runs the documentation (test/e2e).

func Execute

func Execute()

func FormatExamples

func FormatExamples(examples ...string) string

FormatExamples builds a colored example block for cobra commands. Lines starting with "#" are rendered as gray comments. All other lines are rendered as cyan commands.

func GetBanner

func GetBanner() string

func GetDiscoveryBanner

func GetDiscoveryBanner() string

GetDiscoveryBanner returns the banner crediting the discovery/spidering co-author alongside the default author.

func GetOliumBanner

func GetOliumBanner() string

GetOliumBanner returns the startup banner for the olium agent CLI. Uses a cooler palette (cyan body + magenta eye) to distinguish it from the scanner banner at a glance.

func MachineContractCommands added in v0.5.3

func MachineContractCommands() map[string]string

MachineContractCommands returns every runnable command path (without the root name; "" is the root) and the kind of -j output it declares: read, mutation, scan, stream or interactive.

It is a view of commandTraits (command_traits.go), which TestMachineContractCobraTree keeps equal to the runnable command tree. Exported for the runtime smoke matrix (test/e2e/machine_contract_e2e_test.go), which must cover every leaf and cannot reach the cobra tree from outside the package.

func ReadOnlyDocExample added in v0.5.7

func ReadOnlyDocExample(argv []string) (path, why string)

ReadOnlyDocExample resolves a documented argv (doclex.Command.Argv) to its command and reports whether it can be run against a seeded store with nothing on the wire: commandTraits declares the command a read that opens the store for reading and sends no traffic, and no flag in the invocation changes that. why says why not.

func ShapedCommands added in v0.5.7

func ShapedCommands() map[string]string

ShapedCommands returns every command whose -j document can be narrowed with --fields, and its shape: "rows" or "object". The e2e contract matrix runs each with an unknown --fields name and expects a usage error (exit 2).

Types

type Liveness added in v0.5.3

type Liveness struct {
	// LastWriteAt is the newest write across every signal; zero when there is
	// none.
	LastWriteAt time.Time
	// Sources names the signals that were present, newest-first is not implied.
	Sources []string
	// Stale: no signal has advanced within livenessStaleAfter, or the writing
	// process is confirmed gone. Only meaningful for a session whose status is
	// still "running".
	Stale bool
	// ProcessGone is set when the runner's PID could be checked — it ran on this
	// host — and says whether that process has exited. Nil when it could not be
	// checked (another host, or no PID recorded).
	ProcessGone *bool
}

Liveness is what every reader that asks "is this session still running?" gets: the newest write any signal shows, which signals contributed, and the verdict.

type ResolvedInput

type ResolvedInput struct {
	Target    string // resolved target URL
	InputData string // raw input data (may be empty)
}

ResolvedInput holds the result of resolving raw input and target from CLI flags/stdin.

Source Files

Directories

Path Synopsis
Package configcmd implements the `vigolium config` command group.
Package configcmd implements the `vigolium config` command group.
internal
clicommon
Package clicommon holds shared, leaf-level helpers used across the vigolium CLI command tree: the database-connection cache, project resolution, the --watch loop, logger flushing, and display formatting.
Package clicommon holds shared, leaf-level helpers used across the vigolium CLI command tree: the database-connection cache, project resolution, the --watch loop, logger flushing, and display formatting.
Package tui provides a reusable list picker for CLI list subcommands.
Package tui provides a reusable list picker for CLI list subcommands.

Jump to

Keyboard shortcuts

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