platformio project init

Usage

platformio project init [OPTIONS]
pio project init [OPTIONS]

Description

Initialize a new PlatformIO based project or update existing with new data.

This command will create:

Options

-d, --project-dir

A path to a directory where PlatformIO will initialize new project.

-b, --board

If you specify board ID (you can pass multiple --board options), then PlatformIO will automatically generate environment for “platformio.ini” (Project Configuration File) and pre-fill these data:

The full list with pre-configured boards is available here Development Platforms.

--ide

Initialize PlatformIO project for the specified IDE which can be imported later via “Import Project” functionality.

A list with supported IDE is available within platformio project init --help command. Also, please take a look at Cloud & Desktop IDE page.

-e, --environment

New in version 5.0.

Update project using existing environment.

-O, --project-option

Initialize project with additional options from “platformio.ini” (Project Configuration File). For example, platformio project init --project-option="lib_deps=ArduinoJSON". Multiple options are allowed.

--env-prefix

An environment prefix which will be used with pair in board ID. For example, the default environment name for Teensy 3.1 / 3.2 board will be [env:teensy31].

-s, --silent

Suppress progress reporting

Examples

  1. Initialize new project in a current working directory

> platformio project init

The current working directory *** will be used for the new project.
You can specify another project directory via
`platformio project init -d %PATH_TO_THE_PROJECT_DIR%` command.

The next files/directories will be created in ***
platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-|
src - Put your source files here
lib - Put here project specific (private) libraries
Project has been successfully initialized!
Useful commands:
`platformio run` - process/build project from the current directory
`platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board
`platformio run --target clean` - clean project (remove compiled files)
  1. Initialize new project in a specified directory

> platformio project init -d %PATH_TO_DIR%

The next files/directories will be created in ***
 platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-|
...
  1. Initialize project for Arduino Uno

> platformio project init --board uno

The current working directory *** will be used for the new project.
You can specify another project directory via
`platformio project init -d %PATH_TO_THE_PROJECT_DIR%` command.
...
  1. Initialize project for Teensy 3.1 board with custom Mbed

> platformio project init --board teensy31 --project-option "framework=mbed"

The current working directory *** will be used for the new project.
You can specify another project directory via
`platformio project init -d %PATH_TO_THE_PROJECT_DIR%` command.

...