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: 15 Imported by: 0

Documentation

Overview

Package root implements the ctx compact command.

It archives completed tasks and cleans up context files by removing empty sections and consolidating old content.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the "ctx compact" command for cleaning up context files.

The command moves completed tasks to a "Completed (Recent)" section, optionally archives old content, and removes empty sections from all context files.

Flags:

  • --archive: Create .context/archive/ for old completed tasks

Returns:

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

func Run

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

Run executes the compact command logic.

Loads context, processes TASKS.md for completed tasks, and removes empty sections from all context files.

Parameters:

  • cmd: Cobra command for output messages
  • archive: If true, archive old completed tasks to .context/archive/

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