Thonny is the recommended way of working with a Pico and MicroPython as it has built-in support for running and uploading files. However, I wanted to use Visual Studio Code as my code editor and upload files via the command line instead. I found two CLI tools that I could use to achieve this: rshell and ampy.
rshell provides a shell that runs on the Pico. It can be downloaded using pip:
pip3 install rshell
To connect to the Pico:
rshell -p /dev/ttyXXXX --buffer-size 512
Where ttyXXXX
is the serial port that your Pico is connected to. You can find the…