Deterministic, public-safe reconcilers for OpenClaw runtime operations.
OpenClaw Ops gives schedulers and infra repos a small set of boring, auditable commands for keeping runtime files aligned with rendered desired state. It owns the mechanics: plan, diff, apply, JSON logs, and safety rails. Your private prompt repos and infra repos still own the actual desired state, hosts, credentials, schedules, and rollout policy.
OpenClaw runtimes accumulate local drift: prompt files get hotpatched, generated config changes, cron artifacts move, and support files need to follow the active agent. These tools make that drift visible first, then fix it only when the caller explicitly asks.
Every reconciler is:
- dry-run by default
- explicit about source and target paths
- host-aware in output through
--hostorOPENCLAW_HOST - JSON-friendly for automation logs
- safe to run against one runtime target at a time
- generic enough for public reuse
| Reconciler | Command | What it syncs | Docs | Code |
|---|---|---|---|---|
| Prompt Files | openclaw-ops prompts reconcile |
Rendered agent prompts and support/ files into one OpenClaw agent workspace |
docs/reconcilers/prompts.md | src/reconcilers/prompts.ts |
| Runtime Config | openclaw-ops config reconcile |
Desired config file trees into one runtime config directory | docs/reconcilers/config.md | src/reconcilers/config.ts |
| Cron Artifacts | openclaw-ops crons reconcile |
Desired cron artifacts into one runtime cron directory, with --only hard scoping |
docs/reconcilers/crons.md | src/reconcilers/crons.ts |
Shared file-tree planning lives in src/reconcilers/tree.ts. Behavior coverage lives in test/prompts-reconciler.test.ts and test/config-crons-reconciler.test.ts.
All reconcilers follow the same operating model:
dry-runis the default--applyis required before mutation--jsonemits scheduler-friendly machine output--pruneis required before deleting stale managed files- results include source metadata, target metadata, full file plan, and changed files
- target metadata includes
hostId; pass--host, setOPENCLAW_HOST, or use the local hostname default - missing or invalid desired state fails before mutation
- no private repository, host, user, token, or credential defaults
See docs/reconciler-contract.md for the full contract.
npm install
npm run build
node dist/cli.js --helpLink the CLI while developing locally:
npm link
openclaw-ops --helpUse this when a rendered prompt bundle should become the live prompt files for one OpenClaw runtime agent.
openclaw-ops prompts reconcile \
--host example-host \
--runtime example-runtime \
--agent main \
--source-dir ./test/fixtures/prompt-source/agent-prompts/example-runtime/main \
--workspace-dir ./tmp/workspace \
--support-dir ./tmp/runtime/example-runtimeApply the same plan:
openclaw-ops prompts reconcile \
--host example-host \
--runtime example-runtime \
--agent main \
--source-dir ./test/fixtures/prompt-source/agent-prompts/example-runtime/main \
--workspace-dir ./tmp/workspace \
--support-dir ./tmp/runtime/example-runtime \
--applyUse this when an infra repo has rendered a desired config directory and the runtime should match it.
openclaw-ops config reconcile \
--host example-host \
--source-dir ./test/fixtures/config-source \
--target-dir ./tmp/config \
--jsonApply:
openclaw-ops config reconcile \
--host example-host \
--source-dir ./test/fixtures/config-source \
--target-dir ./tmp/config \
--applyUse this when a scheduler or infra repo has rendered cron artifacts for a
runtime. --only keeps partial rollouts narrow and ignores unrelated drift.
openclaw-ops crons reconcile \
--host example-host \
--source-dir ./test/fixtures/cron-source \
--target-dir ./tmp/crons \
--only hourly/example.mdApply and prune the whole target directory:
openclaw-ops crons reconcile \
--host example-host \
--source-dir ./test/fixtures/cron-source \
--target-dir ./tmp/crons \
--prune \
--applyThis repo is public. Keep it generic.
Good fits:
- reconciler engines
- CLI wrappers
- generic fixtures
- placeholder examples
- tests and docs for generic behavior
Keep out:
- real prompt bundles or operator instructions
- runtime hostnames, usernames, or managed-user inventory
- tokens, deploy keys, 1Password paths, or private repository defaults
- organization-specific reviewer, CI, merge, or rollout policy
npm install
npm run verifyCI runs the same verification on every push and pull request.