Documentation
¶
Overview ¶
Package root implements the ctx add command.
It appends new decisions, tasks, learnings, or conventions to the appropriate context file.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmd ¶
Cmd returns the "ctx add" command for appending entries to context files.
Supported types are defined in [config.FileType] (both singular and plural forms accepted, e.g., "decision" or "decisions"). Content can be provided via command argument, --file flag, or stdin pipe.
Flags:
- --priority, -p: Priority level for tasks (high, medium, low)
- --section, -s: Target section within the file
- --file, -f: Read content from a file instead of argument
- --context, -c: Context for decisions/learnings (required)
- --rationale, -r: Rationale for decisions (required for decisions)
- --consequence: Consequence for decisions (required for decisions)
- --lesson, -l: Lesson for learnings (required for learnings)
- --application, -a: Application for learnings (required for learnings)
Returns:
- *cobra.Command: Configured add command with flags registered
func Run ¶
Run executes the add command logic.
Reads content from the specified source (argument, file, or stdin), validates the entry, and writes it to the appropriate context file.
Parameters:
- cmd: Cobra command for output
- args: Command arguments; args[0] is the entry type, args[1:] is content
- flags: All flag values from the command
Returns:
- error: Non-nil if content is missing, type is invalid, required flags are missing, or file operations fail
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.