These are free open-source PNG optimizers.

OptiPNG

You'll find latest sources at optipng.sourceforge.net

There's Mac OS X GUI for Optipng — PNGCrusher, but if you want just the shell command, here it is:

BTW: PNGOUT usually gives better compression and has binaries for OS X.

I've written GUI for few PNG optimizers.

PNGQuant

Sources at www.libpng.org/pub/png/apps/pngquant.html.