compress jpeg images from terminal I am looking for a way to compress jpeg images on a Mac from Terminal. Basically, a library like pngquant, except it is for jpeg format.

Are you aware of a software that does that?
Use ImageMagick.  Instructions for macOS binary installation are on the linked page.

compress -quality X% source.jpg result.jpg

X is a positive integer value (i.e. 85 for 85%); source and result are the original filename and the output filename.