Commands
spmx hooks
Opt in to a Git post-checkout hook that hydrates worktrees as they are created.
spmx hooks enable [--global | --repo] [--async]
spmx hooks disable [--global | --repo]
spmx hooks status [--global | --repo] # default subcommandHooks are off by default. spmx never touches core.hooksPath or .git/hooks without this command.
What the hook does
On a fresh checkout (git worktree add or a first checkout of a branch) in a Flutter or Swift project, it runs spmx hydrate --quiet. That is what makes a new worktree ready before Xcode's GUI opens it, which shims alone cannot do.
spmx writes a delimited block, # >>> spmx hook >>> to # <<< spmx hook <<<, and preserves any hook that was already there (Lefthook, Husky, hand-written). If core.hooksPath is already set it chains rather than replaces.
Options
| Option | Applies to | Description |
|---|---|---|
--global | enable, disable, status | use the global Git hooks configuration |
--repo | enable, disable, status | use the current repository. Default inside a Git repo |
--async | enable | run spmx hydrate in the background during checkout |
--global and --repo cannot be combined on enable.
Examples
spmx hooks enable --global
spmx hooks enable --repo --async
spmx hooks status
spmx hooks disable --globaldisable removes only spmx's block and leaves other hooks intact.