Skip to main content

Host CLI — andon-light

Python driver for the Agent Andon Light. Talks to the firmware (../device/firmware/) over USB CDC serial via a simple text wire protocol.

Install

For local development/testing (isolated venv, not on PATH outside it):

cd host
python3 -m venv .venv
.venv/bin/pip install -e .

For real use — e.g. so Claude Code hooks can call andon-light — install it globally on PATH via pipx (sudo apt install -y pipx if you don't have it):

cd host
pipx install --editable .

--editable is right if you're actively developing this repo — it symlinks back to the source, so edits show up immediately without reinstalling. If you're setting this up for someone who just wants a working device, not editing the code, drop --editable:

cd host
pipx install .

A plain install copies the package into pipx's own store, so it keeps working even if the source folder is later moved or deleted. --editable would silently break in that case, since it only points back at the original path.

Usage

andon-light doctor                             # detect the device
andon-light set working                        # solid green
andon-light set waiting                        # solid yellow
andon-light set idle                           # solid red
andon-light set compacting                      # flashing green
andon-light heartbeat                           # keepalive, no color change
andon-light --port /dev/ttyACM0 set working     # override auto-detection
andon-light install-hooks                       # merge Claude Code hooks into settings.json
andon-light install-hooks --yes --scope global  # same, non-interactive (used by the Windows installer)

install-hooks prints the exact hooks block before touching anything, asks for confirmation, lets you pick global (~/.claude/settings.json) vs project (./.claude/settings.json) scope, and warns before overwriting any hook event you've already customized. It never edits silently — see ../hooks/README.md.

Notes

  • Auto-detection (device_discovery.py) filters by USB vendor ID 0x2E8A (Raspberry Pi Foundation, used by arduino-pico's default TinyUSB descriptor) — confirmed correct (2026-07-07) against the real Waveshare RP2040-Zero via udevadm info; andon-light doctor finds it on the first try.
  • Override with --port or the ANDON_LIGHT_PORT env var if auto-detection picks the wrong port or finds nothing.
  • "Device or resource busy" means another process (e.g. Arduino IDE's Serial Monitor) still has the port open — only one process can hold it at a time. As of 2026-07-07, andon-light retries automatically for ~450ms before giving up, and any serial failure prints a clean one-line message with exit code 1 instead of a raw Python traceback.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

andon_light-0.1.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

andon_light-0.1.0-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file andon_light-0.1.0.tar.gz.

File metadata

  • Download URL: andon_light-0.1.0.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for andon_light-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7d3d0e15b2a472147e63a646e9dd05067ce0b8ed44dda80e39a9a2cf1beaa93b
MD5 1f43fa2a4968c1e589f1e73c9f9e535d
BLAKE2b-256 bc4d7537729af383dee16a2770d712e0b5cc8b51f6ef040901ad7b7d18813551

See more details on using hashes here.

File details

Details for the file andon_light-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: andon_light-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for andon_light-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8dfeeff5ff5153bc41406de5a94dad590976d49daa5de5d924fc18e0957e0aaf
MD5 cab58c1390e3af70e14af7b435df7135
BLAKE2b-256 63caed645b470ace99175b366d606ab1e2685a7807b76b5be654b7f0ccefd78d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page