hookwire

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallHook

func InstallHook(templates fs.FS, claudeDir string) error

InstallHook copies the hook script (executable) and its README from the embedded templates into <claudeDir>/hooks, then installs the binary the orchestrator script forwards to.

func RenderHooksBlock

func RenderHooksBlock(templates fs.FS) ([]byte, error)

RenderHooksBlock reads the settings hooks template and returns the indented JSON block. The hook command resolves the project root at runtime via $CLAUDE_PROJECT_DIR, so the block is portable (no per-target path baked in). It validates that the result is well-formed JSON before it reaches a settings file.

func WireSettings

func WireSettings(templates fs.FS, claudeDir, settingsFile string) error

WireSettings merges the rendered hook entries into <claudeDir>/<settingsFile> (settingsFile is "settings.json" for the project scope or "settings.local.json" for the per-machine scope). It is idempotent: any prior entry whose command references the hook script is dropped before the fresh entries are appended, so re-running never duplicates. Existing permissions, enabledMcpjsonServers, and unrelated hooks are preserved.

Types

This section is empty.

Jump to

Keyboard shortcuts

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