Skip to main content

Agent-friendly serial diagnostics and repeatable hardware workflows

Project description

baud-cli

CI PyPI Python

baud-cli provides the baud command: a small serial CLI designed for coding agents and repeatable embedded-hardware debugging. It turns the recurring one-off pyserial scripts into guarded YAML workflows with deterministic exit codes, JSON/JSONL output, raw-byte evidence, and automatically archived logs.

Install

baud-cli requires Python 3.10 or newer. The runtime dependencies are pyserial and PyYAML; uv is the recommended installer but is not a runtime requirement.

Install the published command on Windows, macOS, or Linux:

uv tool install baud-cli
baud --help

Install from a checkout while developing:

uv tool install --editable .
baud --help

For development:

uv sync --extra dev
uv run baud --help

For use from any firmware repository, install the CLI as a user tool and install the bundled Codex Skill from this checkout:

uv tool install --editable .
uv tool update-shell
uv run python tools/install_skill.py
uv run python tools/install_skill.py --check --json

The Skill source remains under .agents/skills/baud; the installer copies that source to ~/.agents/skills/baud. It refuses to overwrite a different installed copy unless --force is explicitly supplied.

Platform support

The serial transport uses pyserial and has no OS-specific code. CI is configured for Python 3.10 and 3.13 on Windows, macOS, and Linux, including a real pyserial loop:// round trip through the CLI.

Platform Typical port Notes
Windows COM5 USB serial drivers provide the COM port.
macOS /dev/cu.usbserial-* or /dev/cu.usbmodem* Prefer /dev/cu.* for outbound CLI sessions.
Linux /dev/ttyUSB0 or /dev/ttyACM0 The user needs permission to open the device.

On Linux, add the user to the serial-device group used by the distribution, commonly dialout or uucp, then start a new login session. USB drivers, device permissions, and DTR/RTS reset wiring remain platform and hardware concerns even though the CLI itself is portable.

Core commands

The examples use a Windows port name; replace COM14 with the connected /dev/cu.* or /dev/tty* device on macOS or Linux.

uv run baud list --json
uv run baud monitor --port COM14 --duration 30 --json
uv run baud send --port COM14 status --wait 2 --require-response --json
uv run baud probe --port COM14 --commands help status ? --endings crlf lf --json
uv run baud run examples/wash_test.yaml --json

probe follows the diagnostic pattern seen in real agent sessions: listen first, preserve raw bytes, then try harmless commands with multiple line endings. It distinguishes a responsive device from a device that transmits a startup banner but never processes PC-to-device commands.

Guarded hardware actions

A dangerous action must name successful earlier steps. The CLI refuses to load a dangerous step with no guards, and it never transmits the action if a required assertion failed:

- id: sensor_snapshot
  send: sensor_i2c_status
  wait: 3
  expect:
    contains: ["target=164"]

- id: start_wash
  send: wash_start
  dangerous: true
  requires: [sensor_snapshot]

The complete guarded example is in examples/wash_test.yaml.

Exit codes

Code Meaning
0 Workflow or diagnostic command completed
2 Step or guard failed
3 Assertion failed
4 Port missing, busy, disconnected, or unreadable
5 Timeout
6 Encoding or protocol error
7 Workflow configuration error

Every active serial command closes the port through a context manager, even after an assertion or I/O failure. By default, human-readable .log and machine-readable .jsonl artifacts are written under logs/; use --no-log only for disposable checks.

Project details


Download files

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

Source Distribution

baud_cli-0.1.0.tar.gz (43.3 kB view details)

Uploaded Source

Built Distribution

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

baud_cli-0.1.0-py3-none-any.whl (16.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: baud_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 43.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for baud_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7d7ec3c0da1a8ac336b57d58eb6ac913d411f717fca38c36dd0aa2d38fe4e78c
MD5 541fd5acc019d1418c02ace3d7729832
BLAKE2b-256 f4b022d13f551a5456bf5d18129f55eea8f8e5573193a475d053a4c531178466

See more details on using hashes here.

File details

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

File metadata

  • Download URL: baud_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for baud_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 46bce6091e9d9134e767b94faff66d2014a096ba2f51daec37f0b7ea141f9e0f
MD5 7277450d2e25a5bd34e6f61664938303
BLAKE2b-256 608a119e237662dc4189710cda07b313e9d97ff2c56d78232f46404e7a5a5cc8

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