Documentation
¶
Overview ¶
Package cli wires together the CLI commands.
Index ¶
- Constants
- Variables
- func BuildBaselineGraphFromGitRef(baselineRef string, buildGraph func(string) (*graph.Graph, error)) (*graph.Graph, error)
- func BuildGraph(absRoot string) (*graph.Graph, error)
- func CleanupSessions() (int, error)
- func EndSession() (string, error)
- func GetActiveSessionID() (string, error)
- func LogCommand(command string, args []string, intention string, elapsed time.Duration, ...) error
- func PrintJSON(env Envelope) int
- func Run(args []string) int
- func RunAudit(sessionID string) int
- func StartSession(customWord string) (string, error)
- type Envelope
- type GateConfig
- type Snapshot
Constants ¶
const SchemaVersion = "1"
SchemaVersion is the stable JSON output schema version. Bump when the envelope shape changes in a backwards-incompatible way.
Variables ¶
var Version = "dev"
Version is set at build time via -ldflags; defaults to "dev" for local builds.
Functions ¶
func BuildBaselineGraphFromGitRef ¶ added in v1.4.45
func BuildBaselineGraphFromGitRef(baselineRef string, buildGraph func(string) (*graph.Graph, error)) (*graph.Graph, error)
BuildBaselineGraphFromGitRef extracts a repository state at the given git ref into a temporary directory and builds a graph for it.
func CleanupSessions ¶ added in v1.4.70
func EndSession ¶ added in v1.4.70
func GetActiveSessionID ¶ added in v1.4.70
Re-expose types/constants for compatibility if needed, or simply delegate.
func LogCommand ¶ added in v1.4.70
func PrintJSON ¶ added in v1.4.10
PrintJSON serialises env to stdout as indented JSON and always exits cleanly (exit 0) unless Status is "error", in which case it exits 1. This function never returns.
func StartSession ¶ added in v1.4.70
Types ¶
type Envelope ¶ added in v1.4.10
type Envelope struct {
SchemaVersion string `json:"schema_version"`
Command string `json:"command"`
Query string `json:"query,omitempty"`
// Status is "ok" (results found), "empty" (no results, symbol/query valid),
// or "error" (hard failure — graph missing, parse error, etc.).
Status string `json:"status"`
Count int `json:"count,omitempty"`
Results interface{} `json:"results,omitempty"`
Error string `json:"error,omitempty"`
}
Envelope is the top-level JSON wrapper for all --json output. schema_version lets agents pin to a known schema and detect changes.
type GateConfig ¶ added in v1.4.54
type Snapshot ¶ added in v1.4.54
type Snapshot struct {
Name string `json:"name"`
Timestamp string `json:"timestamp"`
TotalSymbols int `json:"total_symbols"`
OrphanCount int `json:"orphan_count"`
GodObjects []string `json:"god_objects"`
MaxComplexity int `json:"max_complexity"`
AvgInstability float64 `json:"avg_instability"`
CouplingEdges int `json:"coupling_edges"`
}