root

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package root implements the ctx drift command.

It detects stale or invalid context by checking for broken path references, staleness indicators, constitution violations, and missing required files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the "ctx drift" command for detecting stale context.

The command checks for broken path references, staleness indicators, constitution violations, and missing required files.

Flags:

  • --json: Output results as JSON for machine parsing
  • --fix: Auto-fix supported issues (staleness, missing_file)

Returns:

  • *cobra.Command: Configured drift command with flags registered

func Run

func Run(cmd *cobra.Command, jsonOutput, fix bool) error

Run executes the drift command logic.

Loads context, runs drift detection, and outputs results in the specified format. When `fix` is true, attempts to auto-fix supported issue types (staleness, missing_file).

Parameters:

  • cmd: Cobra command for output stream
  • jsonOutput: If true, output as JSON; otherwise output as text
  • fix: If true, attempt to auto-fix supported issues

Returns:

  • error: Non-nil if context loading fails or .context/ is not found

Types

This section is empty.

Jump to

Keyboard shortcuts

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