How to add "platformio" / "pio" shortcut on Linux command line
Typically, when you want to use the pio executable from PlatformIO, you need to first activate the virtual environment using
activate_platformio_bash.sh
source ~/.platformio/penv/bin/activateHowever, you can easily create a shortcut using a shell alias using:
For bash:
activate_platformio_zsh.sh
echo -e '\nalias platformio="source ~/.platformio/penv/bin/activate"\n' >> ~/.bashrcFor zsh:
run_platformio.sh
echo -e '\nalias platformio="source ~/.platformio/penv/bin/activate"\n' >> ~/.zshrcNote that in order for the change to take effect, you need to restart your shell(or open a new shell).
Now you can use run
example.sh
platformioand you’ll immediately have access to pio and other PlatformIO tools.
Check out similar posts by category:
PlatformIO
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow