# Scripts

Current command homes:

- `node scripts/check-scaffold.mjs`
  - verifies the execution scaffold exists
- `node scripts/validate-package.mjs <package-path>`
  - reserved entrypoint for validator work
- `node scripts/publish-package.mjs <package-path> [binding-path]`
  - loads manual binding and executes one publish attempt
- `node scripts/print-meta-setup.mjs`
  - prints the provider-based Meta callback URI and current browser/server connect entry points
- `node scripts/discover-meta-pages.mjs`
  - reads the user access token and lists managed pages without writing runtime files
- `node scripts/create-meta-binding.mjs <page-id> [binding-path] [--write]`
  - previews one local binding by default
  - writes env target and binding only with `--write`
- `node scripts/create-meta-binding.mjs --handoff-token <token> [binding-path] [--write]`
  - reads the encrypted callback handoff token
  - can persist page id, page token, user token, and binding in one local step
  - creates `.env.backup-before-connect` before the first local write

These scripts are the narrow first execution surface.

Current scaffold expectations:

- `packages/*` for package movement
- `bindings/manual` for real local connection records
- `attempts/` for append-only attempt history
- `results/` for normalized latest output
- `src/bindings` before `src/channels/<provider>`

Runtime rule:

- scripts load local `.env` automatically when present
- prefer env-backed secrets over inline token values in binding JSON
- current production browser entry is `/api/connect/meta/access`
