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

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

func Cmd() *cobra.Command

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

func Run(cmd *cobra.Command, args []string, writeFile bool) error

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

func WriteCopilotInstructions(cmd *cobra.Command) error

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.

Jump to

Keyboard shortcuts

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