Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.getgaal.com/llms.txt

Use this file to discover all available pages before exploring further.

hooks:
  pre-sync:
    - name: <string>             # optional
      command: <string>
      args: <[string]>           # optional
      cwd: <string>              # optional
      os: <[linux|darwin|windows]>
      timeout: <duration>        # optional, default 5m
      continue_on_error: <bool>  # optional, default false
      env: <map[string,string]>  # optional

  post-sync:
    - command: <string>
      args: <[string]>

Type

object

Required

No. Omit hooks: unless you need local commands around sync.

Phases

PhaseRuns
pre-syncAfter planning and before gaal writes any resource.
post-syncAfter sync and optional prune have completed successfully.
A failing pre-sync hook aborts the sync unless continue_on_error: true is set. A failing post-sync hook makes the command fail after all sync work has already completed.

Hook fields

FieldTypeRequiredNotes
namestringnoLabel shown in plans and logs.
commandstringyesExecutable to run. No shell is involved.
argsarray of stringsnoPassed verbatim after expansion.
cwdstringnoDefaults to gaal’s working directory.
osarraynoRestrict to linux, darwin, or windows.
timeoutduration stringnoGo duration such as 30s, 2m, or 1h.
continue_on_errorboolnoKeep running the phase after a non-zero exit.
envmap[string]stringnoAdded on top of the inherited environment.
Tokens beginning with ~/, $VAR, or ${VAR} are expanded in args, cwd, and env values.

Example

hooks:
  pre-sync:
    - name: snapshot dotfiles
      command: ./scripts/snapshot.sh
      os: [linux, darwin]
      timeout: 1m
      continue_on_error: true

  post-sync:
    - name: refresh local docs
      command: git
      args: ["-C", "~/docs", "pull", "--ff-only"]

Environment

Hooks inherit the process environment plus:
VariableValue
GAAL_HOOK_PHASEpre-sync or post-sync
GAAL_PLANNED_REPOS / GAAL_CHANGED_REPOSNewline-separated repository paths.
GAAL_PLANNED_SKILLS / GAAL_CHANGED_SKILLSNewline-separated agent:source rows.
GAAL_PLANNED_MCPS / GAAL_CHANGED_MCPSNewline-separated MCP names.
GAAL_HAS_CHANGES1 when the plan has work to do.
GAAL_HAS_ERRORS1 when planning found errors.

Sync hooks workflow

gaal sync