cmd

package
v1.3.3 Latest Latest
Warning

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

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

Documentation

Overview

Package cmd implements the CLI commands

Index

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.

func Execute

func Execute(ctx context.Context) error

Execute the CLI

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

type CommandSchemas struct {
	Input  any
	Output any
}

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

type IssueEventHydrateError struct {
	EventID string `json:"eventId"`
	Error   string `json:"error"`
}

IssueEventHydrateError captures a per-event hydration failure so partial success is observable rather than swallowed.

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 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

type ProblemSummary struct {
	AppID        string
	AppName      string
	ScanStatus   string
	ProblemCount int
}

ProblemSummary represents a summary of problems for an application

Jump to

Keyboard shortcuts

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