How to access built in examples using cli?

I have been making some great strides with the arduino-cli program but I have a simple request, hopefully there will be a simple answer.

I am wanting to be able to access the built in examples that are part of the IDE's. Such as the blink example, blink without delay, ascii over serial, etc....

I tried arduino-cli lib example but this just shows me examples for currently installed libraries which are related to the megaavr core. Or maybe I am missing something here?
.........

In other news I found a post detailing how to use putty for a serial monitor and based off a script that user provided I was able to create a simple suite of command line script tools to make command line life easier.

I can also call these from within vim using the :!command I have tested them all and they work without error. SO happy about that, now I can get into using vim as my primary editor and manually compile and upload my sketches. Also having a serial monitor is a huge win.

When I get everything squared away I will write up a post detailing everything so others don't have to fight there way through everything and can just get onto coding.

Thanks Again,
Robert

Arduino CLI has no special handling of the IDEs built-in examples. They are just sketches. Treat them as you would any other sketch.

The Arduino IDE's special handling of the built-in examples by making them easily accessible via the File > Examples menu makes good sense for a tool targeted to beginners. But using Arduino CLI directly is for advanced users, who don't need or want a special UI for accessing introductory examples.

If you would like to get the examples without having to download the Arduino IDE, they are hosted here:

1 Like

If the sketch is the bulk of my program I use save as "newname" It sets up the folders etc for me. If I only want parts I use the ^C to copy and ^V to paste into my sketch. It has worked for me for several years.