add

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

Documentation

Overview

Package add provides the "ctx add" command for appending entries to context files.

It supports adding decisions, tasks, learnings, and conventions to their respective files in the .context/ directory. Content can be provided via command argument, --file flag, or stdin pipe.

Supported entry types (defined in [config.FileType]):

  • decision/decisions: Appends to DECISIONS.md
  • task/tasks: Inserts into TASKS.md before first unchecked task, or under a named section when --section is provided
  • learning/learnings: Appends to LEARNINGS.md
  • convention/conventions: Appends to CONVENTIONS.md

Example usage:

ctx add decision "Use PostgreSQL for primary database"
ctx add task "Implement auth" --priority high --section "Phase 1"
ctx add learning --file notes.md
echo "Use camelCase" | ctx add convention

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cmd

func Cmd() *cobra.Command

Cmd returns the "ctx add" command.

Returns:

  • *cobra.Command: Configured add command

Types

This section is empty.

Directories

Path Synopsis
cmd
Package cmd provides coverage tests for the ctx add subcommand tree.
Package cmd provides coverage tests for the ctx add subcommand tree.
root
Package root implements the ctx add command.
Package root implements the ctx add command.
Package core provides helper functions for the add command.
Package core provides helper functions for the add command.
entry
Package entry provides file-type predicates for routing add entries to the correct context file.
Package entry provides file-type predicates for routing add entries to the correct context file.
example
Package example provides usage examples shown when the add command receives no content for a given entry type.
Package example provides usage examples shown when the add command receives no content for a given entry type.
extract
Package extract retrieves entry content from command arguments, files, or stdin for the add command.
Package extract retrieves entry content from command arguments, files, or stdin for the add command.
format
Package format builds timestamped Markdown entries for decisions, learnings, tasks, and conventions.
Package format builds timestamped Markdown entries for decisions, learnings, tasks, and conventions.
insert
Package insert places formatted entries into context file content at the correct position based on entry type and section headers.
Package insert places formatted entries into context file content at the correct position based on entry type and section headers.
normalize
Package normalize ensures section headings and other user input have the correct Markdown format before insertion.
Package normalize ensures section headings and other user input have the correct Markdown format before insertion.

Jump to

Keyboard shortcuts

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