Github Based Library Dependency Management | Not sure how to use it

Hey folks!

First I want to say a big thank you to the developers, contributors and the community of PlatformIO. It’s just awesome what you have built. Last night I was awake till 4:00 am reading the documentation. I am a newbie embedded programmer with experience in web development.


How can I make PlatformIO automatically pull a dependency library from git by adding the dependency to platform.ini?

Am I wrong to assume there should be a way to call a CLI command that will resolve all dependencies (similar to npm install)?

My Attempt 1

I could install the library manually with this command.

pio lib install

However this way my ./lib directory still remains empty. I need to have the user of my code to have access to read the library source file.

My Attempt 2

Add my dependency library through git submodule add --path ./lib

The problem is that PlatformIO adds .lib/ to .gitignore and thus does not let me install the submodule. I understand that the ./lib should be ignored by git.

Here are some excerpts from my project.


platform = espressif8266
board = nodemcuv2
framework = arduino
lib_extra_dirs = ./lib
lib_deps =


➜  faraday-vesc git:(master) ✗ ll -al lib total 8
drwxr-xr-x   3 cc  staff   102B Jan 13 18:08 .  
drwxr-xr-x  13 cc  staff   442B Jan 13 18:28 ..
-rw-r--r--   1 cc  staff   868B Jan 13 17:52 readme.txt

Any hints will be much appreciated!

This configuration file is correct. That is enough for PIO Core to build a project on another machine.

This is a storage for your own private libraries per project. PIO Core installs dependencies to Redirecting...

1 Like

Thank you for your response! I understand it better now. You rock!