As stated in the mas-cli README, mas-cli is a simple command line interface for the Mac App Store. Designed for scripting and automation.
It allows all the GUI actions normally done in the Mac App Store, such as list installed apps, search for apps, install, upgrade, and purchase apps.
Install the mas-cli at the command line by typing brew install mas.
brew install mas
Type mas with no options to see a list of available options.
Typing mas list at the command line will show all App Store installed applications and their product identifiers.
Typing mas search at the command line will search the Mac App Store and return matching identifiers.
mas search twitter
To install an app, at the command line type mas install with an application identifier. in the example the application identifier is for TweetDeck.
mas install 485812721
To list applications with pending updates at the command line type mas outdated, and to install all the pending updates type mas upgrade.