Pybricks Runner for VSCode

Pybricks Runner is an VSCode extension that allows you to easily program and run your LEGO SPIKE Prime, EV3, and other Pybricks-compatible bricks directly from Visual Studio Code using the pybricksdev
command-line tool.
Features
- One-click programming: Easily program your LEGO brick directly from the VSCode editor.
- Simple integration: Runs the
pybricksdev run
command directly in the integrated VSCode terminal.
- Immediate feedback: Quickly see output and errors directly within VSCode.
Screenshots

🎥 Demo
🚀 Flash Your Robot

- Open a
.py
file (e.g. main.py
)
- Click the 🚀
Run on <RobotName>
button in the status bar
- The terminal launches and executes:
pybricksdev run ble --name "YourRobot" main.py
⚙️ Select or Change Robot Name

- Click the ⚙️
Select or Change Robot
button top right or Press Ctrl+Shift+P → Select LEGO Robot
- Choose from the list in .robotNameList or enter a custom name
- .robotName is updated
- Status bar updates instantly
🛠️ Installation
Prerequisites
🛠️ Installation
🧩 From VS Code Marketplace (Recommended for VS Code)
Install directly from the Visual Studio Code Marketplace:

- Open VS Code
- Go to Extensions (
Ctrl+Shift+X
)
- Search for
pybricks-runner
- Click Install
🌐 From Open VSX (For VSCodium, code-server, Theia, etc.)
Install from Open VSX:

Manual Installing for development
- Clone or download this repository:
git clone https://github.com/yourusername/pybricks-runner-vscode.git
- Open the folder in VSCode:
cd pybricks-runner-vscode
code .
- Install dependencies and package the extension:
npm install -g vsce
npm install
vsce package
- Install as below
code --install-extension pybricks-runner-<version>.vsix
Or Install the .vsix
extension file from VSCode:
- Open VSCode
- Go to Extensions (
Ctrl+Shift+X
)
- Click on
...
and select "Install from VSIX"
- Select the generated
.vsix
file
Usage
- Open a Python (
.py
) file intended for LEGO Pybricks.
- Click on the "🚀 Run on LEGO Brick" button at the top right corner.
The extension will execute:
pybricksdev run yourfile.py
🧩 Troubleshooting
Error: 'pybricksdev' not found
Make sure you've installed it globally using pip install pybricksdev
.
Robot not connecting
Ensure Bluetooth is enabled and your robot is turned on. Try re-pairing via your OS.
Web Bluetooth not available
Check if you're using a Chromium browser and have enabled the chrome://flags/#enable-web-bluetooth
flag.
Requirements
- Node.js LTS (18.x recommended)
- Python installed and configured (
pybricksdev
)
- Supported LEGO hardware (EV3, SPIKE Prime, etc.)
✅ Web Bluetooth Setup for VSCode & code-server:
To enable Web Bluetooth:
Open Chrome Flags:
Go to chrome://flags/#enable-web-bluetooth
and set it to Enabled.
Use HTTPS or localhost:
Web Bluetooth only runs in secure contexts.
Browser Compatibility:
Ensure you're using a Chromium-based browser (Chrome, Edge).
After enabling the flag, reload your VSCode web interface. Web Bluetooth functionality will then be available and reliable.
🙌 Contributing
Contributions are welcome! Feel free to open issues, submit pull requests, or suggest enhancements.
- Fork this repository.
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request.
📜 License
Distributed under the MIT License. See LICENSE
for more information.
Happy Building!