This is a Chrome extension that adds a "Save all files" button to the Pybricks Code interface. This allows you to save all your open files as plain Python source code to a local directory on your computer, which is a convenient alternative to archiving them into a zip file.
- Adds a "Save all files" button to the Pybricks Code UI.
- Saves all open files to a user-selected directory.
- Files are saved as plain
.pysource files.
You need to have Node.js and its package manager, npm, installed on your system. npm is included with Node.js.
- Go to the official Node.js website: https://nodejs.org/
- Download the LTS (Long Term Support) version installer for Windows.
- Run the installer (
.msifile) and follow the on-screen instructions. The installer will add Node.js and npm to your system's PATH.
Using a version manager like nvm (Node Version Manager) is recommended as it allows you to easily switch between Node.js versions.
- Open your terminal and install nvm by running the install script from the nvm GitHub page. It will look something like this:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash - The script will update your shell profile (
~/.bash_profile,~/.zshrc,~/.profile, or~/.bashrc). You may need to close and reopen your terminal for the changes to take effect. - Install the latest LTS (Long-Term Support) version of Node.js:
nvm install --lts
- Use the installed LTS version for your current session:
nvm use --lts
After installation, open a new terminal or command prompt and verify that Node.js and npm are installed correctly by running:
node -v
npm -vYou should see the version numbers for both Node.js and npm printed to the console.
Clone this repository and navigate into the project directory. Then, install the required dependencies using npm:
npm installBuild the extension from the source code. A common command for this is:
npm run buildThis will create a dist directory (or similar, depending on the project setup) containing the bundled extension files.
- Open Google Chrome and navigate to
chrome://extensions. - Enable "Developer mode" using the toggle switch in the top-right corner.
- Click on the "Load unpacked" button.
- Select the
distdirectory from this project.
The extension should now be installed and active.
- Navigate to code.pybricks.com.
- You will see a new "Save all files" button with a cloud download icon next to the "Archive project" button.

- Click the "Save all files" button.
- A directory picker dialog will appear. Choose a directory where you want to save your files.
- After selecting a directory, all your open files in the Pybricks editor will be saved as individual
.pyfiles in that location.
Happy coding!