commands

package
v0.0.0-...-e6c4605 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewDAGCommand

func NewDAGCommand() *cobra.Command

NewDAGCommand creates the dag command.

func NewDiscoverCommand

func NewDiscoverCommand() *cobra.Command

NewDiscoverCommand creates the discover command.

func NewDoctorCommand

func NewDoctorCommand() *cobra.Command

NewDoctorCommand creates the doctor command.

func NewInitCommand

func NewInitCommand() *cobra.Command

NewInitCommand creates the init command.

func NewLSPCommand

func NewLSPCommand() *cobra.Command

NewLSPCommand creates the lsp command.

func NewLineageCommand

func NewLineageCommand() *cobra.Command

NewLineageCommand creates the lineage command.

func NewLintCommand

func NewLintCommand() *cobra.Command

NewLintCommand creates the lint command.

func NewListCommand

func NewListCommand() *cobra.Command

NewListCommand creates the list command.

func NewQueryCommand

func NewQueryCommand() *cobra.Command

NewQueryCommand creates the query command.

func NewRenderCommand

func NewRenderCommand() *cobra.Command

NewRenderCommand creates the render command.

func NewRulesCommand

func NewRulesCommand() *cobra.Command

NewRulesCommand creates the rules command.

func NewRunCommand

func NewRunCommand() *cobra.Command

NewRunCommand creates the run command.

func NewSeedCommand

func NewSeedCommand() *cobra.Command

NewSeedCommand creates the seed command.

func NewUICommand

func NewUICommand() *cobra.Command

NewUICommand creates the ui command.

func NewVersionCommand

func NewVersionCommand(version string) *cobra.Command

NewVersionCommand creates the version command.

Types

type CommandContext

type CommandContext struct {
	Cfg      *config.Config
	Logger   *slog.Logger
	Engine   *engine.Engine
	Renderer *output.Renderer
}

CommandContext holds common dependencies for CLI commands.

func NewCommandContext

func NewCommandContext(cmd *cobra.Command) (*CommandContext, func(), error)

NewCommandContext creates a CommandContext with engine and renderer. Returns the context and a cleanup function that must be called (typically via defer).

func NewCommandContextWithoutEngine

func NewCommandContextWithoutEngine(cmd *cobra.Command) *CommandContext

NewCommandContextWithoutEngine creates a CommandContext without an engine. Useful for commands that don't need database access.

type DoctorOptions

type DoctorOptions struct {
	Format string // Output format: text, json
}

DoctorOptions holds options for the doctor command.

type DoctorOutput

type DoctorOutput struct {
	// Configuration info for debugging
	ProjectRoot string `json:"project_root"`
	ConfigFile  string `json:"config_file,omitempty"`
	ModelsDir   string `json:"models_dir"`
	MacrosDir   string `json:"macros_dir"`
	SeedsDir    string `json:"seeds_dir"`
	StatePath   string `json:"state_path"`

	// Project health
	Summary         ProjectSummary `json:"summary"`
	HealthChecks    []HealthCheck  `json:"health_checks"`
	Score           int            `json:"score"`
	Recommendations []string       `json:"recommendations"`
	IssueCount      int            `json:"issue_count"`
}

DoctorOutput is the JSON output for the doctor command.

type GraphQuerier

type GraphQuerier interface {
	GetParents(string) []string
	GetChildren(string) []string
	NodeCount() int
	EdgeCount() int
}

GraphQuerier provides read-only access to DAG structure.

type HealthCheck

type HealthCheck struct {
	RuleID     string   `json:"rule_id"`
	Name       string   `json:"name"`
	Group      string   `json:"group"`
	Status     string   `json:"status"` // "pass", "warn", "error"
	IssueCount int      `json:"issue_count"`
	Details    []string `json:"details,omitempty"`
}

HealthCheck represents a single health check result.

type LineageOptions

type LineageOptions struct {
	Upstream   bool
	Downstream bool
	Depth      int
}

LineageOptions holds options for the lineage command.

type LintOptions

type LintOptions struct {
	Path        string   // File or directory path
	Format      string   // Output format: text, json
	Disable     []string // Rule IDs to disable
	Severity    string   // Minimum severity: error, warning, info, hint
	Rules       []string // Run only specific rules
	SkipProject bool     // Skip project health linting
	Verbose     bool     // Show rule documentation with violations
}

LintOptions holds options for the lint command.

type ProjectSummary

type ProjectSummary struct {
	Models    int `json:"models"`
	Macros    int `json:"macros"`
	Seeds     int `json:"seeds"`
	DAGDepth  int `json:"dag_depth"`
	RootCount int `json:"root_count"`
	LeafCount int `json:"leaf_count"`
	EdgeCount int `json:"edge_count"`
}

ProjectSummary contains project-level statistics.

type QueryOptions

type QueryOptions struct {
	Format string
	Input  string
}

QueryOptions holds options for the query command.

type RulesJSONOutput

type RulesJSONOutput struct {
	Rules []core.RuleInfo `json:"rules"`
	Count struct {
		SQL     int `json:"sql"`
		Project int `json:"project"`
		Total   int `json:"total"`
	} `json:"count"`
}

RulesJSONOutput is the JSON output structure for rules listing.

type RulesOptions

type RulesOptions struct {
	Group   string // Filter by group
	Type    string // Filter by type: sql, project
	Verbose bool   // Show full documentation
	Format  string // Output format
}

RulesOptions holds options for the rules command.

type RunOptions

type RunOptions struct {
	Select     string
	Downstream bool
	JSONOutput bool
}

RunOptions holds options for the run command.

type UIOptions

type UIOptions struct {
	Port      int
	NoBrowser bool
	Watch     bool
}

UIOptions holds options for the ui command.

Jump to

Keyboard shortcuts

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