pio project init¶
Contents
Usage¶
pio project init [OPTIONS]
Description¶
Initialize a new PIO based project or update existing with new data.
This command will create:
include_dir, put project header files here
src_dir, put project source files here (
*.h, *.c, *.cpp, *.S, *.ino, etc.
)lib_dir, put project specific (private) libraries here. See also Library Dependency Finder (LDF)
test_dir, put project tests here. More details Unit Testing
Miscellaneous files for VCS and Continuous Integration support.
Options¶
- -d, --project-dir¶
A path to a directory where PIO will initialize new project.
- -b, --board¶
If you specify board ID
(you can pass multiple --board
options), then
PIO 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 Platforms.
- --ide¶
Initialize PIO project for the specified IDE which can be imported later via “Import Project” functionality.
A list with supported IDE is available within pio project init --help
command.
Also, please take a look at Cloud & Desktop IDEs page.
- -e, --environment¶
Update project using existing environment.
- -O, --project-option¶
Initialize project with additional options from “platformio.ini” (Project Configuration File). For example,
pio 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]
.
- --no-install-dependencies¶
Do not resolve project dependencies and do not install missed packages.
- -s, --silent¶
Suppress progress reporting.
Examples¶
Initialize new project in a current working directory
> pio project init
The current working directory *** will be used for the new project.
You can specify another project directory via
`pio 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:
`pio run` - process/build project from the current directory
`pio run --target upload` or `pio run -t upload` - upload firmware to embedded board
`pio run --target clean` - clean project (remove compiled files)
Initialize new project in a specified directory
> pio project init -d %PATH_TO_DIR%
The next files/directories will be created in ***
platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-|
...
Initialize project for Arduino Uno
> pio project init --board uno
The current working directory *** will be used for the new project.
You can specify another project directory via
`pio project init -d %PATH_TO_THE_PROJECT_DIR%` command.
...
Initialize project for Teensy 3.1 board with custom Mbed
> pio 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
`pio project init -d %PATH_TO_THE_PROJECT_DIR%` command.
...
Initialize a new project passing working environment name and its options
> pio project init --environment native --project-option="platform=native" --project-option="build_flags=-DRELEASE=1"
The current working directory *** will be used for the new project.
...