Skip to main content

watchglass

Poll conditions and run actions, from login onward.

watchglass runs watches: small directories holding a config.toml plus a check and some actions, written in Python, shell, Expect or anything executable. It polls each check on its own interval, remembers whether the condition is TRUE or FALSE, runs actions while it is TRUE or FALSE and when it changes, retries with backoff, takes failing watches offline, and logs everything as JSON lines, so any failure can be explained afterwards. The command line and its reference are written for AI agents as much as for people.

Watches can also react to events instead of polling: observers keep commands, local directories or remote directories (over one ssh connection, with nothing installed remotely) under watch. Built-in recipes move files between machines with verified scp transfers, and recipe = "mirror" keeps a whole tree in sync in place, the way rsync would; watchglass docs relay walks through relaying files host A → this machine → host B.

watchglass tui watches all of it live in one screen: every watch and its state, the countdown to its next poll, and the actions it has taken with their results. Its only write is a poke request (p), so it is safe to leave open beside the running service.

Install

uv tool install watchglass
# (Windows installs get pywinpty automatically; `watchglass[conpty]` still works as an alias.)
watchglass init                 # config, watches directory, AGENTS.md
watchglass new hello            # a commented Python watch
watchglass validate hello
watchglass poll hello --dry-run
watchglass install              # start the service at login (systemd user service / Windows logon task)

Supported: Linux with systemd, and Windows 10/11 (Task Scheduler; hooks in PowerShell, Python or any program). On Windows, watchglass new <name> --template powershell starts a PowerShell watch, and watchglass stop stops the service.

Upgrading from keepwatch

watchglass is the new name for this project; the PyPI name keepwatch was taken. Stop the old service before installing the new one, or the first command will refuse to move its configuration:

keepwatch stop
systemctl --user disable --now keepwatch.service   # Linux; Windows: remove the old logon task/shortcut
uv tool uninstall keepwatch
uv tool install watchglass

The first watchglass command moves ~/.config/keepwatch and ~/.local/state/keepwatch (or their Windows equivalents) to the watchglass paths once, renames the old logs so watchglass logs still shows them, and then watchglass install registers the new service. Run-only data is not carried over. Environment variables are renamed too: KEEPWATCH_* becomes WATCHGLASS_* in scripts and service environments. Watch code needs the same change: from keepwatch import ... becomes from watchglass import ..., and hooks that run the old command or read the old variables must use the new names. watchglass init does not overwrite the old AGENTS.md/CLAUDE.md in the watches directory; delete them to have watchglass write the current ones. See watchglass docs storage for the paths.

Learn more

watchglass tui            # a live view of every watch (`p` pokes a watch)
watchglass docs           # list the reference topics
watchglass docs agent     # the contract for writing a watch (start here)
watchglass docs --all     # everything

Development

uv sync
uv run pytest -q
uv run ruff check src tests
uv run ty check src     # types; the tests are typed only as far as ruff and pytest require

The design is in docs/superpowers/specs/; the implementation plans are in docs/superpowers/plans/.

License

MIT

Metadata

Release files for watchglass 2026.11.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for watchglass 2026.11.2
File Size Uploaded Provenance Actions
watchglass-2026.11.2.tar.gz 705.0 kB With provenance Details for watchglass-2026.11.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for watchglass 2026.11.2
File Interpreter ABI Platform Actions
watchglass-2026.11.2-py3-none-any.whl Python 3 none any Details for watchglass-2026.11.2-py3-none-any.whl

Total release size: 942.6 kB

Release files / watchglass-2026.11.2.tar.gz

Download URL watchglass-2026.11.2.tar.gz
Size 705.0 kB
Tags Source
SHA-256 checksum
How to use checksums
7a59fe68a9023ab9c213cc6677e9ac29ccf076126b1b6739997b5a5e058d2b2e
BLAKE2b-256 checksum
How to use checksums
54de750a14e435a85ec7e34a83db5eb3809777ab47de0e76f56578727ede8144
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Release files / watchglass-2026.11.2-py3-none-any.whl

Download URL watchglass-2026.11.2-py3-none-any.whl
Size 237.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7c22d93fdc86926d44c83f1c376a92db4aaca2377f32249fc7145b05c39a6c30
BLAKE2b-256 checksum
How to use checksums
452a9ac4d470eeb38de17f754be0e9d76b84610a168ac29ecb11079806bc1027
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

Security for watchglass 2026.11.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for watchglass-2026.11.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page