via arduino/arduino-cli#648
arduino-cli lib install <library name> now supports --git-url <url> and --zip-path <path>.
the config should be expanded to allow something like this:
compile:
libraries:
- someLibrary # String value: let the Arduino library manager figure it out
- localLibrary: # Hash
zip_path: ./wherever/it/is.zip
- gitLibrary: # Hash
git_url: [email protected]:me/gitLibrary.git
Note the need to enable this feature in the first place arduino/arduino-cli#1075