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
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
Boards are identified by USB VID/PID. The canonical registry:
{{#include ../_snippets/hardware-boards.md}}
The board value in [[peripherals.boards]] is matched against these registry
names (and a few transport-specific aliases such as arduino-uno-q / rpi-gpio
handled in peripherals/mod.rs).
Boards are configured under peripherals and peripherals.boards. 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. PDF datasheets are also indexed when ZeroClaw is built with the rag-pdf feature (this enables general PDF text extraction, not a hardware-specific capability; see Tools). Either way the files are extracted, chunked, and retrieved into the agent's context for board-specific questions.
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
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