Darwin/Linux/Unix command line email client that supports iCloud?
A popular command line e-mail clients is Mutt. Use a package manager such as Brew or Macports to install it on MacOS. Have a look at this page for some pointers.

You can find the IMAP settings for iCloud in this Support article.