Documentation
¶
Overview ¶
Package root implements the ctx init command.
It initializes a new .context/ directory with template files for maintaining persistent context for AI coding assistants.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmd ¶
Cmd returns the "ctx init" command for initializing a .context/ directory.
The command creates template files for maintaining persistent context for AI coding assistants. Files include constitution rules, tasks, decisions, learnings, conventions, and architecture documentation.
Flags:
- --force, -f: Overwrite existing context files without prompting
- --minimal, -m: Only create essential files (TASKS, DECISIONS, CONSTITUTION)
- --merge: Auto-merge ctx content into existing CLAUDE.md and PROMPT.md
- --ralph: Use autonomous loop templates (no clarifying questions, one-task-per-iteration, completion signals)
- --no-plugin-enable: Skip auto-enabling the ctx plugin in ~/.claude/settings.json
Returns:
- *cobra.Command: Configured init command with flags registered
func Run ¶
Run executes the init command logic.
Creates a .context/ directory with template files. Handles existing directories, minimal mode, and CLAUDE.md/PROMPT.md merge operations.
Parameters:
- cmd: Cobra command for output and input streams
- force: If true, overwrite existing files without prompting
- minimal: If true, only create essential files
- merge: If true, auto-merge ctx content into existing files
- ralph: If true, use autonomous loop templates (no questions, signals)
- noPluginEnable: If true, skip auto-enabling the plugin globally
Returns:
- error: Non-nil if directory creation or file operations fail
Types ¶
This section is empty.