KeyError: 'PLATFORMIO_PLATFORMS_DIR'

Hi everyone!
To my surprise there is no PLATFORMIO_PLATFORMS_DIR available for my script. Despite being documented here

I’ve worked around this issue simply by setting PLATFORMIO_PLATFORMS_DIR = '$PROJECT_CORE_DIR/platforms' but it would be nice if the doc actually match the available env

Please file an issue in Issues · platformio/platformio-core · GitHub about this variable not being accessible in the script / platformio.ini.