Can I interact with Apple Notes app from the command line?
There is an application called Note2txt which will convert your notes from the Notes app to text files. One file for each note. It creates a file for all your notes and writes them into a directory of your choice.  It runs pretty quickly taking about 30 seconds for my 700+ Notes.