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.3

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.3
File Size Uploaded Provenance Actions
watchglass-2026.11.3.tar.gz 706.6 kB With provenance Details for watchglass-2026.11.3.tar.gz

Built distribution (wheel)

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

Total release size: 944.6 kB

Release files / watchglass-2026.11.3.tar.gz

Download URL watchglass-2026.11.3.tar.gz
Size 706.6 kB
Tags Source
SHA-256 checksum
How to use checksums
022c0f3c1e2c163a5a27812df1f6aca30a253aa6c191d14fc7e42f1f0118b5c3
BLAKE2b-256 checksum
How to use checksums
57629a4abab709132f485f835095204d1e56e2b383b8b642a36f561dd2622f4e
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 3, 2026.

Transparency log

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

Download URL watchglass-2026.11.3-py3-none-any.whl
Size 238.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4c9231ff77047b2709869f31092741b470886d5d5ec08e64aec2f8e61da73408
BLAKE2b-256 checksum
How to use checksums
0983c2bf76f8f37a88d1bd3f5897b3e2dd12bcd7d79a8046e0435844ed9ae3a3
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 3, 2026.

Transparency log

Security for watchglass 2026.11.3

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.3.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 3, 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