A lot of developers seem to enjoy grunt work - the thrill of fixing problems, building things, and losing yourself in lines of code.\r\n\r\nBut there's only so much time in the day. And you probably have better things to be doing than repetitive tasks that end up taking longer than they should.\r\n\r\nWhen you can do more work in less time, you're freed up to work on more projects, grow your skills, or even take a little break. There is a world outside of our screens (shh... don't tell anyone).\r\n\r\nWP-CLI is a command line tool that lets you accomplish a wide array of WordPress development tasks from within the command line. This means no breaking focus, and less wasted time.\r\n\r\nBelow you'll learn what WP-CLI actually is, and why you may want to consider using it.\r\n<h2>What is WP-CLI?<\/h2>\r\nFor a long time WordPress didn't have a way for developers to work around simple tasks that would take nothing more than a few lines of code. This has all changed with the introduction of WP-CLI.\r\n\r\nThe WordPress GUI is pretty, but sometimes you don't want to leave the command line. And now you don't have to.\r\n\r\nIf you're looking to execute simple WordPress tasks in the most efficient manner possible, then you need WP-CLI on your side.\r\n\r\nImagine being able to accomplish your WordPress related tasks without having to fire up your browser and login to WordPress. With WP-CLI, you can do anything you'd usually do within the WordPress Admin panel, without needing to login to the site.\r\n\r\nIt's very useful and an incredible time saver.\r\n<h2>What Can WP-CLI Help With?<\/h2>\r\nBasically, any general administrative task you'll need to do within the WordPress dashboard can now be handled from you command line. Whether you want to create a new site, manage an existing site, or make changes to an existing database, this tool can help you do it.\r\n\r\nSome core functions that WP-CLI can be used to complete are:\r\n<ul>\r\n \t<li>Installing a fresh WordPress installation<\/li>\r\n \t<li>Updating and installing WordPress themes and plugins<\/li>\r\n \t<li>The ability to list all plugins and their status<\/li>\r\n \t<li>Updating the core WordPress framework<\/li>\r\n \t<li>Uploading media files in bulk, avoiding having to do one at a time<\/li>\r\n \t<li>Creating database backups and restoring existing databases<\/li>\r\n \t<li>Creating or changing user accounts and permissions<\/li>\r\n \t<li>Easy search and replace functionality within the database<\/li>\r\n<\/ul>\r\nTo see what basic functionality WP-CLI is equipped with, you can check out their <a href="https:\/\/developer.wordpress.org\/cli\/commands\/" target="_blank" rel="noopener noreferrer">complete list of basic commands<\/a>.\r\n\r\nHere's a few basic tasks you probably complete on a regular basis. With WP-CLI, they take nothing more than a simple command - check them out:\r\n\r\n<strong>Installing a WordPress theme<\/strong>\r\n<code>wp theme install twentyten<\/code>\r\n\r\n<strong>Installing and activating a plugin<\/strong>\r\n<code>wp plugin install woocommerce<\/code>\r\nThen,\r\n<code>wp plugin activate woocommerce<\/code>\r\n\r\n<strong>Updating the WordPress core<\/strong>\r\n<code>wp core update<\/code>\r\n<code>wp core updatedb<\/code>\r\n\r\n<strong>Bulk importing images<\/strong>\r\n<code>wp media import images_folder<\/code>\r\n\r\nDoing regular WordPress administrative and maintenance tasks couldn't be easier.\r\n<h2>A Few Of Our Favorite Features<\/h2>\r\nBeyond the commands and functions highlighted above you can do some really intricate stuff with WP-CLI, like using it remotely, adding WordPress multi-site features, and even the ability to run unit tests.\r\n\r\nNaturally, most developers are afraid of the dreaded fatal error that can happen from plugin and theme conflicts. When you're working from the command line, it can be difficult to know if this error actually occurred. Luckily, WP-CLI has flags to ignore plugins or themes from being loaded, if they have PHP Fatals that will stop the site from loading.\r\n\r\nAnother really great feature is the ability to manipulate wp-options. You can use something like (<code>wp option get|set $name [$value]<\/code>) as a quick shorthand instead of having to jump over the MySQL client.\r\n\r\nAnd it even unserializes your PHP objects for you!\r\n\r\n<code>'$ wp option get pagely-cache-control\r\nstdClass::__set_state(array(\r\n'all_caching_disabled' => '0',\r\n'dev_mode' => '0',\r\n))'<\/code>\r\n\r\nThis enables you make quick database changes, using shorthand, without having to hop over to the MySQL database. Very, very, useful.\r\n\r\nPlus, you can take WP-CLI even further with their packages that are available via their <a href="http:\/\/wp-cli.org\/package-index\/" target="_blank" rel="noopener noreferrer">package index<\/a>.\r\n\r\nOf course, there are a ton of additional features we didn't mention in this post. The possibilities of WP-CLI are almost endless. If you're looking for more information you can find out more on <a href="https:\/\/wp-cli.org\/" target="_blank" rel="noopener noreferrer">their website<\/a>.\r\n\r\nIf you're thinking about using WP-CLI, or want to support its continued use we highly recommend reading about the <a href="http:\/\/wp-cli.org\/blog\/the-big-question.html" target="_blank" rel="noopener noreferrer">potential costs<\/a> of this tool. Which brings up the question:\r\n\r\n<i>How much is your time really worth?<\/i>\r\n\r\nBreaking flow and focus to login to the WordPress dashboard takes time. All that time adds up, and after awhile you'll wonder where your day went. Don't let this be your fate.\r\n\r\nWP-CLI sounds like a dream come true to most developers. But there is one catch: not all WordPress hosts support this kind of access. Luckily, your friends at Pagely do.\r\n\r\nSo if the thought of using WP-CLI to speed up development tasks sounds like a must-have part of your coding life, then <a href="https:\/\/pagely.com\/solutions\/" target="_blank" rel="noopener noreferrer">give our hosting a try<\/a>.