Customize platformio init


Is there any possibility to put envs_dir outside project root by default and maybe set other options in platformio.ini?

Something like:

envs_dir = /var/pio/${PROJECT_ROOT}
src_dir = ${PROJECT_NAME}_code



How about environment variables? See $PLATFORMIO_ENVS_DIR.

I read the doc’s twice but i don’t know how to use them in platformio.ini and i did not find the variable for project name.

When putting this in platform.ini:

envs_dir = /var/pio/$ANY_WORD

env_dir is expanded to “/var/pio/%env%” (e.g: /var/pio/uno)

also i did not find how to make this default for a new project.


Environment variables don’t relate to platformio.ini. PlatformIO process them automatically. For example,

> export PLATFORMIO_ENVS_DIR=/var/pio/myproject

> pio run

Ah, these are real environment variables!

Thank you!