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