Documentation
¶
Overview ¶
Package root implements the ctx hook command.
It generates configuration snippets for integrating ctx with AI coding tools such as Claude Code, Cursor, and Aider.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cmd ¶
Cmd returns the "ctx hook" command for generating AI tool integrations.
The command outputs configuration snippets and instructions for integrating Context with various AI coding tools like Claude Code, Cursor, Aider, etc.
Flags:
- --write, -w: Write the configuration file instead of printing
Returns:
- *cobra.Command: Configured hook command that accepts a tool name argument
func Run ¶
Run executes the hook command logic.
Outputs integration instructions and configuration snippets for the specified AI tool. With --write, generates the configuration file directly.
Parameters:
- cmd: Cobra command for output stream
- args: Command arguments; args[0] is the tool name
- writeFile: If true, write the configuration file instead of printing
Returns:
- error: Non-nil if the tool is not supported or file write fails
func WriteCopilotInstructions ¶
WriteCopilotInstructions generates .github/copilot-instructions.md.
Creates the .github/ directory if needed and writes the comprehensive Copilot instructions file. Preserves existing non-ctx content by checking for ctx markers.
Parameters:
- cmd: Cobra command for output messages
Returns:
- error: Non-nil if directory creation or file write fails
Types ¶
This section is empty.