Hooks

noego.config.yml
hooks:
  - name: generate-openapi
    watch:
      - src/server/openapi/**/*.yaml
      - src/server/stitch.yaml
    command: npm run openapi:generate
    cwd: . # default
    debounceMs: 250 # default

Hooks are for generated artifacts: OpenAPI clients, stitched schemas, SQL output, codegen, or similar tasks. Hook failures are logged and do not stop the dev server.

Hooks Settings

hooks[].name
Display name used in logs. Defaults to the command when omitted.
hooks[].watch
Required non-empty list of file patterns that trigger the hook.
hooks[].command
Required shell command to run after a matching change.
hooks[].cwd
Working directory for the command. Relative paths resolve from the project root.
hooks[].debounceMs
Delay before running the hook. Defaults to 250; use 0 to run immediately.

hooks[].command

Hook commands usually call a package script so the command stays reviewable and reusable outside the dev server.

package.json
{
  "scripts": {
    "openapi:generate": "stitch src/server/stitch.yaml"
  }
}

hooks[].watch

hooks[].watch should point at the source files that make the generated artifact stale. Keep these patterns focused so the hook does not rerun for unrelated frontend or backend changes.

NoEgo

© 2025 NoEgo. All rights reserved.