BriCode
Code environment for Brian - the brain brick
Features
- Wi-Fi Upload & Run: Upload Python files directly to Brian over Wi-Fi and execute them remotely, with console output streamed live.
- Integrated Debugging (F5): Press F5 on a Python file to upload and run it on Brian - no
launch.json required.
- Multiple Upload Methods: Wi-Fi upload with run, Wi-Fi upload only, or USB/local folder copy.
- Device Discovery: Automatically scan your network to find available Brian devices.
- Console Streaming: View real-time program output and send interactive input from VS Code.
- Copy Current File to Brian: Instantly copy the file you are working on to your selected Brian folder with one click.
- Status Bar Button: Quick access to upload and run the current file from the VS Code status bar.
- Right-Click Upload: Upload a
.py, .wav, or .jpg/.jpeg file straight from the Explorer or an editor tab.
- Several Brians at Once: List the Brians of one robot in
brian-project.json; uploads and runs then go to all of them in parallel, with their output merged into one Debug Console.
- Install Brian Typing (autocompletion): Installs Brian's typing stubs globally via
python.analysis.extraPaths for IntelliSense in any Python project. The Control Panel shows install/update status.
Usage
Wi-Fi Upload & Run (Recommended)
Set up Brian's IP address:
- Use
BriCode: Discover Brian Devices to automatically find Brian on your network
- You can also use the
Connect to Brian (Wi-Fi) button in the Control Panel
Upload and run your code:
- Open a Python file (
.py)
- Press F5, or use the status bar's Upload and Run on Brian button
- No
launch.json is needed - BriCode uploads the active file to Brian over Wi-Fi and runs it, streaming output to the Debug Console
Other ways to send a file, if you don't want a debug session:
BriCode: Upload Current File - uploads without running
BriCode: Upload and Run Current File - uploads and runs in the background, without opening the Debug Console
- Right-click a
.py/.wav/.jpg/.jpeg file in the Explorer or an editor tab → Upload to Brian
View output:
- Debug Console output streams automatically when you start with F5 or
bricode.uploadAndRunDebug
- Otherwise, check the BriCode output channel and use
BriCode: Send Console Input to send input to a running program
Several Brians (one robot)
A project can name the Brians it belongs to, by their device name (the Wi-Fi name set on each Brian):
{
"version": 1,
"main": "main.py",
"targets": ["Master", "Rotace 1", "Rotace 2", "Vozik"],
"upload": { "exclude": ["role.py"] }
}
- All of them must be on the same Wi-Fi network as this computer (station mode, not each Brian's own access point).
- Upload Project, Run Project, F5, Upload and Run, Upload Current File and Upload to Brian then go to every listed Brian, for files inside the project. Files from outside the project still go to the selected Brian.
- Before uploading, BriCode finds every Brian by name (and stops if one is missing or two share a name). If programs are running on some of them, it asks once whether to stop them all.
- Runs open one debug session per Brian under a common parent; their output is merged into one Debug Console, each line prefixed with the Brian's name. Stop on the parent stops every Brian; type
@<name> text to send console input to one Brian (otherwise it goes to the first one).
BriCode: Check Project Brians shows each Brian's IP, battery and whether a program is running.
- To run on the selected Brian only, add
"targets": "selected" to a launch.json configuration.
USB/Local Folder Copy
- Open a file in VS Code.
- Use the Control Panel's Copy to SD Card section (or
BriCode: Copy Current File to Brian) to copy it.
- Select a Brian folder if prompted.
- Change the folder anytime via the Control Panel or
BriCode: Select Brian Folder.
Commands
Wi-Fi Commands
BriCode: Discover Brian Devices (bricode.discoverBrianDevices) - Scan network for Brian devices
BriCode: Set Brian IP Address (bricode.setBrianIp) - Manually configure Brian's IP address
BriCode: Upload Current File (bricode.uploadFile) - Upload file to Brian via Wi-Fi, without running it
BriCode: Upload and Run Current File (bricode.uploadAndRunFile) - Upload and execute file via Wi-Fi in the background
BriCode: Upload and Run Current File (Debug) (bricode.uploadAndRunDebug) - Upload and run via a debug session, streaming output to the Debug Console (same as pressing F5)
BriCode: Upload to Brian (bricode.uploadFileFromExplorer) - Upload a file selected in the Explorer or an editor tab
BriCode: Send Console Input (bricode.sendConsoleInput) - Send input to a running program
BriCode: Check Project Brians (bricode.checkProjectTargets) - Find the Brians listed in targets of brian-project.json and show their state
Local/USB Commands
BriCode: Copy Current File to Brian (bricode.copyCurrentFileToBrian) - Copy file to local Brian folder
BriCode: Select Brian Folder (bricode.selectBrianFolder) - Choose target folder for copying
BriCode: Install Brian typing (autocompletion) (bricode.downloadBrianTyping) - Install typing stubs for IntelliSense
BriCode: Toggle Debug Mode (bricode.toggleDebugMode) - Enable verbose logging
Configuration
Debug Configuration
Pressing F5 on a Python file works out of the box - BriCode registers a bricode debugger type and generates a default configuration (BriCode: Upload and Run (Wi-Fi), running ${file}) on the fly, so no launch.json is required.
If you'd rather pin a debug configuration to a specific file (instead of whatever's currently active), add one to launch.json via Add Configuration → BriCode, which inserts:
{
"type": "bricode",
"request": "launch",
"name": "BriCode: Upload and run current file",
"program": "${file}"
}
Change program to an absolute path if you want it to always run a particular file. Older launch.json entries with transport or runAfterUpload fields (from earlier BriCode versions) are no longer supported - USB transport and upload-without-run were moved to separate commands (see above); remove those fields if you see an error when starting the debug session.
Typing / Autocompletion
Typing installs into global storage and registers itself on python.analysis.extraPaths, so it's available in every Python project rather than just the one it was installed from. The Control Panel shows an Installed/Update badge (matching against the device's actual typing version is planned - it currently checks firmware version as a stand-in).
Troubleshooting
Wi-Fi Upload Issues
- Ensure Brian is connected to the same network as your computer
- Verify Brian's IP address with
BriCode: Discover Brian Devices
- Try toggling debug mode (
BriCode: Toggle Debug Mode) for verbose logging
Console Not Streaming
- Ensure you started with F5 or
BriCode: Upload and Run Current File (Debug) (not just "Upload" or the background "Upload and Run")
- Check the BriCode output channel (View → Output → Select "BriCode")
- Verify the program is actually running on Brian
License
Copyright (c) 2026 Jan Řehák
BriCode is licensed under the GNU General Public License v3.0 - see the LICENSE file included with the extension.
It includes third-party components under their own licenses, including the Codicons icons (CC-BY-4.0, Copyright (c) Microsoft Corporation). See THIRD_PARTY_NOTICES.md.