Its built in Node.js and is distributed as a npm package. Use the below command to install it using npm.
npm install --global @pnp/office365-cli
Next, start by typing "office365" which will change the command prompt.
You can start start managing your Office 365 tenant by connecting using the "spo connect" followed by your tenant admin URL.
spo connect https://quicksilver-admin.sharepoint.com
As soon as you type the above command you will be give a URL followed by a code to be entered in the browser.