Arduino CLI for VSCode
A lightweight VSCode extension for Arduino development based on Arduino CLI, providing a complete Arduino development experience.

📖 中文文档
✨ Features
Project-Based Development
All library dependencies and build output files are stored within the project directory, not scattered across arduino15 or other user directories.
🔧 Core Features
- Build & Upload - One-click compile and upload Arduino projects
- Board Management - Support for Arduino, ESP32, ESP8266, STM32, and more
- Library Management - Search, install, and uninstall Arduino libraries
- IntelliSense - Auto-generate C++ IntelliSense configuration
- Boards & Ports - View connected devices and available ports
- Board Manager - Manage board platforms
- Library Manager - Manage installed libraries
⌨️ Keyboard Shortcuts
| Shortcut |
Function |
Ctrl+Alt+B |
Build project |
Ctrl+Alt+U |
Upload to board |
Ctrl+Alt+M |
Open serial monitor |
Ctrl+Alt+R |
Refresh board list |
Ctrl+Alt+Shift+B |
Select board |
Ctrl+Alt+Shift+P |
Select port |
Mac users: Use Cmd instead of Ctrl
📥 Installation
Prerequisites
Install Arduino CLI
Download and install from Arduino CLI official website.
Windows (using winget):
winget install ArduinoSA.ArduinoCLI
macOS (using Homebrew):
brew install arduino-cli
Linux:
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
Initialize Arduino CLI
arduino-cli config init
arduino-cli core update-index
🚀 Quick Start
1. Initialize Project
- Open a folder as workspace
- Press
Ctrl+Shift+P to open command palette
- Run
Arduino: Initialize Project
- Enter project name,
.ino file will be created automatically
2. Select Board and Port
- Click the Arduino icon in the sidebar
- Select board and port in the Boards & Ports panel
- Or use commands
Arduino: Select Board and Arduino: Select Port
3. Build and Upload
- Click the ▶️ button in the top-right corner of the editor, or
- Use shortcuts
Ctrl+Alt+B to build, Ctrl+Alt+U to upload
4. Serial Monitor
- Use
Ctrl+Alt+M to open serial monitor (WebView mode by default)
- Supports baud rate switching, line ending settings, timestamp display
- Two modes available: WebView (GUI) and Terminal
⚙️ Configuration
Search arduino in VS Code settings to view all configuration options.
Basic Configuration
| Setting |
Description |
Default |
arduino.cliPath |
Arduino CLI path |
arduino-cli |
arduino.autoDetectCli |
Auto-detect CLI path |
true |
arduino.autoSaveBeforeBuild |
Auto-save before build |
true |
Build Configuration
| Setting |
Description |
Default |
arduino.build.outputPath |
Build output directory |
.arduino/build |
arduino.build.exportBinaries |
Auto-export binary files |
true |
arduino.build.verbose |
Show verbose build info |
true |
Serial Configuration
| Setting |
Description |
Default |
arduino.serial.baudRate |
Default baud rate |
9600 |
arduino.serial.lineEnding |
Line ending setting |
lf |
arduino.serial.monitorMode |
Monitor mode |
webview |
arduino.serial.autoScroll |
Auto scroll |
true |
arduino.serial.showTimestamp |
Show timestamp |
false |
Third-Party Boards
Add third-party board index URLs in arduino.boardManager.additionalUrls:
{
"arduino.boardManager.additionalUrls": [
"https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json",
"https://arduino.esp8266.com/stable/package_esp8266com_index.json"
]
}
Common URLs:
- ESP32:
https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
- ESP8266:
https://arduino.esp8266.com/stable/package_esp8266com_index.json
- STM32:
https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
📋 Command List
Press Ctrl+Shift+P to open command palette, type Arduino to see all commands:
Project Management
| Command |
Description |
Arduino: Initialize Project |
Initialize Arduino project |
Arduino: Generate IntelliSense Config |
Generate IntelliSense configuration |
Build & Upload
| Command |
Description |
Arduino: Build |
Build project |
Arduino: Upload |
Upload to board |
Arduino: Export Compiled Binary |
Export compiled binary files |
Arduino: Clean Build |
Clean build cache |
Arduino: Open Build Folder |
Open build output directory |
Board Management
| Command |
Description |
Arduino: Select Board |
Select target board |
Arduino: Select Port |
Select serial port |
Arduino: Configure Board Options |
Configure board options |
Arduino: Refresh Boards |
Refresh board list |
Arduino: Install Board Platform |
Install board platform |
Arduino: Manage Installed Platforms |
Manage installed platforms |
Arduino: Add Board Manager URL |
Add third-party board URL |
Arduino: Update Board Index |
Update board index |
Library Management
| Command |
Description |
Arduino: Search Library |
Search libraries |
Arduino: Install Library |
Install library |
Arduino: Uninstall Library |
Uninstall library |
Arduino: Install Missing Libraries |
Install missing libraries |
Arduino: Update Library Index |
Update library index |
Serial Monitor
| Command |
Description |
Arduino: Open Serial Monitor |
Open serial monitor |
Arduino: Close Serial Monitor |
Close serial monitor |
Arduino: Change Baud Rate |
Change baud rate |
Arduino: Switch Serial Monitor Mode |
Switch monitor mode |
CLI Configuration
| Command |
Description |
Arduino: Configure CLI Path |
Configure CLI path |
Arduino: Auto Detect CLI |
Auto-detect CLI |
Arduino: Show CLI Version |
Show CLI version |
📁 Project Structure
When using this extension, your project will have the following structure:
my-project/
├── my-project.ino # Arduino main program
├── .arduino/
│ ├── config.json # Project configuration (board, port, etc.)
│ └── build/ # Build output directory
└── .vscode/
└── c_cpp_properties.json # IntelliSense configuration (auto-generated)
Project Configuration File
.arduino/config.json stores board and port configuration:
{
"board": "esp32:esp32:esp32",
"port": "COM3",
"boardOptions": {
"FlashFreq": "80",
"UploadSpeed": "921600"
}
}
🔧 Troubleshooting
CLI Not Found
Arduino CLI not configured or path invalid
Solution:
- Run
Arduino: Auto Detect CLI for auto-detection
- Or run
Arduino: Configure CLI Path to configure manually
Board Not Recognized
Solution:
- Run
Arduino: Update Board Index to update index
- Ensure third-party board URLs are added
- Run
Arduino: Install Board Platform to install the platform
Build Failed
Solution:
- Check if the correct board is selected
- Run
Arduino: Install Missing Libraries to install missing libraries
- Check output panel for detailed error messages
Upload Failed
Solution:
- Ensure correct port is selected
- Close other programs using the serial port (including serial monitor)
- Check USB connection and drivers
📄 License
MIT License - See LICENSE file for details