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. It is read-only, 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 (read-only)
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.1

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.1
File Size Uploaded Provenance Actions
watchglass-2026.11.1.tar.gz 702.7 kB With provenance Details for watchglass-2026.11.1.tar.gz

Built distribution (wheel)

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

Total release size: 938.4 kB

Release files / watchglass-2026.11.1.tar.gz

Download URL watchglass-2026.11.1.tar.gz
Size 702.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1028bcea85d598d2999babc4023fcd3522770e06a8ab5eaf5ec01107d2bad0e8
BLAKE2b-256 checksum
How to use checksums
046b9d5c52a01ec6b6ed66db9917f9477e72e4c99950048eaf4a83a543ca681e
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 1, 2026.

Transparency log

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

Download URL watchglass-2026.11.1-py3-none-any.whl
Size 235.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
df4a0dd9ec9fbc18da8c43579828f3bb2f57bc8bf3270d6ff240197588a8bac2
BLAKE2b-256 checksum
How to use checksums
361094f8cda97df798af469fc9734b506b14a78eebae719f24cade319def648d
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 1, 2026.

Transparency log

Security for watchglass 2026.11.1

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