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 command [OPTIONS]
pio package install <pkg_name_or_id> [OPTIONS]
pio package update [OPTIONS]
pio package uninstall <pkg_name_or_id> [OPTIONS]
pio package list [OPTIONS]
pio package search <query> [OPTIONS]

PARAMETERS

--global, -g
    Manages packages in the global PlatformIO storage, making them available across all projects without being tied to a specific project's platformio.ini.

--platform <platform_id>
    Specifies the development platform (e.g., espressif32, atmelsam) for the package operation. Useful when managing platform-specific tools or frameworks.

--framework <framework_id>
    Specifies the framework (e.g., arduino, esp-idf) for the package operation. Typically used in conjunction with install or update.

--tool <tool_id>
    Specifies the tool package for the operation (e.g., a specific compiler or debugger). Applies to various subcommands.

--json
    Outputs the results in JSON format. Primarily used with the list and search subcommands for machine-readable output.

--skip-dependencies
    (Applicable to install) Installs the specified package without automatically installing its listed dependencies.

--spec <version_spec>
    (Applicable to install) Specifies a particular version or version range for the package to be installed (e.g., ^1.2.3, >1.0.0,<2.0.0).

DESCRIPTION

The pio-package command, a core component of the PlatformIO ecosystem, is designed for efficient management of development platforms, frameworks, and tools. These essential components are crucial for building embedded software projects. PlatformIO abstracts the complexity of setting up diverse development environments by allowing users to easily install, update, uninstall, and list these packages.

It supports a wide range of microcontrollers and development boards by providing curated toolchains, SDKs, and frameworks. This command is particularly useful for ensuring project reproducibility across different development machines and for maintaining consistent versions of dependencies. It can operate on packages globally or within the scope of a specific PlatformIO project, depending on the options used.

CAVEATS

The pio-package command requires PlatformIO Core to be installed and properly configured in your system's PATH.

It exclusively manages packages within the PlatformIO ecosystem (development platforms, frameworks, tools) and should not be confused with general Linux package managers (like apt or yum) or Python package managers (like pip).

While manual management is possible, PlatformIO projects often handle platform and framework dependencies automatically via their platformio.ini configuration when commands like pio run or pio build are executed.

USAGE CONTEXT: GLOBAL VS. PROJECT-SPECIFIC PACKAGES

By default, when you use pio package install within a PlatformIO project directory, the package is added as a dependency to your project's platformio.ini file and installed for that specific project. This ensures project portability and reproducibility.

However, using the --global (or -g) flag with commands like install, update, or uninstall directs the operation to PlatformIO's global package storage. Global packages are available to any PlatformIO project on your system without explicit declaration in platformio.ini. This is beneficial for common tools, frameworks, or platforms that you use across multiple projects, reducing redundant installations and storage.

HISTORY

PlatformIO was launched in 2014 with the aim of simplifying embedded software development. The `pio-package` functionality, or its conceptual equivalent, was integral to PlatformIO Core from its early stages, providing a unified mechanism for managing the disparate toolchains and SDKs inherent in embedded systems. Its continuous evolution has mirrored the rapid growth of the embedded ecosystem, adapting to new architectures, boards, and development methodologies, consistently aiming to abstract away the environmental complexities for developers.

SEE ALSO

pio(1), pip(1), npm(1)

Copied to clipboard