root

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

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

func Cmd() *cobra.Command

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

func Run(
	cmd *cobra.Command, force, minimal, merge, ralph, noPluginEnable bool,
) error

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.

Jump to

Keyboard shortcuts

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