cmd

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

File: cmd/evolution.go

File: cmd/report.go

File: cmd/root.go

File: cmd/scan.go

File: cmd/self_heal.go

File: cmd/version.go

Index

Constants

This section is empty.

Variables

View Source
var Version = "v0.1.6"

Version holds the current version of the Scalpel CLI application. This variable is typically set at build time using ldflags to inject version information dynamically. For example: go build -ldflags "-X github.com/xkilldash9x/scalpel-cli/cmd.Version=1.2.3"

Functions

func Execute

func Execute(ctx context.Context) error

Execute is the primary entry point for the Scalpel CLI application. It creates a new root command, executes it with the provided context, and handles top-level error logging. If the context is canceled (e.g., by Ctrl+C), it suppresses redundant error messages for a cleaner user experience.

func NewRootCommand

func NewRootCommand() *cobra.Command

NewRootCommand creates the main entry point for the command-line interface. It initializes the root command, sets up persistent flags for configuration, configures logging, and attaches all subcommands (like scan, report, etc.). This function ensures a clean, state-free command structure for each execution.

func NewStoreProvider

func NewStoreProvider() storeProvider

NewStoreProvider is a factory function that creates a new defaultStoreProvider. It provides a clean way to instantiate the production store provider.

Types

type AnalystRunner

type AnalystRunner interface {
	// Run starts the evolution process with a given high-level objective and an
	// optional set of initial files for context.
	Run(ctx context.Context, objective string, files []string) error
}

AnalystRunner defines the interface for a component capable of executing the main evolution logic. Using an interface allows for decoupling and easier testing by enabling mock implementations.

type ComponentFactory

type ComponentFactory interface {
	// Create initializes and returns all necessary components for a scan, such as
	// the orchestrator, knowledge graph, and various clients. It returns an
	// interface{} that is expected to be of type *service.Components.
	Create(ctx context.Context, cfg config.Interface, targets []string, logger *zap.Logger) (interface{}, error)
}

ComponentFactory defines an interface for creating the full suite of services required for a scan. This abstraction allows for dependency injection, making the `scan` command testable by allowing mocks to be provided instead of live components.

type MetalystInitializer

type MetalystInitializer func(config.Interface, schemas.LLMClient) (MetalystRunner, error)

MetalystInitializer defines a function signature for creating a MetalystRunner. This supports dependency injection, enabling the replacement of the real Metalyst service with a mock during testing.

type MetalystRunner

type MetalystRunner interface {
	// Run initiates the self-healing process. It takes the path to the panic log
	// and the original command-line arguments that caused the crash as input.
	Run(ctx context.Context, panicLogPath string, originalArgs []string) error
}

MetalystRunner defines an interface for the component responsible for executing the core self-healing logic. This abstraction allows the command to be tested with a mock runner, decoupling it from the concrete implementation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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