LinuxCommandLibrary

pio

Manage PlatformIO projects and development environments

TLDR

Display help and list subcommands

$ pio [[-h|--help]]
copy

Display help for a specific subcommand
$ pio [subcommand] [[-h|--help]]
copy

Display version
$ pio --version
copy

SYNOPSIS

pio [options] command [command_options]

Common commands include:
run: Build and upload project.
build: Compile project firmware.
upload: Upload firmware to a device.
test: Run project tests.
lib: Manage project libraries.
board: List and inspect development boards.
project: Manage PlatformIO projects.
device: Manage connected serial devices.
home: Open PlatformIO Home GUI.
account: Manage PlatformIO account.
settings: Manage PlatformIO settings.
update: Update installed platforms and libraries.
upgrade: Upgrade PlatformIO Core.

PARAMETERS

-v, --version
    Show the version information for PlatformIO Core.

-h, --help
    Show a help message and exit. Can be used with a command to show specific help (e.g., pio run -h).

--force
    Force the operation to proceed without confirmation.

--json-output
    Print the output in JSON format, useful for scripting and integration.

--keep-symbols
    Keep debugging symbols in the compiled firmware (if supported by the platform).

--no-ansi
    Disable ANSI escape codes in the output.

--no-color
    Disable colored output.

--no-progress
    Disable the progress bar during operations like downloading or compiling.

DESCRIPTION

The pio command is the command-line interface (CLI) for PlatformIO, an open-source ecosystem designed for professional embedded and IoT development.
It provides a comprehensive set of tools to simplify software development for a vast range of microcontrollers and single-board computers.
With pio, developers can manage project scaffolding, build and compile firmware, upload binaries to devices, handle library dependencies, and configure various development boards and platforms.
PlatformIO aims to make embedded development more accessible, reproducible, and portable across different operating systems by abstracting away complex toolchain configurations and offering a unified build system.

CAVEATS

The pio command is not a standard Linux utility; it is part of the PlatformIO ecosystem and typically installed via Python's pip package manager.
It requires a Python environment to run.
Initial setup or project creation may involve downloading significant amounts of data, including toolchains, frameworks, and platform packages, which can consume disk space and bandwidth.
While powerful, its abstraction layers can sometimes obscure underlying build system details, making advanced debugging or customization challenging for beginners.

PROJECT ENVIRONMENTS

PlatformIO uses project environments, defined in the platformio.ini configuration file, to specify different build configurations for a single project.
Each environment can target a specific board, framework, or even a different toolchain, allowing developers to easily switch between targets or build for multiple devices from the same codebase. This promotes modularity and reproducibility.

LIBRARY MANAGEMENT

pio provides a robust library management system that simplifies dependency resolution and installation.
Developers can declare project dependencies in platformio.ini, and pio will automatically download and link the necessary libraries from the PlatformIO Registry, Git repositories, or local paths.
This ensures consistent builds and easier collaboration among developers.

HISTORY

PlatformIO was founded in 2014 by Ivan Kravets with the goal of creating a unified, open-source development environment for embedded systems. The pio CLI has been central to its design from the outset, providing a flexible and powerful way to automate common embedded development tasks.
Over the years, the project has grown significantly, expanding its support for a vast array of development boards, microcontrollers, and IoT frameworks, transitioning from a simple build system to a full-fledged ecosystem that includes an IDE (VSCode integration), a rich library registry, and a remote development feature. The pio command remains the core interface for interacting with this ecosystem.

SEE ALSO

pip(1), make(1), gcc(1), npm(1)

Copied to clipboard