Documentation
¶
Overview ¶
Package initialize implements the "ctx init" command for initializing a .context/ directory with template files.
The init command creates the foundation for persistent AI context by generating template files for constitution rules, tasks, decisions, learnings, conventions, and architecture documentation. It also sets up Claude Code integration with hooks and slash commands.
File Organization ¶
- init.go: Command definition and flag registration
- run.go: Main execution logic and orchestration
- validate.go: PATH validation for ctx executable
- fs.go: File system operations and marker handling
- claude.go: CLAUDE.md creation and merge logic
- tpl.go: Entry template creation
- cmd.go: Claude Code slash command creation
- hook.go: Claude Code hook and settings creation
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
Returns:
- *cobra.Command: Configured init command with flags registered
Types ¶
This section is empty.