Install

<pre lang="bash">
brew install p7zip

Extract

<pre lang="bash">
7z x file.7z

Compress

<pre lang="bash">
7z a file.7z mydirectory