cmd

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2026 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

Package cmd provides the command-line interface for the vulners-cli.

Index

Constants

View Source
const (
	ExitOK       = model.ExitOK
	ExitFindings = model.ExitFindings
)

Re-export exit codes for use by main.go.

View Source
const ExitRuntimeError = model.ExitRuntimeError

Variables

View Source
var (
	Version = "dev"
	Commit  = "none"
	Date    = "unknown"
)

Set via ldflags at build time.

Functions

This section is empty.

Types

type AuditCmd

type AuditCmd struct {
	Linux    LinuxAuditCmd   `cmd:"" help:"Audit Linux packages"`
	Windows  WindowsAuditCmd `cmd:"" help:"Audit Windows KB updates"`
	Host     HostAuditCmd    `cmd:"" help:"Audit host packages (v4 API)"`
	Winaudit WinFullAuditCmd `cmd:"" name:"winaudit" help:"Full Windows audit (KBs + software)"`
}

AuditCmd is the command group for OS package auditing.

type AutocompleteCmd added in v1.2.0

type AutocompleteCmd struct {
	Query string `arg:"" help:"Partial query to autocomplete"`
}

AutocompleteCmd returns query suggestions for a partial Vulners search query.

func (*AutocompleteCmd) Run added in v1.2.0

func (c *AutocompleteCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type CLI

type CLI struct {
	// Global flags
	Output      string   `` /* 131-byte string literal not displayed */
	Quiet       bool     `help:"Suppress non-error output" short:"q"`
	Verbose     bool     `help:"Enable verbose/debug output" short:"v"`
	Offline     bool     `help:"Use offline database only"`
	Agent       bool     `help:"Machine-friendly mode: JSON output, quiet, deterministic ordering, no color"`
	NoColor     bool     `help:"Disable colored log output" name:"no-color"`
	OutputFile  string   `help:"Write output to file instead of stdout" name:"output-file" type:"path"`
	MaxFindings int      `help:"Maximum findings to include in output (0 = unlimited)" default:"0" name:"max-findings"`
	SummaryOnly bool     `help:"Output summary and top findings only (omit full lists)" name:"summary-only"`
	FailOn      string   `help:"Fail with exit code 1 if findings at or above severity (low, medium, high, critical)" default:""`
	Ignore      []string `help:"CVE IDs to ignore"`
	VEX         string   `help:"Path to OpenVEX document for suppression"`
	Fields      []string `help:"Select top-level JSON fields to include in output (JSON only)" name:"fields"`
	Plan        bool     `help:"Show what a scan would do without executing it" name:"plan"`

	// Commands
	Version      VersionCmd      `cmd:"" help:"Print version information"`
	Search       SearchCmd       `cmd:"" help:"Search Vulners database"`
	CVE          CVECmd          `cmd:"" name:"cve" help:"Look up a CVE by ID"`
	CPE          CPECmd          `cmd:"" name:"cpe" help:"Search by CPE"`
	Audit        AuditCmd        `cmd:"" help:"Audit OS packages"`
	Scan         ScanCmd         `cmd:"" help:"Scan targets for vulnerabilities"`
	Offline_     OfflineCmd      `cmd:"" name:"offline" help:"Manage offline database"`
	STIX         StixCmd         `cmd:"" name:"stix" help:"Export STIX bundle for a bulletin or CVE"`
	Autocomplete AutocompleteCmd `cmd:"" help:"Autocomplete a Vulners search query"`
	Suggest      SuggestCmd      `cmd:"" help:"Get field value suggestions for search queries"`
	Doctor       DoctorCmd       `cmd:"" help:"Run environment health checks"`
	Spec         SpecCmd         `cmd:"" help:"Output machine-readable command and flag definitions"`
	Report       ReportCmd       `cmd:"" help:"Account-level vulnerability reports"`
	Webhook      WebhookCmd      `cmd:"" help:"Manage search query webhooks"`
	Subscription SubscriptionCmd `cmd:"" help:"Manage alert subscriptions"`
	VScan        VScanCmd        `cmd:"" name:"vscan" help:"Manage VScanner remote vulnerability scans"`
	MCP          MCPCmd          `cmd:"" name:"mcp" help:"Run as MCP (Model Context Protocol) server"`
}

CLI is the root Kong command structure.

type CPECmd

type CPECmd struct {
	Product string `arg:"" help:"Product name to search"`
	Vendor  string `help:"Vendor name" default:""`
	Limit   int    `help:"Maximum results to return" default:"10"`
}

CPECmd searches by CPE.

func (*CPECmd) Run

func (c *CPECmd) Run(ctx context.Context, globals *CLI, deps *Deps, store cache.Store) error

type CVECmd

type CVECmd struct {
	ID         string `arg:"" help:"CVE identifier (e.g. CVE-2021-44228)"`
	References bool   `help:"Include external references"`
	History    bool   `help:"Include change history"`
}

CVECmd looks up a CVE by ID.

func (*CVECmd) Run

func (c *CVECmd) Run(ctx context.Context, globals *CLI, deps *Deps, store cache.Store) error

type CVEOutput

type CVEOutput struct {
	Bulletin   *vulners.Bulletin      `json:"bulletin"`
	References []string               `json:"references,omitempty"`
	History    []vulners.HistoryEntry `json:"history,omitempty"`
}

CVEOutput wraps bulletin data with optional references and history.

type CheckResult added in v1.2.0

type CheckResult struct {
	Name        string `json:"name"`
	Status      string `json:"status"` // "pass", "fail", "warn"
	Message     string `json:"message,omitempty"`
	Remediation string `json:"remediation,omitempty"`
}

CheckResult is the result of a single health check.

type Deps

type Deps struct {
	Intel    intel.Client
	VScanner intel.VScannerClient
}

Deps holds shared dependencies injected into commands.

type DistroMeta added in v1.2.0

type DistroMeta struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

DistroMeta is the JSON-friendly distro info for scan output.

type DoctorCmd added in v1.2.0

type DoctorCmd struct{}

DoctorCmd runs environment health checks.

func (*DoctorCmd) Run added in v1.2.0

func (c *DoctorCmd) Run(ctx context.Context, globals *CLI, deps *Deps, store cache.Store) error

type DoctorOutput added in v1.2.0

type DoctorOutput struct {
	Checks  []CheckResult `json:"checks"`
	AllPass bool          `json:"allPass"`
}

DoctorOutput is the output of the doctor command.

type HostAuditCmd

type HostAuditCmd struct {
	OS       string   `help:"Operating system name (e.g. ubuntu, centos)" required:""`
	Version  string   `help:"OS version (e.g. 22.04, 8)" required:""`
	Packages []string `help:"Packages in 'name version' format" required:""`
}

HostAuditCmd audits host packages using the v4 Host audit API.

func (*HostAuditCmd) Run

func (c *HostAuditCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type ImageMeta added in v1.2.0

type ImageMeta struct {
	Distro      *DistroMeta `json:"distro,omitempty"`
	OSPackages  int         `json:"osPackages"`
	AppPackages int         `json:"appPackages"`
	AuditMode   string      `json:"auditMode"` // "hybrid", "sbom", "offline"
}

ImageMeta provides image-specific context in scan output.

type IntelOutput added in v1.2.0

type IntelOutput struct {
	SchemaVersion string `json:"schemaVersion"`
	Command       string `json:"command"`
	Data          any    `json:"data"`
	Meta          any    `json:"meta,omitempty"`
}

IntelOutput is the standard JSON envelope for intel/audit commands.

type LinuxAuditCmd

type LinuxAuditCmd struct {
	Distro  string   `help:"Linux distribution name (e.g. ubuntu, debian, centos)" required:""`
	Version string   `help:"Distribution version (e.g. 22.04)" required:""`
	Pkg     []string `help:"Package as name=version or 'name version arch'. Deb-based distros require arch (auto-detected if omitted)." required:""`
	Arch    string   `help:"Default architecture to append when not specified in --pkg (e.g. amd64)" default:""`
}

LinuxAuditCmd audits Linux distribution packages.

func (*LinuxAuditCmd) Run

func (c *LinuxAuditCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type MCPCmd added in v1.2.0

type MCPCmd struct{}

MCPCmd runs vulners-cli as an MCP (Model Context Protocol) server.

func (*MCPCmd) Run added in v1.2.0

func (c *MCPCmd) Run(ctx context.Context, deps *Deps, store cache.Store, logger *slog.Logger) error

type OfflineCmd

type OfflineCmd struct {
	Sync   OfflineSyncCmd   `cmd:"" help:"Sync vulnerability data for offline use"`
	Status OfflineStatusCmd `cmd:"" help:"Show offline database status"`
	Purge  OfflinePurgeCmd  `cmd:"" help:"Purge offline database"`
}

OfflineCmd is the command group for offline mode management.

type OfflinePurgeCmd

type OfflinePurgeCmd struct{}

OfflinePurgeCmd clears the offline database.

func (*OfflinePurgeCmd) Run

func (c *OfflinePurgeCmd) Run(ctx context.Context, store cache.Store, logger *slog.Logger) error

type OfflineStatusCmd

type OfflineStatusCmd struct{}

OfflineStatusCmd shows offline database status.

func (*OfflineStatusCmd) Run

func (c *OfflineStatusCmd) Run(ctx context.Context, globals *CLI, store cache.Store) error

type OfflineSyncCmd

type OfflineSyncCmd struct {
	Collections []string `help:"Collections to sync (e.g. cve,exploit,debian)" default:"cve"`
	Full        bool     `help:"Force full sync even if recent data exists"`
}

OfflineSyncCmd syncs vulnerability data for offline use.

func (*OfflineSyncCmd) Run

func (c *OfflineSyncCmd) Run(ctx context.Context, globals *CLI, deps *Deps, store cache.Store, logger *slog.Logger) error

type PlanOutput added in v1.2.0

type PlanOutput struct {
	Target         string            `json:"target"`
	Mode           string            `json:"mode"` // "online" or "offline"
	ComponentCount int               `json:"componentCount"`
	Ecosystems     map[string]int    `json:"ecosystems"`
	HasAPIKey      bool              `json:"hasApiKey"`
	Components     []model.Component `json:"components,omitempty"`
}

PlanOutput describes what a scan would do without executing it.

type ReportCmd added in v1.2.0

type ReportCmd struct {
	Summary ReportSummaryCmd `cmd:"" help:"Aggregated vulnerability summary"`
	Vulns   ReportVulnsCmd   `cmd:"" help:"List known vulnerabilities"`
	Hosts   ReportHostsCmd   `cmd:"" help:"Host vulnerability status"`
	Scans   ReportScansCmd   `cmd:"" help:"Scan history"`
	IPs     ReportIPsCmd     `cmd:"" name:"ips" help:"IP-level vulnerability summary"`
}

ReportCmd is the parent command for account-level reports.

type ReportHostsCmd added in v1.2.0

type ReportHostsCmd struct {
	Limit  int `help:"Maximum results" default:"100"`
	Offset int `help:"Result offset" default:"0"`
}

ReportHostsCmd returns host vulnerability status.

func (*ReportHostsCmd) Run added in v1.2.0

func (c *ReportHostsCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type ReportIPsCmd added in v1.2.0

type ReportIPsCmd struct{}

ReportIPsCmd returns IP-level vulnerability summary.

func (*ReportIPsCmd) Run added in v1.2.0

func (c *ReportIPsCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type ReportScansCmd added in v1.2.0

type ReportScansCmd struct {
	Limit  int `help:"Maximum results" default:"100"`
	Offset int `help:"Result offset" default:"0"`
}

ReportScansCmd lists scan history.

func (*ReportScansCmd) Run added in v1.2.0

func (c *ReportScansCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type ReportSummaryCmd added in v1.2.0

type ReportSummaryCmd struct {
	Limit  int `help:"Maximum results" default:"100"`
	Offset int `help:"Result offset" default:"0"`
}

ReportSummaryCmd returns an aggregated vulnerability summary.

func (*ReportSummaryCmd) Run added in v1.2.0

func (c *ReportSummaryCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type ReportVulnsCmd added in v1.2.0

type ReportVulnsCmd struct {
	Limit  int `help:"Maximum results" default:"100"`
	Offset int `help:"Result offset" default:"0"`
}

ReportVulnsCmd lists known vulnerabilities.

func (*ReportVulnsCmd) Run added in v1.2.0

func (c *ReportVulnsCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type ScanCmd

type ScanCmd struct {
	Repo  ScanRepoCmd  `cmd:"" help:"Scan a repository for vulnerabilities"`
	SBOM  ScanSBOMCmd  `cmd:"" name:"sbom" help:"Scan an SBOM file"`
	Image ScanImageCmd `cmd:"" help:"Scan a container image"`
	Dir   ScanDirCmd   `cmd:"" help:"Scan a directory for package manifests"`
}

ScanCmd is the command group for scanning targets.

type ScanDirCmd

type ScanDirCmd struct {
	Path string `arg:"" help:"Directory path to scan" default:"."`
}

ScanDirCmd scans a directory for package manifests and finds vulnerabilities.

func (*ScanDirCmd) Run

func (c *ScanDirCmd) Run(ctx context.Context, globals *CLI, deps *Deps, store cache.Store, logger *slog.Logger) error

type ScanImageCmd

type ScanImageCmd struct {
	Image  string `arg:"" help:"Image reference (e.g. alpine:3.18, ./image.tar)"`
	Distro string `help:"Override auto-detected distro (format: name/version, e.g. alpine/3.18)" name:"distro" default:""`
}

ScanImageCmd scans a container image and generates an SBOM.

func (*ScanImageCmd) Run

func (c *ScanImageCmd) Run(ctx context.Context, globals *CLI, deps *Deps, store cache.Store, logger *slog.Logger) error

type ScanOutput

type ScanOutput struct {
	SchemaVersion string            `json:"schemaVersion"`
	Target        string            `json:"target"`
	Components    []model.Component `json:"components"`
	Findings      []model.Finding   `json:"findings"`
	Summary       ScanSummary       `json:"summary"`
	TopFindings   []model.Finding   `json:"topFindings,omitempty"`
	Truncated     bool              `json:"truncated,omitempty"`
	TotalFindings int               `json:"totalFindings,omitempty"`
	ImageMeta     *ImageMeta        `json:"imageMeta,omitempty"`
}

ScanOutput is the structured output for scan commands.

type ScanRepoCmd

type ScanRepoCmd struct {
	Path string `arg:"" help:"Path to repository" default:"."`
}

ScanRepoCmd scans a repository for vulnerabilities.

func (*ScanRepoCmd) Run

func (c *ScanRepoCmd) Run(ctx context.Context, globals *CLI, deps *Deps, store cache.Store, logger *slog.Logger) error

type ScanSBOMCmd

type ScanSBOMCmd struct {
	File   string `arg:"" help:"Path to SBOM file"`
	Format string `help:"SBOM format (cyclonedx, spdx)" enum:"cyclonedx,spdx" default:"cyclonedx"`
}

ScanSBOMCmd scans an SBOM file for vulnerabilities.

func (*ScanSBOMCmd) Run

func (c *ScanSBOMCmd) Run(ctx context.Context, globals *CLI, deps *Deps, store cache.Store, logger *slog.Logger) error

type ScanSummary

type ScanSummary struct {
	ComponentCount int `json:"componentCount"`
	FindingCount   int `json:"findingCount"`
	Critical       int `json:"critical"`
	High           int `json:"high"`
	Medium         int `json:"medium"`
	Low            int `json:"low"`
	ExploitedCount int `json:"exploitedCount,omitempty"`
	HighEPSSCount  int `json:"highEpssCount,omitempty"`
}

ScanSummary summarizes scan results.

type SearchCmd

type SearchCmd struct {
	Query    string `arg:"" help:"Lucene search query"`
	Limit    int    `help:"Maximum results to return" default:"10"`
	Offset   int    `help:"Result offset for pagination" default:"0"`
	Exploits bool   `help:"Search exploits only"`
}

SearchCmd searches the Vulners database.

func (*SearchCmd) Run

func (c *SearchCmd) Run(ctx context.Context, globals *CLI, deps *Deps, store cache.Store) error

type SpecArg added in v1.2.0

type SpecArg struct {
	Name     string `json:"name"`
	Help     string `json:"help,omitempty"`
	Required bool   `json:"required,omitempty"`
}

SpecArg describes a positional argument.

type SpecCmd added in v1.2.0

type SpecCmd struct {
	Schema string `help:"Generate JSON Schema for a command's output (use 'list' to see available)" name:"schema" default:""`
}

SpecCmd outputs machine-readable command/flag definitions.

func (*SpecCmd) Run added in v1.2.0

func (c *SpecCmd) Run(globals *CLI, k *kong.Kong) error

type SpecCommand added in v1.2.0

type SpecCommand struct {
	Name     string        `json:"name"`
	Help     string        `json:"help,omitempty"`
	Aliases  []string      `json:"aliases,omitempty"`
	Hidden   bool          `json:"hidden,omitempty"`
	Flags    []SpecFlag    `json:"flags,omitempty"`
	Args     []SpecArg     `json:"args,omitempty"`
	Commands []SpecCommand `json:"commands,omitempty"`
}

SpecCommand describes a CLI command.

type SpecFlag added in v1.2.0

type SpecFlag struct {
	Name     string `json:"name"`
	Help     string `json:"help,omitempty"`
	Type     string `json:"type,omitempty"`
	Default  string `json:"default,omitempty"`
	Enum     string `json:"enum,omitempty"`
	Required bool   `json:"required,omitempty"`
	Short    string `json:"short,omitempty"`
	Hidden   bool   `json:"hidden,omitempty"`
}

SpecFlag describes a CLI flag.

type SpecOutput added in v1.2.0

type SpecOutput struct {
	Commands []SpecCommand `json:"commands"`
	Globals  []SpecFlag    `json:"globals"`
}

SpecOutput is the top-level JSON output of the spec command.

type StixCmd

type StixCmd struct {
	ID    string `arg:"" help:"Bulletin or CVE identifier"`
	ByCVE bool   `help:"Look up by CVE ID instead of bulletin ID"`
}

StixCmd exports STIX bundles from Vulners.

func (*StixCmd) Run

func (c *StixCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type SubscriptionCmd added in v1.2.0

type SubscriptionCmd struct {
	List    SubscriptionListCmd    `cmd:"" help:"List all subscriptions"`
	Get     SubscriptionGetCmd     `cmd:"" help:"Get a subscription by ID"`
	Create  SubscriptionCreateCmd  `cmd:"" help:"Create a new subscription"`
	Update  SubscriptionUpdateCmd  `cmd:"" help:"Update an existing subscription"`
	Delete  SubscriptionDeleteCmd  `cmd:"" help:"Delete a subscription"`
	Enable  SubscriptionEnableCmd  `cmd:"" help:"Enable a subscription"`
	Disable SubscriptionDisableCmd `cmd:"" help:"Disable a subscription"`
}

SubscriptionCmd is the parent command for subscription management.

type SubscriptionCreateCmd added in v1.2.0

type SubscriptionCreateCmd struct {
	Name   string `help:"Subscription name" required:""`
	Type   string `help:"Subscription type" required:""`
	Query  string `help:"Search query" required:""`
	Config string `help:"JSON config string" default:""`
}

func (*SubscriptionCreateCmd) Run added in v1.2.0

func (c *SubscriptionCreateCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type SubscriptionDeleteCmd added in v1.2.0

type SubscriptionDeleteCmd struct {
	ID string `arg:"" help:"Subscription ID"`
}

func (*SubscriptionDeleteCmd) Run added in v1.2.0

func (c *SubscriptionDeleteCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type SubscriptionDisableCmd added in v1.2.0

type SubscriptionDisableCmd struct {
	ID string `arg:"" help:"Subscription ID"`
}

func (*SubscriptionDisableCmd) Run added in v1.2.0

func (c *SubscriptionDisableCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type SubscriptionEnableCmd added in v1.2.0

type SubscriptionEnableCmd struct {
	ID string `arg:"" help:"Subscription ID"`
}

func (*SubscriptionEnableCmd) Run added in v1.2.0

func (c *SubscriptionEnableCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type SubscriptionGetCmd added in v1.2.0

type SubscriptionGetCmd struct {
	ID string `arg:"" help:"Subscription ID"`
}

func (*SubscriptionGetCmd) Run added in v1.2.0

func (c *SubscriptionGetCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type SubscriptionListCmd added in v1.2.0

type SubscriptionListCmd struct{}

func (*SubscriptionListCmd) Run added in v1.2.0

func (c *SubscriptionListCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type SubscriptionUpdateCmd added in v1.2.0

type SubscriptionUpdateCmd struct {
	ID     string `arg:"" help:"Subscription ID"`
	Name   string `help:"Subscription name"`
	Type   string `help:"Subscription type"`
	Query  string `help:"Search query"`
	Config string `help:"JSON config string"`
}

func (*SubscriptionUpdateCmd) Run added in v1.2.0

func (c *SubscriptionUpdateCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type SuggestCmd added in v1.2.0

type SuggestCmd struct {
	Field string `arg:"" help:"Field name to get suggestions for (e.g. type, bulletinFamily)"`
}

SuggestCmd returns valid field values for structured Vulners search queries.

func (*SuggestCmd) Run added in v1.2.0

func (c *SuggestCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanCmd added in v1.2.0

type VScanCmd struct {
	Project VScanProjectCmd `cmd:"" help:"Manage VScanner projects"`
	Task    VScanTaskCmd    `cmd:"" help:"Manage VScanner scan tasks"`
	Result  VScanResultCmd  `cmd:"" help:"Access VScanner scan results"`
	License VScanLicenseCmd `cmd:"" help:"Show VScanner license information"`
}

VScanCmd is the parent command for VScanner operations.

type VScanLicenseCmd added in v1.2.0

type VScanLicenseCmd struct{}

func (*VScanLicenseCmd) Run added in v1.2.0

func (c *VScanLicenseCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanProjectCmd added in v1.2.0

type VScanProjectCmd struct {
	List   VScanProjectListCmd   `cmd:"" help:"List all projects"`
	Get    VScanProjectGetCmd    `cmd:"" help:"Get a project by ID"`
	Create VScanProjectCreateCmd `cmd:"" help:"Create a new project"`
	Update VScanProjectUpdateCmd `cmd:"" help:"Update a project"`
	Delete VScanProjectDeleteCmd `cmd:"" help:"Delete a project"`
}

type VScanProjectCreateCmd added in v1.2.0

type VScanProjectCreateCmd struct {
	Name        string `help:"Project name" required:""`
	Description string `help:"Project description" default:""`
	License     string `help:"License ID to use" default:""`
}

func (*VScanProjectCreateCmd) Run added in v1.2.0

func (c *VScanProjectCreateCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanProjectDeleteCmd added in v1.2.0

type VScanProjectDeleteCmd struct {
	ID string `arg:"" help:"Project ID"`
}

func (*VScanProjectDeleteCmd) Run added in v1.2.0

func (c *VScanProjectDeleteCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanProjectGetCmd added in v1.2.0

type VScanProjectGetCmd struct {
	ID string `arg:"" help:"Project ID"`
}

func (*VScanProjectGetCmd) Run added in v1.2.0

func (c *VScanProjectGetCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanProjectListCmd added in v1.2.0

type VScanProjectListCmd struct {
	Limit  int `help:"Maximum items to return" default:"100"`
	Offset int `help:"Pagination offset" default:"0"`
}

func (*VScanProjectListCmd) Run added in v1.2.0

func (c *VScanProjectListCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanProjectUpdateCmd added in v1.2.0

type VScanProjectUpdateCmd struct {
	ID          string `arg:"" help:"Project ID"`
	Name        string `help:"Project name" required:""`
	Description string `help:"Project description" default:""`
}

func (*VScanProjectUpdateCmd) Run added in v1.2.0

func (c *VScanProjectUpdateCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanResultCmd added in v1.2.0

type VScanResultCmd struct {
	List   VScanResultListCmd   `cmd:"" help:"List scan results for a project"`
	Get    VScanResultGetCmd    `cmd:"" help:"Get a scan result"`
	Stats  VScanResultStatsCmd  `cmd:"" help:"Get statistics for a scan result"`
	Hosts  VScanResultHostsCmd  `cmd:"" help:"List hosts from a scan result"`
	Host   VScanResultHostCmd   `cmd:"" help:"Get detailed host information"`
	Vulns  VScanResultVulnsCmd  `cmd:"" help:"List vulnerabilities from a scan result"`
	Delete VScanResultDeleteCmd `cmd:"" help:"Delete a scan result"`
	Export VScanResultExportCmd `cmd:"" help:"Export a scan result"`
}

type VScanResultDeleteCmd added in v1.2.0

type VScanResultDeleteCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	ResultID  string `arg:"" help:"Result ID"`
}

func (*VScanResultDeleteCmd) Run added in v1.2.0

func (c *VScanResultDeleteCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanResultExportCmd added in v1.2.0

type VScanResultExportCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	ResultID  string `arg:"" help:"Result ID"`
	Format    string `help:"Export format" enum:"pdf,csv,json,xml" default:"json" name:"format"`
}

func (*VScanResultExportCmd) Run added in v1.2.0

func (c *VScanResultExportCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanResultGetCmd added in v1.2.0

type VScanResultGetCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	ResultID  string `arg:"" help:"Result ID"`
}

func (*VScanResultGetCmd) Run added in v1.2.0

func (c *VScanResultGetCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanResultHostCmd added in v1.2.0

type VScanResultHostCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	ResultID  string `arg:"" help:"Result ID"`
	Host      string `arg:"" help:"Host identifier or IP"`
}

func (*VScanResultHostCmd) Run added in v1.2.0

func (c *VScanResultHostCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanResultHostsCmd added in v1.2.0

type VScanResultHostsCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	ResultID  string `arg:"" help:"Result ID"`
	Limit     int    `help:"Maximum items to return" default:"100"`
	Offset    int    `help:"Pagination offset" default:"0"`
}

func (*VScanResultHostsCmd) Run added in v1.2.0

func (c *VScanResultHostsCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanResultListCmd added in v1.2.0

type VScanResultListCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	Limit     int    `help:"Maximum items to return" default:"100"`
	Offset    int    `help:"Pagination offset" default:"0"`
}

func (*VScanResultListCmd) Run added in v1.2.0

func (c *VScanResultListCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanResultStatsCmd added in v1.2.0

type VScanResultStatsCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	ResultID  string `arg:"" help:"Result ID"`
}

func (*VScanResultStatsCmd) Run added in v1.2.0

func (c *VScanResultStatsCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanResultVulnsCmd added in v1.2.0

type VScanResultVulnsCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	ResultID  string `arg:"" help:"Result ID"`
	Limit     int    `help:"Maximum items to return" default:"100"`
	Offset    int    `help:"Pagination offset" default:"0"`
}

func (*VScanResultVulnsCmd) Run added in v1.2.0

func (c *VScanResultVulnsCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanTaskCmd added in v1.2.0

type VScanTaskCmd struct {
	List   VScanTaskListCmd   `cmd:"" help:"List tasks in a project"`
	Get    VScanTaskGetCmd    `cmd:"" help:"Get a task by ID"`
	Create VScanTaskCreateCmd `cmd:"" help:"Create a scan task"`
	Update VScanTaskUpdateCmd `cmd:"" help:"Update a scan task"`
	Start  VScanTaskStartCmd  `cmd:"" help:"Start a scan task"`
	Stop   VScanTaskStopCmd   `cmd:"" help:"Stop a running scan task"`
	Delete VScanTaskDeleteCmd `cmd:"" help:"Delete a scan task"`
}

type VScanTaskCreateCmd added in v1.2.0

type VScanTaskCreateCmd struct {
	ProjectID      string   `arg:"" help:"Project ID"`
	Name           string   `help:"Task name" required:""`
	Description    string   `help:"Task description" default:""`
	Targets        []string `help:"Scan targets (IPs, hostnames, CIDR ranges)" required:""`
	ScanType       string   `help:"Scan type" enum:"fast,normal,full" default:"normal" name:"scan-type"`
	Ports          string   `help:"Port range or list (e.g. 1-1000, 22,80,443)" default:""`
	MaxConcurrency int      `help:"Maximum concurrent scan threads" default:"0" name:"max-concurrency"`
}

func (*VScanTaskCreateCmd) Run added in v1.2.0

func (c *VScanTaskCreateCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanTaskDeleteCmd added in v1.2.0

type VScanTaskDeleteCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	TaskID    string `arg:"" help:"Task ID"`
}

func (*VScanTaskDeleteCmd) Run added in v1.2.0

func (c *VScanTaskDeleteCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanTaskGetCmd added in v1.2.0

type VScanTaskGetCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	TaskID    string `arg:"" help:"Task ID"`
}

func (*VScanTaskGetCmd) Run added in v1.2.0

func (c *VScanTaskGetCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanTaskListCmd added in v1.2.0

type VScanTaskListCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	Limit     int    `help:"Maximum items to return" default:"100"`
	Offset    int    `help:"Pagination offset" default:"0"`
}

func (*VScanTaskListCmd) Run added in v1.2.0

func (c *VScanTaskListCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanTaskStartCmd added in v1.2.0

type VScanTaskStartCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	TaskID    string `arg:"" help:"Task ID"`
}

func (*VScanTaskStartCmd) Run added in v1.2.0

func (c *VScanTaskStartCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanTaskStopCmd added in v1.2.0

type VScanTaskStopCmd struct {
	ProjectID string `arg:"" help:"Project ID"`
	TaskID    string `arg:"" help:"Task ID"`
}

func (*VScanTaskStopCmd) Run added in v1.2.0

func (c *VScanTaskStopCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VScanTaskUpdateCmd added in v1.2.0

type VScanTaskUpdateCmd struct {
	ProjectID   string   `arg:"" help:"Project ID"`
	TaskID      string   `arg:"" help:"Task ID"`
	Name        string   `help:"Task name" required:""`
	Description string   `help:"Task description" default:""`
	Targets     []string `help:"Scan targets (IPs, hostnames, CIDR ranges)"`
}

func (*VScanTaskUpdateCmd) Run added in v1.2.0

func (c *VScanTaskUpdateCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type VersionCmd

type VersionCmd struct{}

VersionCmd prints version information.

func (*VersionCmd) Run

func (c *VersionCmd) Run(globals *CLI) error

Run executes the version command.

type VersionInfo

type VersionInfo struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	Date      string `json:"date"`
	GoVersion string `json:"goVersion"`
}

VersionInfo holds version metadata.

type WebhookAddCmd added in v1.2.0

type WebhookAddCmd struct {
	Query string `arg:"" help:"Search query for the webhook"`
}

func (*WebhookAddCmd) Run added in v1.2.0

func (c *WebhookAddCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type WebhookCmd added in v1.2.0

type WebhookCmd struct {
	List    WebhookListCmd    `cmd:"" help:"List all webhooks"`
	Add     WebhookAddCmd     `cmd:"" help:"Create a webhook for a search query"`
	Get     WebhookGetCmd     `cmd:"" help:"Get a webhook by ID"`
	Read    WebhookReadCmd    `cmd:"" help:"Read new data from a webhook"`
	Enable  WebhookEnableCmd  `cmd:"" help:"Enable a webhook"`
	Disable WebhookDisableCmd `cmd:"" help:"Disable a webhook"`
	Delete  WebhookDeleteCmd  `cmd:"" help:"Delete a webhook"`
}

WebhookCmd is the parent command for webhook management.

type WebhookDeleteCmd added in v1.2.0

type WebhookDeleteCmd struct {
	ID string `arg:"" help:"Webhook ID"`
}

func (*WebhookDeleteCmd) Run added in v1.2.0

func (c *WebhookDeleteCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type WebhookDisableCmd added in v1.2.0

type WebhookDisableCmd struct {
	ID string `arg:"" help:"Webhook ID"`
}

func (*WebhookDisableCmd) Run added in v1.2.0

func (c *WebhookDisableCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type WebhookEnableCmd added in v1.2.0

type WebhookEnableCmd struct {
	ID string `arg:"" help:"Webhook ID"`
}

func (*WebhookEnableCmd) Run added in v1.2.0

func (c *WebhookEnableCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type WebhookGetCmd added in v1.2.0

type WebhookGetCmd struct {
	ID string `arg:"" help:"Webhook ID"`
}

func (*WebhookGetCmd) Run added in v1.2.0

func (c *WebhookGetCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type WebhookListCmd added in v1.2.0

type WebhookListCmd struct{}

func (*WebhookListCmd) Run added in v1.2.0

func (c *WebhookListCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type WebhookReadCmd added in v1.2.0

type WebhookReadCmd struct {
	ID         string `arg:"" help:"Webhook ID"`
	NewestOnly bool   `help:"Only return data since last read" default:"true" name:"newest-only"`
}

func (*WebhookReadCmd) Run added in v1.2.0

func (c *WebhookReadCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type WinFullAuditCmd

type WinFullAuditCmd struct {
	OS       string   `help:"Windows version (e.g. 'Windows 10')" required:""`
	Version  string   `help:"OS build version" required:""`
	KB       []string `help:"Installed KB numbers"`
	Software []string `help:"Installed software in 'name version' format"`
}

WinFullAuditCmd audits Windows using the WinAudit API (KBs + software).

func (*WinFullAuditCmd) Run

func (c *WinFullAuditCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

type WindowsAuditCmd

type WindowsAuditCmd struct {
	OS string   `help:"Windows OS version (e.g. 'Windows 10')" default:"Windows 10"`
	KB []string `help:"Installed KB identifiers" required:""`
}

WindowsAuditCmd audits Windows KB updates.

func (*WindowsAuditCmd) Run

func (c *WindowsAuditCmd) Run(ctx context.Context, globals *CLI, deps *Deps) error

Jump to

Keyboard shortcuts

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