Authoring watches as files
Watches can be written as YAML files and imported. This is the right workflow if you want them reviewed, versioned, or created reproducibly.
Writing one
Section titled “Writing one”One watch per file, in watches/:
id: framework-releasesname: Framework stable releasessources: - type: rss value: "https://example.com/blog/feed.xml" trust: official - type: search value: "framework 2.0 stable release" hints: recencyDays: 14 topic: newsschedule: "0 */6 * * *"condition: > Alert when a new stable version is released. Ignore release candidates, betas, and posts about future plans.channels: [telegram]threshold: 0.6weakThreshold: 0.4enabled: trueEvery field is validated on import against the watch schema. An invalid file fails the import with the offending file named — nothing is partially applied.
Importing
Section titled “Importing”pnpm watches:importImported 3 watch(es) from …/watches: 1 created, 2 updated. • framework-releases • product-restock • security-advisoriesThe import is an idempotent upsert keyed on id: running it repeatedly is
safe, and it is the normal way to roll out an edit.
The workflow
Section titled “The workflow”- Edit or add a file in
watches/. pnpm watches:import.pnpm run-due:forceto test it immediately.pnpm watches history <id>to read the outcome.
What import does not do
Section titled “What import does not do”- It does not delete. Removing a file leaves the watch in the database. Delete
it explicitly with
pnpm watches delete <id>. - It does not merge. An imported watch replaces the stored definition, so a field you removed from the file is removed from the watch.
- It does not preserve panel edits. If someone edits a watch in the panel and you then import an older file, the file wins. Pick one source of authority per watch.
Ownership
Section titled “Ownership”Imported watches take the ownerId in the file, defaulting to local. If you
bootstrapped your admin account with --id local, imported watches are yours and
appear in the panel. If not, they belong to a different owner and will not show
up — set ownerId explicitly in the file to fix that.
Keeping files private
Section titled “Keeping files private”Managing without files
Section titled “Managing without files”Everything here is also available through the API and the panel — files are one option, not a requirement. See Watches API.