hooks

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Script

func Script() []byte

Script returns the embedded Claude Code hook script.

Types

type Installer

type Installer struct {
	// HomeDir is dependency-injected for tests. If empty, os.UserHomeDir is used.
	HomeDir string
}

Installer installs the embedded Scribe hook into Claude Code.

func (*Installer) CurrentStatus

func (i *Installer) CurrentStatus() (Status, error)

CurrentStatus reports whether the hook is currently installed. Because the Status enum intentionally has no NotInstalled value, StatusInstalled means Claude Code is present but the managed hook is not fully installed.

func (*Installer) Install

func (i *Installer) Install() (Status, error)

Install reads ~/.claude/settings.json, adds the Scribe hook entry, and writes the embedded script to ~/.claude/hooks/scribe-hook.sh with 0755 permissions.

func (*Installer) Uninstall

func (i *Installer) Uninstall() error

Uninstall removes the Scribe hook entry from settings.json and deletes the managed hook script. It is idempotent.

type Status

type Status int

Status describes the result of a hook installer operation.

const (
	StatusInstalled Status = iota
	StatusAlreadyInstalled
	StatusNotApplicable
)

Jump to

Keyboard shortcuts

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