Documentation
¶
Overview ¶
Package cmd implements the CLI commands
Index ¶
- func CommandSchemaRegistry() map[string]CommandSchemas
- func Execute(ctx context.Context) error
- type CommandCapability
- type CommandSchemas
- type IssueEventHydrateError
- type IssueRemediation
- type IssueWithEvents
- type Page
- type ProblemDetail
- type ProblemSummary
- type ScanAgents
- type ScanCoverage
- type ScanCoverageSummary
- type ScanCoverageTarget
- type ScanCoverageUserRow
- type ScanReasoningLogs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandSchemaRegistry ¶ added in v1.3.0
func CommandSchemaRegistry() map[string]CommandSchemas
CommandSchemaRegistry returns the explicit allowlist mapping Cobra command paths to their input/output Go structs. New commands exposed to MCP must be added here so the Cobra-to-MCP surface stays reviewed rather than derived. scans watch is omitted: it blocks until the scan ends, which an MCP tool call cannot finish inside the tool budget. Models poll scans get instead.
Types ¶
type CommandCapability ¶ added in v1.3.0
type CommandCapability struct {
Path string `json:"path"`
Use string `json:"use"`
Short string `json:"short,omitempty"`
Aliases []string `json:"aliases,omitempty"`
HasSub bool `json:"hasSubcommands"`
HasFlags bool `json:"hasFlags"`
HasInSchema bool `json:"hasInputSchema"`
HasOutSchema bool `json:"hasOutputSchema"`
InputSchema *clischema.JSONSchema `json:"inputSchema,omitempty"`
OutputSchema *clischema.JSONSchema `json:"outputSchema,omitempty"`
InputSchemaCommand string `json:"inputSchemaCommand,omitempty"`
OutputSchemaCommand string `json:"outputSchemaCommand,omitempty"`
}
CommandCapability is the JSON-friendly view of one CLI command used by the `capabilities` command and consumed by the embedded MCP server to build its tool catalog.
func BuildCommandCapabilities ¶ added in v1.3.0
func BuildCommandCapabilities(root *cobra.Command, registry map[string]CommandSchemas) []CommandCapability
BuildCommandCapabilities walks the Cobra command tree and returns the materialized capability descriptors enriched with JSON schemas from the supplied registry. Consumed by both the `capabilities` command and the MCP server's tool catalog builder.
type CommandSchemas ¶ added in v1.3.0
CommandSchemas captures optional runtime zero-values for a command's input and output Go structs so JSON schemas can be generated and surfaced both in `capabilities` output and by the embedded MCP server.
type IssueEventHydrateError ¶ added in v1.3.3
IssueEventHydrateError captures a per-event hydration failure so partial success is observable rather than swallowed.
type IssueRemediation ¶
type IssueRemediation struct {
IssueID string `json:"issueId"`
Framework string `json:"framework"`
Remediation *string `json:"remediation,omitempty"`
RemediationFeedback *bool `json:"remediationFeedback,omitempty"`
Summary *string `json:"summary,omitempty"`
SummaryFeedback *bool `json:"summaryFeedback,omitempty"`
}
IssueRemediation is the stable CLI view of an issue's AI remediation and summary, returned by `issues remediation get`.
type IssueWithEvents ¶ added in v1.3.3
type IssueWithEvents struct {
Issue v3.GetIssue200Response `json:"issue"`
LatestEvents *[]v3.GetEvent200Response `json:"latestEvents,omitempty"`
LatestEventsTruncated *bool `json:"latestEventsTruncated,omitempty"`
EventErrors []IssueEventHydrateError `json:"eventErrors,omitempty"`
}
IssueWithEvents bundles an issue with its hydrated latest-scan events so the MCP/CLI can hand an AI agent the full context (including each event's Exchange) in a single tool call.
LatestEvents and LatestEventsTruncated are pointers so the JSON output can distinguish "field omitted by the API" (nil, key absent) from "no events" (empty slice) or "not truncated" (false). This mirrors the public API's optional wire contract — see `IssueDetailedSchema` in services/public-api.
type Page ¶
type Page[T any] struct { Items []T `json:"items" yaml:"items"` NextCursor string `json:"nextCursor" yaml:"nextCursor"` TotalCount int `json:"totalCount" yaml:"totalCount"` }
Page is the shape capabilities and MCP advertise for a paged list. MCP always requests one page, so the tool result is this object rather than the bare item slice a full CLI listing prints.
type ProblemDetail ¶ added in v0.5.0
type ProblemDetail struct {
AppID string
AppName string
ScanStatus string
Code string
Severity string
Message string
}
ProblemDetail represents detailed information about a specific problem
type ProblemSummary ¶ added in v0.5.0
ProblemSummary represents a summary of problems for an application
type ScanAgents ¶ added in v1.8.1
type ScanAgents struct {
ScanID string `json:"scanId"`
Agents []escape.AgentSummarized `json:"agents"`
}
ScanAgents lists AI pentest agents for a scan.
type ScanCoverage ¶ added in v1.8.11
type ScanCoverage struct {
ScanID string `json:"scanId"`
Complete bool `json:"complete"`
TotalCount int `json:"totalCount"`
MatchedCount int `json:"matchedCount"`
ReturnedCount int `json:"returnedCount"`
TargetsTruncated bool `json:"targetsTruncated"`
Guidance string `json:"guidance"`
ByType map[string]int `json:"byType"`
Overall ScanCoverageSummary `json:"overall"`
ByUser map[string]ScanCoverageSummary `json:"byUser"`
Targets []ScanCoverageTarget `json:"targets"`
}
ScanCoverage is the MCP-facing coverage payload.
type ScanCoverageSummary ¶
type ScanCoverageSummary struct {
Targets int `json:"targets"`
Statuses map[string]int `json:"statuses"`
OKExamples []string `json:"okExamples,omitempty"`
}
ScanCoverageSummary is status totals across the full scan, overall or for one user.
type ScanCoverageTarget ¶ added in v1.8.11
type ScanCoverageTarget struct {
ID string `json:"id"`
Type string `json:"type"`
Method string `json:"method,omitempty"`
Name string `json:"name"`
Coverage string `json:"coverage,omitempty"`
RequestCount int `json:"requestCount"`
CoverageByUser []ScanCoverageUserRow `json:"coverageByUser,omitempty"`
}
ScanCoverageTarget is a compact coverage row for MCP/CLI JSON.
type ScanCoverageUserRow ¶ added in v1.8.11
ScanCoverageUserRow is one scanner user's status on a target.
type ScanReasoningLogs ¶ added in v1.8.0
type ScanReasoningLogs struct {
ScanID string `json:"scanId"`
Summaries []v3.EventSummarized `json:"summaries"`
ListTruncated bool `json:"listTruncated,omitempty"`
Events []v3.GetEvent200Response `json:"events"`
EventsTruncated bool `json:"eventsTruncated,omitempty"`
EventErrors []IssueEventHydrateError `json:"eventErrors,omitempty"`
}
ScanReasoningLogs bundles AI agent reasoning and action events for a scan so MCP/CLI callers can inspect how an assessment unfolded in one tool call.
Source Files
¶
- ai_chats.go
- asm.go
- assets.go
- audit.go
- authentications.go
- beta.go
- capabilities.go
- compliance.go
- configmerge.go
- confirm.go
- continuous_pentest.go
- custom-rules.go
- emails.go
- events.go
- exports.go
- help-all.go
- input_schema.go
- integrations.go
- issues.go
- issues_remediation.go
- jobs.go
- knowledge_files.go
- locations.go
- mcp.go
- org_settings.go
- page.go
- permissions.go
- problems.go
- profiles.go
- projects.go
- regression_tests.go
- retests.go
- roles.go
- root.go
- scans.go
- scans_agents.go
- scans_coverage.go
- scans_reasoning.go
- security_tests.go
- statistics.go
- stats.go
- stdin.go
- tags.go
- upload.go
- users.go
- validations.go
- vault.go
- version.go
- views.go
- workflows.go