$linuxjunkies
>

pio(1)

PlatformIO is a cross-platform, open-source ecosystem for IoT development with support for embedded boards, microcontrollers, and FPGA platforms.

UbuntuDebianFedoraArch

Synopsis

pio [COMMAND] [OPTIONS] [ARGUMENTS]

Description

PlatformIO (pio) is a professional collaborative platform for embedded development. It provides a unified workflow for building, uploading, and debugging firmware across hundreds of development boards and platforms including Arduino, ESP8266, STM32, Raspberry Pi Pico, and many others.

The pio command-line tool manages project initialization, dependency resolution, library management, build configuration, and device programming. It abstracts away platform-specific toolchains and complexity, allowing developers to focus on writing application code.

PlatformIO integrates with popular IDEs and editors while also functioning as a standalone command-line build system, making it suitable for CI/CD pipelines and headless development environments.

Common options

FlagWhat it does
--versionDisplay the installed PlatformIO version
--helpShow help message and list of available commands
-v, --verboseEnable verbose output with detailed build information
-q, --quietSuppress all output except warnings and errors
-e, --environmentSpecify target environment for build/upload operations
--project-dirSet the project directory path (default: current directory)
--no-ansiDisable colored output from the build system

Examples

Initialize a new PlatformIO project configured for Arduino Uno board

pio project init --board arduino:avr:uno

Build the current project using the default environment

pio run

Build and upload firmware to an ESP32 development board

pio run -e esp32dev --target upload

Install a library dependency into the project

pio lib install "DHT sensor library"

Open serial monitor to view device output at 115200 baud

pio device monitor --baud 115200

Remove all build artifacts and compiled objects

pio run --target clean

List all available STM32 development boards supported by PlatformIO

pio boards | grep stm32

Build project for Linux desktop using GCC compiler

pio run -e linux_gcc --target build

Related commands