openclaw/docs/scripts.md
CJ Winslow 34f193c657 add config schema generation for IDE autocomplete
- scripts/gen-config-schema.ts: generates JSON schema + TypeScript types from ClawdbotSchema
- `pnpm schema:gen`
- allow $schema key in config for IDE integration
  - Users can now add "$schema": "./schemas/clawdbot.schema.json" to their
  clawdbot.json for autocomplete without validation errors.
- Document schema generation in configuration and scripts docs
2026-01-30 00:13:57 -08:00

38 lines
1.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
summary: "Repository scripts: purpose, scope, and safety notes"
read_when:
- Running scripts from the repo
- Adding or changing scripts under ./scripts
---
# Scripts
The `scripts/` directory contains helper scripts for local workflows and ops tasks.
Use these when a task is clearly tied to a script; otherwise prefer the CLI.
## Conventions
- Scripts are **optional** unless referenced in docs or release checklists.
- Prefer CLI surfaces when they exist (example: auth monitoring uses `openclaw models status --check`).
- Assume scripts are hostspecific; read them before running on a new machine.
## Git hooks
- `scripts/setup-git-hooks.js`: best-effort setup for `core.hooksPath` when inside a git repo.
- `scripts/format-staged.js`: pre-commit formatter for staged `src/` and `test/` files.
## Auth monitoring scripts
Auth monitoring scripts are documented here:
[/automation/auth-monitoring](/automation/auth-monitoring)
## Config schema generation
- `scripts/gen-config-schema.ts`: generates `schemas/moltbot.schema.json` (JSON Schema) and `schemas/moltbot.d.ts` (TypeScript types) from the Zod config schema.
- Run via `pnpm schema:gen`. Both output files are git-ignored.
- See [IDE autocomplete](/gateway/configuration#ide-autocomplete) for usage.
## When adding scripts
- Keep scripts focused and documented.
- Add a short entry in the relevant doc (or create one if missing).