Pngout, optipng, deflopt, jpegtran, gifsicle, cwebp, zopfli, and so forth are all command line tools.
I'm not really sure why you think that this stuff is meant for designers. Recompressing images is a frontend optimization. It's something you automate. It's a task for machines, not humans.