Easiest way to configure arduino-cli for UNO and NANO

Arduino CLI uses the libraries installed under the libraries subfolder of the path configured by the directories.user configuration key. The default value of directories.user is C:\Users\<username>\Documents\Arduino but of course you can customize the configuration just as you did with directories.data.

It is "an approach". However, bundling the libraries with the sketch may require making modifications to the #include directives in the libraries in addition to the sketch. In this case, the error was caused by a bug in the "Adafruit_Circuit_Playground" library. They should have written the #include directive for the local header file like this:

#include "Adafruit_Circuit_Playground.h"

The bug doesn't make any difference when the library is installed normally, which is why the developer got away with this sloppy code, but then it comes out to bite you when you attempt to bundle it with the sketch.

Although there are valid use cases for bundling libraries with a sketch, I don't see any reason to do it in this particular case. As I mentioned above, it is possible to point Arduino CLI to a custom location to get libraries via the directories.user configuration key. There is another option, which is to specify the path to the folder that contains the libraries via the --libraries flag of the arduino-cli compile command:

https://arduino.github.io/arduino-cli/latest/commands/arduino-cli_compile/