Home

Awesome

Mac CLI

 macOS command line tools for developers


Sponsors

Sponsor logo

Mac CLI is sponsored by 📒 SuperPlanner, an innovative daily planner and task manager for iPhone, iPad and Mac.

SuperPlanner combines the calendar with task management features to keep everything organized in one place.

There is no login or user registration required. All data is stored locally and syncs between your devices using private and secure iCloud sync.

Sponsor download badge


Introduction

Mac CLI is the ultimate tool for developers to manage their Mac. It provides a huge set of command line commands that automate the usage of your macOS system. When you run a function, the executed command is displayed and that helps you memorize each of the Utilities for future usage.

The tool is designed to be easily extendable with additional commands through the use of plugins. To view the currently available commands, you can navigate to the plugins folder and explore the different categories: /mac-cli/plugins

Contributions to add new plugins and keep improving the existing ones are welcome and very much appreciated!

image


Installation in 1 Simple Step - Including Configuration Wizard!

Via curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/guarinogabriel/mac-cli/master/mac-cli/tools/install)"

Via wget

sh -c "$(wget https://raw.githubusercontent.com/guarinogabriel/mac-cli/master/mac-cli/tools/install -O -)"

Then, re-open your terminal client. You will be able to run all the commands listed below, for example:

mac help


Configuration

The configuration is done when you install Mac CLI for the first time though the installer configuration wizard. After that, you can update your Mac CLI configuration by editing the following file: /usr/local/bin/mac


Requirements

These are the requirements to be able to run all the commands (the dependencies/requirements are installed when you install Mac CLI for the first time):


Update

You can update Mac CLI to the latest version by running:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/guarinogabriel/mac-cli/master/mac-cli/tools/update)"


Uninstallation

You can uninstall Mac CLI by running:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/guarinogabriel/mac-cli/master/mac-cli/tools/uninstall)"


Help / Commands List

CommandDescriptionArguments
mac helpList all available commands in mac script

General Commands

CommandDescriptionArguments
mac updateInstall macOS software updates, update installed Ruby gems, Homebrew, npm and their installed packages
mac lockLock
mac restartRestart macOS
mac sleepSleep mode
mac shutdownShutdown
mac timeShow clock at top right position in Terminal/iTerm
mac screensaverStart screensaver
mac folders:listList folders in current directory with their current size
mac folder:sizeCalculate current folder size
mac bluetooth:statusGet the bluetooth status
mac bluetooth:enableEnable bluetooth
mac bluetooth:disableDisable bluetooth
mac wifi:statusGet the wifi status
mac wifi:scanScan available wifi networks
mac wifi:enableEnable wifi
mac wifi:disableDisable wifi
mac dock:add-space NAdd blank space to dockN = number of spaces
mac eject-allEject all mounted volumes and disks
mac batteryGet battery status
mac infoGet macOS version information
mac hidden:showShow hidden files
mac hidden:hideHide hidden files
mac find:text XFind exact phrase recursively inside directoryX = Text string
mac find:biggest-filesFind biggest files inside directory
mac find:biggest-directoriesFind biggest directories inside directory
mac zip:extract XExtract Zip file to current folderX = Zip file to extract
mac gzip:compress XCompress current file using GzipX = File to compress
mac gzip:extract XExtract Gzip file to current folderX = Gzip file to extract
mac tar:compress XCompress X file/directory using tar with progress indicatorX = File or directory
mac tar:extract XExtract tar file to current folderX = Tar file to extract

Search Utilities

CommandDescriptionArguments
mac find:recent NFind files modified in the last N minutesN = number of minutes
mac search:replace XSearch and replace string in fileX = File to perform the search and replace operation

Network Utilities

CommandDescription
mac speedtestInternet connection speed test
mac portsList of used ports
mac ip:localGet local IP address
mac ip:publicGet public IP address

DNS Utilities

CommandDescription
mac dns:listList DNS server(s)
mac dns:addAdd DNS server
mac dns:removeRemove DNS server
mac dns:flushFlush DNS cache

SSH Utilities

CommandDescriptionArguments
mac ssh:download-file XDownload file from remote server through SSHX = Path of the remote file to download
mac ssh:download-folder XDownload entire folder from remote server through SSHX = Path of the remote folder to download
mac ssh:sync:local XSync local folder with remote folder using rsync through SSH (download remote folder to local folder)X = Path of the remote folder to sync to local folder
mac ssh:sync:remote XSync remote folder with local folder using rsync through SSH (upload local folder to remote folder)X = Path of the remote folder to sync from local folder
mac ssh:upload XUpload file to remote server through SSHX = Path of the file to upload to the remote server
mac ssh:public-keyCopy SSH Public Key
mac ssh:listList all the saved SSH credentials

Performance and maintenance Utilities

CommandDescription
mac systemShow system information to review mac performance
mac tempShow temperature, fan and battery statistics
mac memorySee memory usage sorted by memory consumption
mac trash:emptyEmpty trash
mac trash:sizeCalculate trash size

Git Utilities

CommandDescription
mac git:configDisplay local Git configuration
mac git:openOpen current repository on Github
mac git:create:branchCreate branch based on current branch
mac git:branches:dateGet last update date for all branches in current project
mac git:undo-commitUndo latest commit
mac git:logSee latest commits IDs and titles for current branch
mac git:branchSee all branches
mac git:branch:renameRename Git branch
mac git:branch:remove-localRemove local Git branch
mac git:branch:remove-remoteRemove local and remote Git branch
mac git:settingsCheck Git settings
mac git:add-removedAdd removed files to staged files
mac git:sizeGet size for current Git directory

Homebrew Utilities

CommandDescription
mac brewGet a list of installed Homebrew packages