LinuxCommandLibrary

pio-project

Manage PlatformIO projects

TLDR

Initialize a new PlatformIO project

$ pio project init
copy

Initialize a new PlatformIO project in a specific directory
$ pio project init [[-d|--project-dir]] [path/to/project_directory]
copy

Initialize a new PlatformIO project, specifying a board ID
$ pio project init [[-b|--board]] [ATmega328P|uno|...]
copy

Initialize a new PlatformIO based project, specifying one or more project options
$ pio project init [[-O|--project-option]] "[option]=[value]" [[-O|--project-option]] "[option]=[value]"
copy

Print the configuration of a project
$ pio project config
copy

SYNOPSIS

pio project [options]

PARAMETERS

init
    Initializes a new PlatformIO project in the current directory.

--board
    Specifies the board for the project. Use `pio boards` to list available boards.

--project-dir
    Specifies the project directory (default: current working directory).

--ide
    Specify preferred IDE name. For example `--ide vscode`.

--framework
    Specifies the framework to use (e.g., arduino, stm32cube). Use `pio frameworks` to list available frameworks.

--platform
    Specifies the platform to use (e.g., espressif32, atmelavr). Use `pio platforms` to list available platforms.

DESCRIPTION

The pio project command is a crucial part of the PlatformIO Core (CLI) that facilitates project management within the PlatformIO ecosystem. It allows you to create, build, upload, and manage embedded software projects. It abstracts away the complexities of building and deploying firmware for a wide variety of embedded platforms, enabling developers to focus on their code and logic rather than toolchain configuration and low-level details.

It's a high-level interface built on top of lower-level tools, providing a consistent and streamlined workflow for building and deploying embedded applications. From initializing a new project with appropriate directory structures and dependencies to automatically detecting build environments, the pio project command simplifies the development process. It supports numerous frameworks, boards, and debuggers, making it adaptable to a wide range of embedded development scenarios.

Using this command you can initiate, build, upload and manage projects without manually handling configuration files and platform specific parameters. This promotes code reusability and simplifies collaboration within embedded software development teams.

USAGE EXAMPLES

Initialize a new project for an Arduino Uno:
pio project init --board uno

Initialize a project with a specific platform and framework:
pio project init --board esp32dev --platform espressif32 --framework arduino

Initialize a project with a specific project directory:
pio project init --board uno --project-dir /path/to/my/project

Copied to clipboard