How to create new PlatformIO project on the command line

You can create a new PlatformIO project on the command line by running e.g.

pio project init --board esp32dev --ide vscode --sample-code

Note that all options (--board and --ide) are optional. Without --sample-code, PlatformIO will not automatically generate src/main.cpp

This will initialize a new PlatformIO project in the current directory.