Arduino CLI Plugin for Claude Code
A Claude Code plugin that enables Claude to create, compile, and upload Arduino projects using the arduino-cli command-line tool.
Features
- 5 slash commands for the complete Arduino workflow: create sketches, compile, upload, manage boards, and install libraries
- Auto-activating skill that gives Claude Arduino domain knowledge whenever you discuss embedded development
- Automatic board detection that identifies connected Arduino hardware and resolves the correct FQBN (Fully Qualified Board Name)
- Smart core management that auto-installs platform cores when needed
- Comprehensive reference library covering 30+ boards, troubleshooting guides, and reusable code patterns
Prerequisites
| Requirement | Details |
|---|
| arduino-cli | Install from arduino.github.io/arduino-cli |
| Python 3 | Used by helper scripts for JSON parsing (pre-installed on macOS) |
| Claude Code | The Claude Code CLI tool |
| Arduino board | Any supported board: Arduino AVR (Uno, Nano, Mega), SAMD (MKR, Zero), Renesas (UNO R4), ESP32, ESP8266, Adafruit, Raspberry Pi Pico, STM32, and more |
Verify arduino-cli is installed:
arduino-cli version
Installation
Load the plugin when launching Claude Code:
claude --plugin-dir /path/to/this/plugin
For example:
claude --plugin-dir ~/Desktop/claude-arduino-skill
Permissions
The plugin includes a .claude/settings.local.json that pre-approves the following operations so you don't get prompted for each command:
- All
arduino-cli subcommands (compile, upload, sketch new, core install, lib install, etc.)
- Execution of the plugin's helper scripts
- Basic file operations (ls, mkdir, cat, chmod)
You can review and modify these permissions in .claude/settings.local.json.
Quick Start
Get from zero to a blinking LED in 6 steps:
1. Connect Your Board
Plug your Arduino board into a USB port.
2. Verify Detection
/arduino-boards
This lists all connected boards with their port, FQBN, and installed platform cores.
3. Create a Sketch
/arduino-new Blink
This creates a Blink/Blink.ino file with Arduino boilerplate. You can also describe what you want:
"Create an Arduino sketch that blinks the built-in LED every 500ms and prints the uptime to serial"
Claude will generate the appropriate code automatically.
4. Compile
/arduino-build Blink
The command auto-detects your connected board's FQBN and installs the platform core if needed. On success, it reports flash and RAM usage.
5. Upload
/arduino-upload Blink
Compiles the sketch (ensuring it's up to date) and uploads it to the detected board. On success, it suggests opening a serial monitor.
6. Monitor (Optional)
After upload, you can monitor serial output:
arduino-cli monitor -p /dev/cu.usbmodem* -c baudrate=9600
Commands Reference
/arduino-new
Create a new Arduino sketch project.
Syntax:
/arduino-new <sketch-name>
Behavior:
- Creates a sketch directory with a
.ino file using arduino-cli sketch new
- If you described functionality in the conversation, Claude replaces the boilerplate with working code
- Detects connected boards and reports the FQBN for building
- Suggests next steps (
/arduino-build, /arduino-upload)
Examples:
/arduino-new TemperatureLogger
/arduino-new MotorController
/arduino-build
Compile an Arduino sketch for a target board.
Syntax:
/arduino-build [sketch-path] [--fqbn <FQBN>]
Arguments:
| Argument | Required | Description |
|---|
sketch-path | No | Path to sketch directory or .ino file. If omitted, searches the current directory. |
--fqbn <FQBN> | No | Target board FQBN (e.g., arduino:avr:uno). If omitted, uses the detected board. |
Behavior:
- Finds the sketch -- searches current directory for
.ino files if no path given
- Resolves the board -- uses the
--fqbn argument, detected board, or asks you
- Installs the platform core if not already installed (e.g.,
arduino:avr, esp32:esp32)
- Compiles and reports flash/RAM usage
- On errors -- analyzes compilation errors, identifies issues in source code, and suggests or applies fixes. If libraries are missing, suggests
/arduino-libs.
Examples:
/arduino-build
/arduino-build MySketch
/arduino-build MySketch --fqbn arduino:avr:nano
/arduino-upload
Upload a compiled sketch to a connected Arduino board.
Syntax:
/arduino-upload [sketch-path] [--port <port>] [--fqbn <FQBN>]
Arguments: