docs/book/src/hardware/adding-boards-and-tools.md
This guide explains how to add new hardware boards and custom tools to ZeroClaw.
# Add a board (updates ~/.zeroclaw/config.toml)
zeroclaw peripheral add nucleo-f401re /dev/ttyACM0
zeroclaw peripheral add arduino-uno /dev/cu.usbmodem12345
zeroclaw peripheral add rpi-gpio native # for Raspberry Pi GPIO (Linux)
# Restart daemon to apply
zeroclaw daemon --host 127.0.0.1 --port 42617
| Board | Transport | Path Example |
|---|---|---|
| nucleo-f401re | serial | /dev/ttyACM0, /dev/cu.usbmodem* |
| arduino-uno | serial | /dev/ttyACM0, /dev/cu.usbmodem* |
| arduino-uno-q | bridge | (Uno Q IP) |
| rpi-gpio | native | native |
| esp32 | serial | /dev/ttyUSB0 |
Boards are configured under [peripherals] and [[peripherals.boards]] in ~/.zeroclaw/config.toml. See the Config reference for the full field index, including datasheet_dir (RAG source).
Place .md or .txt files in docs/datasheets/ (or your datasheet_dir). Name files by board: nucleo-f401re.md, arduino-uno.md.
Add a ## Pin Aliases section so the agent can map "red led" → pin 13:
# My Board
## Pin Aliases
| alias | pin |
|-------------|-----|
| red_led | 13 |
| builtin_led | 13 |
| user_led | 5 |
Or use key-value format:
## Pin Aliases
red_led: 13
builtin_led: 13
With the rag-pdf feature, ZeroClaw can index PDF files:
cargo build --features hardware,rag-pdf
Place PDFs in the datasheet directory. They are extracted and chunked for RAG.
docs/datasheets/my-board.md with pin aliases and GPIO info.zeroclaw peripheral add my-board /dev/ttyUSB0Peripheral trait in crates/zeroclaw-hardware/src/peripherals/ and register in create_peripheral_tools.See docs/hardware/hardware-peripherals-design.md for the full design.
Tool trait in crates/zeroclaw-tools/src/.create_peripheral_tools (for hardware tools) or the agent tool registry.tool_descs in crates/zeroclaw-runtime/src/agent/loop_.rs.See the generated CLI reference for zeroclaw peripheral and zeroclaw hardware subcommands.
/dev/cu.usbmodem*; on Linux use /dev/ttyACM0 or /dev/ttyUSB0.cargo build --features hardwarecargo build --features hardware,probe