cli

package
v1.11.6 Latest Latest
Warning

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

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 6 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Command               string // "", "install", "uninstall", "send-telemetry", "configure", "configure show", "hooks install", "hooks uninstall"
	OutputFormat          string // "pretty", "json", "html"
	OutputFormatSet       bool   // true if --pretty/--json/--html was explicitly passed (not persisted)
	HTMLOutputFile        string // set by --html (not persisted)
	ColorMode             string // "auto", "always", "never"
	Verbose               bool   // --verbose (shortcut for --log-level=debug)
	LogLevel              string // "" = unset; one of "error", "warn", "info", "debug"
	InstallDir            string // --install-dir=DIR base install directory; all non-bootstrap files (logs, hook errors, binary placement) live under this dir. "" w/ InstallDirSet=true means "explicitly disabled" (no file logging).
	InstallDirSet         bool   // true if --install-dir was passed (empty value = disable file logging for this run)
	EnableNPMScan         *bool  // nil=auto, true/false=explicit
	EnableBrewScan        *bool  // nil=auto, true/false=explicit
	EnablePythonScan      *bool  // nil=auto, true/false=explicit
	IncludeBundledPlugins bool   // --include-bundled-plugins: include bundled/platform plugins in output
	// IncludeTCCProtected is tristate: nil or false = skip the macOS
	// TCC-protected dirs (Documents, Downloads, ~/Library/Mail, ...)
	// so the agent never triggers permission prompts; true = scan them.
	// Customers who have granted the agent Full Disk Access (e.g., via
	// an MDM-pushed PPPC profile) flip this to true to opt back into
	// full scan coverage. See docs/macos-tcc-permissions.md.
	IncludeTCCProtected *bool
	NPMRCOnly           bool     // --npmrc: run only the npmrc audit and render verbose pretty output
	PipConfigOnly       bool     // --pipconfig: run only the pip config audit and render verbose pretty output
	SearchDirs          []string // defaults to ["$HOME"]

	// HooksAgent is the --agent value on `hooks install` / `hooks uninstall`;
	// "" means "every detected agent".
	HooksAgent string

	// Non-interactive `configure` inputs. Used by MSI/SCCM and other
	// orchestrators that can't drive a stdin prompt loop. NonInteractive
	// is implied when any of ConfigFromFile / ConfigCustomerID /
	// ConfigAPIEndpoint / ConfigAPIKey / ConfigScanFrequency is set,
	// and main.go routes accordingly.
	NonInteractive      bool
	ConfigFromFile      string // --from-file: read full config JSON from path
	ConfigCustomerID    string // --customer-id
	ConfigAPIEndpoint   string // --api-endpoint
	ConfigAPIKey        string // --api-key (also accepts env var DMG_API_KEY)
	ConfigScanFrequency string // --scan-frequency (hours)

	// IgnoreTelemetryError opts the `install` subcommand into treating an
	// initial-telemetry POST failure as a warning rather than a fatal exit.
	// Default behavior (flag absent) preserves dev-workflow ergonomics —
	// a failed first telemetry surfaces misconfigurations immediately. MSI
	// custom actions and other unattended orchestrators set this so a
	// transient network hiccup doesn't roll back the whole install.
	IgnoreTelemetryError bool

	// OverrideGate disables feature gating for this invocation, letting
	// every capability run regardless of the featuregate allowlist.
	// Internal — not advertised in --help. Equivalent env var:
	// STEPSECURITY_OVERRIDE_GATE=1.
	OverrideGate bool
}

Config holds all parsed CLI flags.

The hidden `_hook` runtime is intentionally NOT represented here. Agents invoke `_hook` on every event and any non-zero exit is treated as a hook failure, so the hot path bypasses cli.Parse entirely — see main.go's early-return and internal/aiagents/cli.RunHook.

func Parse

func Parse(args []string) (*Config, error)

Parse parses CLI arguments and returns a Config.

Jump to

Keyboard shortcuts

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