watch

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package watch implements the "ctx watch" command for processing structured context-update commands from AI output.

The watch command reads stdin for XML-style update commands (task, decision, learning, convention, complete) and applies them to the corresponding context files. It supports dry-run mode for previewing changes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the watch command.

Flags:

  • --log: Log file to watch (default: stdin)
  • --dry-run: Show updates without applying

Returns:

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

Types

type ContextUpdate

type ContextUpdate struct {
	Type         string
	Content      string
	Context      string
	Lesson       string
	Application  string
	Rationale    string
	Consequences string
}

ContextUpdate represents a parsed context update command.

Extracted from <context-update> XML tags in the input stream.

Fields:

  • Type: Update type (task, decision, learning, convention, complete)
  • Content: The entry text (title) or search query for complete
  • Context: Context field for learnings/decisions (what prompted this)
  • Lesson: Lesson field for learnings (the key insight)
  • Application: Application field for learnings (how to apply going forward)
  • Rationale: Rationale field for decisions (why this choice)
  • Consequences: Consequences field for decisions (what changes as a result)

Jump to

Keyboard shortcuts

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