LinuxCommandLibrary

pio-package

Manage PlatformIO packages and dependencies

TLDR

Create a package tarball from the current directory

$ pio package pack --output [path/to/package.tar.gz]
copy

Create and publish a package tarball from the current directory
$ pio package publish
copy

Publish the current directory and restrict public access to it
$ pio package publish --private
copy

Publish a package
$ pio package publish [path/to/package.tar.gz]
copy

Publish a package with a custom release date (UTC)
$ pio package publish [path/to/package.tar.gz] --released-at "[2021-04-08 21:15:38]"
copy

Remove all versions of a published package from the registry
$ pio package unpublish [package]
copy

Remove a specific version of a published package from the registry
$ pio package unpublish [package]@[version]
copy

Undo the removal, putting all versions or a specific version of the package back into the registry
$ pio package unpublish --undo [package]@[version]
copy

SYNOPSIS

pio package {install|uninstall|update|list|search|publish|show|unpublish} [OPTIONS] [ARGS]

PARAMETERS

install [<name>]
    Install a package by name or URL (global with -g)

uninstall [-g|--global] <name>
    Uninstall a specific package

update [-g|--global] [<name>]
    Update all or specific package(s)

list [-g|--global]
    List installed packages

search <query>
    Search packages by keywords

publish
    Publish current directory as a package (requires auth)

show <name>
    Display detailed package information

unpublish <name>
    Unpublish a package (requires auth)

-g, --global
    Operate on global packages

-v, --verbose
    Enable verbose output

-f, --force
    Force operation, skip confirmations

-c, --only-check
    Only check for updates without applying

DESCRIPTION

The pio package command is part of PlatformIO Core, an open-source ecosystem for IoT and embedded systems development. It manages packages including libraries, platforms, frameworks, and tools hosted on the PlatformIO Registry.

Users can install dependencies for projects supporting microcontrollers like ESP32, STM32, AVR (Arduino), and more. Packages can be installed globally (-g) or per-project. Key operations include searching by keywords, listing installed packages, updating to latest versions, and publishing custom packages.

This tool streamlines dependency management, avoiding manual downloads. It's invoked via the pio CLI after installing PlatformIO Core via pip or system package managers. Ideal for firmware developers needing reproducible builds across IDEs like VSCode, CLion, or command-line.

Authentication with PlatformIO account is required for publishing/unpublishing.

CAVEATS

Requires PlatformIO Core installed (pip install platformio). Publishing needs pio account login. Global installs affect all projects; use project-local for isolation. Network access required for registry operations.

EXAMPLES

pio package install "ArduinoJson@6"
pio package search esp32
pio package list -g
pio package update

REGISTRY

Packages hosted at registry.platformio.org. Supports semantic versioning and dependencies.

HISTORY

Introduced in PlatformIO Core 2.0.0 (2016). PlatformIO founded in 2014 by Ivan Kravets; package management evolved with registry launch in 2015 for community sharing.

SEE ALSO

pio lib(1), pio platform(1), pio run(1), pip(1), apt(8)

Copied to clipboard