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.

Layout

host/
├── pyproject.toml
├── andon_light/
│   ├── cli.py               # argparse entry point, `andon-light` command
│   ├── device_discovery.py  # finds the board by USB vendor ID
│   ├── serial_link.py       # opens/writes the serial connection, retry-on-busy
│   ├── hooks_install.py     # `andon-light install-hooks` merge/confirm logic
│   └── data/
│       ├── settings.snippet.json   # bundled copy for installed/frozen builds (Claude Code)
│       └── codex.hooks.json        # bundled copy for installed/frozen builds (Codex CLI)
└── tests/
    └── test_hooks_install.py

Install (development)

For actually using the CLI (Claude Code hooks, manual andon-light calls), install the published package instead — see ../packaging/linux/README.md (Linux) or ../packaging/windows/README.md (Windows). macOS isn't tested or supported yet.

To develop this repo, install in editable mode — symlinks back to source, so edits show up immediately without reinstalling:

cd host
pipx install --editable .

For an isolated venv, not on PATH outside it:

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

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 (default agent)
andon-light install-hooks --agent codex          # merge Codex CLI hooks into hooks.json instead
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 vs. project scope, and warns before overwriting any hook event you've already customized. It never edits silently. --agent selects which agent's hooks and config file to target:

--agent Global scope Project scope Rationale
claude (default) ~/.claude/settings.json ./.claude/settings.json See ../hooks/claude/README.md
codex ~/.codex/hooks.json ./.codex/hooks.json See ../hooks/codex/README.md

Both agents drive the same firmware over the same wire protocol — this is a host-only integration, no firmware update needed either way.

Notes

  • Auto-detection (device_discovery.py) filters by USB vendor ID 0x2E8A (Raspberry Pi Foundation, used by arduino-pico's default TinyUSB descriptor) — matches the Waveshare RP2040-Zero.
  • 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) has the port open — only one process can hold it at a time. andon-light retries automatically for ~450ms before giving up; a serial failure then prints a one-line message with exit code 1 instead of a raw Python traceback.

Metadata

Release files for andon-light 0.2.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 andon-light 0.2.1
File Size Uploaded Provenance
andon_light-0.2.1.tar.gz 11.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for andon-light 0.2.1
File Interpreter ABI Platform
andon_light-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.5 kB

Release files / andon_light-0.2.1.tar.gz

Download URL andon_light-0.2.1.tar.gz
Size 11.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fb8053a346f9d6d10b42f7e9315638a15917436ac5879aa1b1676fe22cfcf79a
BLAKE2b-256 checksum
How to use checksums
13c1cf7bd06f85cdb796a81915998beacebb844c552b7e6e0fbd5bbcf724449a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / andon_light-0.2.1-py3-none-any.whl

Download URL andon_light-0.2.1-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1f0fe9da23dd3dc00e4dad207fde50141ea104f52b015aeb78b928a5ba70f39
BLAKE2b-256 checksum
How to use checksums
795f40cf005aa825a3131f8dd3cf1be92579766d54d889b67d373deaf21b2b1a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for andon-light 0.2.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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