There are mulitple ways of handling libraries in arduino-cli. This example will use LiquidCrystal_I2C as the library.
By name
- Installing a library by name:
- Unstalling a library by name:
- Listing all installed libraries:
- Updating libraries (by name):
$ arduino-cli lib install "LiquidCrystal_I2C"
If you are unsure about the exact name of the library, you can search:
$ arduino-cli lib search liquidcrystal
$ arduino-cli lib uninstall "LiquidCrystal_I2C"
$ arduino-cli lib list
You can use grep to "search" for a specific installed library:
$ arduino-cli lib list | grep LiquidCrystal_I2C
Updating all installed libraries:
$ arduino-cli lib upgrade
Updating a specific library:
$ arduino-cli lib upgrade LiquidCrystal_I2C
Manually
If you need a library which is not in the standard list, e.g. your own library, a very new or unknown library, you can manually put (or e.g. git clone) the library in your user's library folder:
$ cd ~/Arduino/libraries
There you can also just delete, edit or replace it to update / uninstall.