commands

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClaudeCodeCommandManager

type ClaudeCodeCommandManager struct{}

ClaudeCodeCommandManager implements CommandManager for Claude Code. Commands are installed to .claude/commands/ in the project root.

func NewClaudeCodeCommandManager

func NewClaudeCodeCommandManager() *ClaudeCodeCommandManager

NewClaudeCodeCommandManager creates a new Claude Code command manager.

func (*ClaudeCodeCommandManager) CommandDir

func (m *ClaudeCodeCommandManager) CommandDir(projectRoot string) string

CommandDir returns the path to the Claude Code command directory.

func (*ClaudeCodeCommandManager) Install

func (m *ClaudeCodeCommandManager) Install(_ context.Context, projectRoot string, commands []agentx.CommandFile, overwrite bool) ([]string, error)

Install writes command files to .claude/commands/. When overwrite is false, existing files are skipped entirely (safe for first-time init). When overwrite is true, existing files are replaced only if content differs AND the installed version is not newer than ours (prevents older binaries from downgrading). Each file is stamped with a content hash and version on the first line.

func (*ClaudeCodeCommandManager) Uninstall

func (m *ClaudeCodeCommandManager) Uninstall(_ context.Context, projectRoot string, prefix string) ([]string, error)

Uninstall removes command files matching the prefix from .claude/commands/.

func (*ClaudeCodeCommandManager) Validate

func (m *ClaudeCodeCommandManager) Validate(_ context.Context, projectRoot string, commands []agentx.CommandFile) (missing []string, stale []string, err error)

Validate checks which expected command files are missing or stale. A file is stale if its content hash differs from expected AND the installed version is not newer than ours (same downgrade guard as Install). Files without a hash stamp are not considered stale (user-managed).

Jump to

Keyboard shortcuts

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