tohru
tohru  /  docs

Hooks

Using Tohru hooks

Profiles can define post-operation hooks:

{
  "hooks": [
    {
      "triggers": ["post_load", "post_reload"],
      "run": ["kitty", "@", "load-config"],
      "cwd": "home"
    }
  ]
}

Fields

KeyMeaning
triggersHook events. Supported values are post_load, post_reload, and post_unload.
runCommand argv. The first entry is the executable.
cwdWorking directory, either profile or home. Defaults to profile.

Trust

Hooks are not trusted automatically. Approvals live in the local Tohru store, not in the profile manifest.

Inspect hooks declared by a profile:

tohru hooks list dotfiles

Trust or revoke a hook:

tohru hooks allow dotfiles <hook-id>
tohru hooks revoke dotfiles <hook-id>

List trusted hooks:

tohru hooks trusted
tohru hooks trusted dotfiles

When an untrusted hook prompts interactively, choose run once, skip, or trust and run. Pass --no-hooks to load, reload, unload, install, or uninstall without running hooks.