hooks

package
v0.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallAutoSyncForAgent added in v0.8.0

func InstallAutoSyncForAgent(agentName, configPath, scriptPath string) error

InstallAutoSyncForAgent calls the appropriate auto-sync installer based on agentName.

func InstallClaudeAutoSync added in v0.8.0

func InstallClaudeAutoSync(configPath, scriptPath string) error

InstallClaudeAutoSync adds a UserPromptSubmit hook that runs the debounced auto-sync script. This is separate from the activation tracking hook (PreToolUse) — it uses _managed_by: "skael-autosync".

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 InstallCodexAutoSync added in v0.8.0

func InstallCodexAutoSync(configPath, scriptPath string) error

InstallCodexAutoSync appends (or replaces) a skael-autosync managed pre_tool_use TOML block.

func InstallCursorAutoSync added in v0.8.0

func InstallCursorAutoSync(configPath, scriptPath string) error

InstallCursorAutoSync adds/updates a sessionStart hook pointing to the auto-sync script. This is separate from the activation tracking hook (stop) — it uses _managed_by: "skael-autosync".

func InstallForAgent

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

InstallForAgent calls the appropriate installer based on agentName.

func UninstallAutoSyncForAgent added in v0.8.0

func UninstallAutoSyncForAgent(agentName, configPath string) error

UninstallAutoSyncForAgent calls the appropriate auto-sync uninstaller based on agentName.

func UninstallClaudeAutoSync added in v0.8.0

func UninstallClaudeAutoSync(configPath string) error

UninstallClaudeAutoSync removes the auto-sync hook from configPath.

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 UninstallCodexAutoSync added in v0.8.0

func UninstallCodexAutoSync(configPath string) error

UninstallCodexAutoSync removes the skael-autosync TOML block.

func UninstallCursorAutoSync added in v0.8.0

func UninstallCursorAutoSync(configPath string) error

UninstallCursorAutoSync removes the auto-sync sessionStart hook.

func UninstallForAgent

func UninstallForAgent(agentName, configPath string) error

UninstallForAgent calls the appropriate uninstaller based on agentName.

func WriteAutoSyncScript added in v0.8.0

func WriteAutoSyncScript(skaalDir string) (string, error)

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

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