Documentation
¶
Overview ¶
Package prune implements the ctx system prune subcommand.
It removes stale per-session state files from .context/state/ that exceed the configured age, while preserving global state files.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmd ¶
Cmd returns the "ctx system prune" subcommand.
Returns:
- *cobra.Command: Configured prune subcommand
func Run ¶
Run executes the prune logic.
Scans the state directory for session-scoped files (identified by UUID patterns) older than the given number of days and removes them. Global state files (non-UUID) are preserved. Supports dry-run mode.
Parameters:
- cmd: Cobra command for output
- days: prune files older than this many days
- dryRun: if true, report what would be pruned without removing
Returns:
- error: Non-nil on state directory read failure
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.