If you are using a mouse then it is easy enough because you can just type tm to toggle the metadata for that note and just copy the id.
Otherwise you can use something like joplin cat -v test | grep "^id: " | cut -f2 -d" " to isolate the ID from the command line.
I think it would be nice if maybe the cat or ls command could have a further option to just output the id alone to make it easy to copy (for example ls -l will give you the short ID and other note data, cat -v will give you everything so maybe something like cat -i could give you just the id.)
The big difference is that the terminal app doesn't have an editor so I'm not sure how something like that could ever work as the editor itself would need to be able to read the database. Sure, somebody could probably write something like a vim plugin with the data API to implement such a thing but currently what happens inside the editor is different from outside.
I suppose a case could be made for a function that appends the markdown link to the end of the note outside of the editor but personally I think so long as the ID can be easily copied to clipboard then it eliminates most of the issues.