cli

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: May 16, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package cli assembles the kubesplaining cobra commands that drive the collect → analyze → report pipeline and its supporting utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCreateExclusionsCmd

func NewCreateExclusionsCmd() *cobra.Command

NewCreateExclusionsCmd returns the "create-exclusions-file" subcommand, which emits a starter exclusions YAML from a preset and can pre-populate system namespaces discovered in an existing snapshot.

func NewDiffCmd added in v1.1.0

func NewDiffCmd() *cobra.Command

NewDiffCmd returns the "diff" subcommand, which compares two findings JSON files emitted by `scan` (or anything that produces the same shape) and prints / writes a delta report classifying each finding as Added, Resolved, or Unchanged. The diff is keyed on Finding.ID, which the analyzer pipeline guarantees is deterministic across runs of the same cluster ("RULE:ns:name").

Output formats:

text     : default; summary headline + per-section bullet list
markdown : same content as text but with ## headings and tables
sarif    : SARIF 2.1.0 run containing only Added findings, with
           level=warning and a properties.delta marker so downstream
           tooling can distinguish a delta upload from a full scan

When --output-dir is set the rendered diff is written to <dir>/diff.{txt,md,sarif} instead of stdout. The diff command never re-runs analysis; it only reads the two JSON files it's pointed at.

func NewDownloadCmd

func NewDownloadCmd(build BuildInfo) *cobra.Command

NewDownloadCmd returns the "download" subcommand, which collects a live cluster snapshot and writes it to a JSON file for later offline analysis.

func NewReportCmd

func NewReportCmd() *cobra.Command

NewReportCmd returns the "report" subcommand, which regenerates HTML/JSON/CSV/SARIF artifacts from a previously produced findings JSON file without re-running analysis.

func NewRootCmd

func NewRootCmd(build BuildInfo) *cobra.Command

NewRootCmd builds the top-level kubesplaining command with all subcommands attached.

func NewScanCmd

func NewScanCmd(build BuildInfo) *cobra.Command

NewScanCmd returns the "scan" subcommand, which runs the full analyzer pipeline against either a live cluster or a previously collected snapshot and emits reports.

func NewScanResourceCmd

func NewScanResourceCmd() *cobra.Command

NewScanResourceCmd returns the "scan-resource" subcommand, which analyzes a single Kubernetes manifest file offline without requiring cluster access.

func NewVersionCmd

func NewVersionCmd(build BuildInfo) *cobra.Command

NewVersionCmd returns a command that prints embedded build information and exits.

Types

type BuildInfo

type BuildInfo struct {
	Version string
	Commit  string
	Date    string
}

BuildInfo carries the binary's version, git commit, and build date for the version and help output.

Jump to

Keyboard shortcuts

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