hooks

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 30, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallClaudeHook

func InstallClaudeHook(configPath, endpoint, apiKey, scriptPath string) error

InstallClaudeHook reads configPath (or starts with an empty object), inserts or updates the single skael-managed PreToolUse hook, and writes the file back.

Hook structure:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Skill",
        "hooks": [
          {
            "type": "command",
            "command": "SKAEL_AGENT=claude-code SKAEL_ENDPOINT=... SKAEL_API_KEY=... <scriptPath>",
            "_managed_by": "skael"
          }
        ]
      }
    ]
  }
}

func InstallForAgent

func InstallForAgent(agentName, configPath, endpoint, apiKey, scriptPath string) error

InstallForAgent calls the appropriate installer based on agentName.

func UninstallClaudeHook

func UninstallClaudeHook(configPath string) error

UninstallClaudeHook removes all hook entries tagged with _managed_by=skael from configPath and writes the cleaned file back. Empty arrays/objects are pruned.

func UninstallForAgent

func UninstallForAgent(agentName, configPath string) error

UninstallForAgent calls the appropriate uninstaller based on agentName.

func WriteCursorStopScript

func WriteCursorStopScript(skaalDir string) (string, error)

func WriteHookScript

func WriteHookScript(skaalDir string) (string, error)

WriteHookScript creates ~/.skael/hooks/ and writes skael-hook.sh with 0755 permissions. It returns the full path to the written script.

Types

This section is empty.

Jump to

Keyboard shortcuts

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