hook

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 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 ClaudeHookCommand added in v0.3.0

type ClaudeHookCommand struct {
	Command string `json:"command"`
	Type    string `json:"type"`
}

ClaudeHookCommand represents a hook command object

type ClaudeHookEntry

type ClaudeHookEntry struct {
	Matcher string `json:"matcher"`
	Hooks   []any  `json:"hooks"` // Can be strings or objects with command/type
}

ClaudeHookEntry represents a single hook entry in Claude Code's settings

type GeminiHookEntry added in v0.3.0

type GeminiHookEntry struct {
	Matcher string           `json:"matcher"`
	Hooks   []GeminiHookItem `json:"hooks"`
}

GeminiHookEntry represents a single hook entry in Gemini CLI's settings

type GeminiHookItem added in v0.3.0

type GeminiHookItem struct {
	Name        string `json:"name,omitempty"`
	Type        string `json:"type,omitempty"` // "command"
	Command     string `json:"command"`
	Description string `json:"description,omitempty"`
	Timeout     int    `json:"timeout,omitempty"`
}

GeminiHookItem represents a hook command in Gemini CLI format

type Hook

type Hook struct {
	Type    string `json:"type"`    // PreToolUse, PostToolUse, Notification, Stop, UserPromptSubmit, etc.
	Matcher string `json:"matcher"` // Tool matcher (e.g., "Bash", "Edit", "*")
	Command string `json:"command"` // Shell command to run
	Source  string `json:"-"`       // Which tool this hook came from (e.g., "claude", "claude-local", "gemini")
	Name    string `json:"name"`    // Optional hook name (Gemini)
}

Hook represents a configured hook

func LoadAll

func LoadAll() ([]*Hook, error)

LoadAll loads hooks from all supported tools (global only)

func LoadAllWithProject added in v0.3.0

func LoadAllWithProject(projectDir string) ([]*Hook, error)

LoadAllWithProject loads hooks from all supported tools, including project-local

func LoadFromClaudeProjectSettings added in v0.3.0

func LoadFromClaudeProjectSettings(projectDir string) ([]*Hook, error)

LoadFromClaudeProjectSettings loads hooks from a project-local .claude/settings.json

func LoadFromClaudeSettings

func LoadFromClaudeSettings() ([]*Hook, error)

LoadFromClaudeSettings loads hooks from Claude Code's global settings.json

func LoadFromGeminiProjectSettings added in v0.3.0

func LoadFromGeminiProjectSettings(projectDir string) ([]*Hook, error)

LoadFromGeminiProjectSettings loads hooks from a project-local .gemini/settings.json

func LoadFromGeminiSettings added in v0.3.0

func LoadFromGeminiSettings() ([]*Hook, error)

LoadFromGeminiSettings loads hooks from Gemini CLI's global settings.json

func (*Hook) InspectContent added in v0.3.0

func (h *Hook) InspectContent() string

InspectContent returns the formatted content for the inspector viewport

func (*Hook) InspectTitle added in v0.3.0

func (h *Hook) InspectTitle() string

InspectTitle returns the display name for the inspector modal header

Jump to

Keyboard shortcuts

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