Activating WordPress maintenance mode from wp-cli / shell

Sometimes you want your WordPress site to go into maintenance mode while working behind the scenes with wp-cli from the shell. Like when you are updating themes, plugins, or even WordPress core itself. Or do some work on the database, importing entries, things like that. Before you’re finished, the site might look broken or be in an inconsistent state. Something …