That's encoding, so you'd need an archiver first, then binhex the resulting archive.
Yeah. Check out the binhex command. Or similar. There's a CLI program for it for sure. I'll come up with it later if someone else doesn't. It's built-in to your Mac, preinstalled.