Overview Version History Q & A Rating & Review
Pybricks Runner for VS Code
Pybricks Runner is a VS Code extension that allows you to easily program and run your LEGO SPIKE Prime, EV3, and other Pybricks-compatible robots directly from Visual Studio Code using the pybricksdev command-line tool.
Features
One-click programming: Run your Python code on LEGO robots with a single click
Activity bar integration: Dedicated sidebar with device management
Device scanning: Automatically detect nearby LEGO robots
Simple integration: Uses the pybricksdev CLI tool via VS Code terminal
Immediate feedback: See output and errors directly in the integrated terminal
Easy robot selection: Quickly switch between different robots
Screenshots
Prerequisites
Visual Studio Code
Python 3.8 or higher installed on your machine
pybricksdev installed on your machine
Bluetooth enabled on your computer
Installing pybricksdev
macOS / Linux
pip install pybricksdev
# or
pip3 install pybricksdev
# Verify installation
pybricksdev --version
Windows
pip install pybricksdev
# or
python -m pip install pybricksdev
# Verify installation
pybricksdev --version
Verify Bluetooth Connectivity
After installing pybricksdev, test if your hub is detected:
pybricksdev devices
This should list your SPIKE Prime or other LEGO hubs if they're turned on and Bluetooth is enabled.
Installation
From VS Code Marketplace
Open VS Code
Go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
Search for pybricks-runner
Click Install
From VSIX File
Download the .vsix file from Releases
In VS Code, go to Extensions (Ctrl+Shift+X / Cmd+Shift+X)
Click ... → Install from VSIX...
Select the downloaded .vsix file
Usage
Running Your Program
Open a Python (.py) file for Pybricks
Click the 🚀 Run on LEGO Brick button in the editor title bar (top right)
Or click the status bar button (bottom left)
Or use Command Palette: Pybricks: Run on Robot
The terminal will open and execute: pybricksdev run ble --name "YourRobot" yourfile.py
Click the Pybricks icon in the Activity Bar (left sidebar)
View the Devices panel to see:
Currently selected robot
Available devices (click refresh to scan)
Click on a device to select it
Selecting a Robot
Method 1: Via Sidebar
Click the Pybricks icon in the Activity Bar
Click on any device in the "Devices" view to select it
Method 2: Via Command
Click the 🔧 Select LEGO Robot button in the editor title bar
Choose from the saved list or select "Custom..." to add a new robot
Enter your robot's name (e.g., Pybricks, SPIKE, MyRobot)
Troubleshooting
Error: 'pybricksdev: command not found'
This means pybricksdev is not installed. Install it with:
pip install pybricksdev
If still not working:
macOS/Linux: Check if Python's bin directory is in your PATH
Windows: Restart VS Code after installation, or add Python Scripts folder to PATH
Robot not connecting
Ensure Bluetooth is enabled on your computer
Turn on your SPIKE Prime hub
Click the refresh button in the Devices sidebar to scan
Run pybricksdev devices in terminal to check if the hub is detected
Try re-pairing the hub via your OS Bluetooth settings
Click the refresh button in the Devices panel
Make sure pybricksdev is installed correctly
Ensure Bluetooth is enabled
Make sure your robot is turned on and nearby
Contributing
Contributions are welcome! Feel free to open issues or submit pull requests.
Fork this repository
Create your feature branch: git checkout -b my-feature
Commit your changes: git commit -am 'Add feature'
Push to the branch: git push origin my-feature
Submit a pull request
License
Distributed under the MIT License. See LICENSE for more information.
Happy Building!