skip to Main Content
DesktopServer DS-CLI- Command Line Interface

DesktopServer DS-CLI- Command Line Interface

DesktopServer 3.8.2 Release includes a new CLI- Command Line Interface. For many of us in the technical field, we are always looking for ways to incorporate this into our Workflow.


New in DesktopServer version 3.8.2 is the included plugin, DS-CLI. This new plugin provides DesktopServer with a familiar cross-platform command line interface (abreviated as CLI). While DesktopServer has long provided an easy way to automate WordPress centric tasks via the graphical user interface, the CLI has always been favored amongst seasoned developers because it can allow them to fine tune their development productivity. Now developers and designers have access to both worlds with unprecidented ease. Once the DS-CLI plugin is activated, all of your WordPress development sites in DesktopServer will be furnished with an easily accesbile CLI allowing you to issue any WP-CLI command along with some additional tools. In addition, DesktopServer blueprints will gain extended functionality to help further automate your WordPress setups, installations, and new site creations. To see a complete list of tools DS-CLI comes packed with, skip to the section entitled Pre-Installed WP-CLI and Tools.

Getting Started

To activate the DS-CLI plugin, simply use DesktopServer’s first option to “Stop, start, or restart…”, followed by scrolling through the list of plugins and locating the DS-CLI plugin (see figure 1 below). Be sure to check the checkbox next to DS-CLI and click the subsequent “Next” buttons to start/restart the server.

desktopserver cli command line interface activate

figure 1

If you haven’t created a site already, be sure to use DesktopServer’s default main menu option to “Create a new development website”.

You may now access the CLI from your WordPress development websites’ admin bar or via DesktopServer’s Sites button, aka http://localhost (see figure 2 & 3).

desktopserver ds cli command line interface admin

figure 2


localhost serverpress desktopserver ds cli command line interface

figure 3

On both Macintosh and Windows systems, a bash compatible command line interface window should appear and the current working directory will automatically be in the DOCUMENT_ROOT of your given WordPress development website.

Pre-Installed WP-CLI & Tools

Along with providing a ubiquitos bash command line interface (regardless of your operating system platform), DS-CLI also includes WP-CLI; a set of command line tools that allow you to manage WordPress websites. WP-CLI is pre-installed and ready to use. Simply type wp and press return to see the list of available commands. You will be able to immediately follow and use the various WP-CLI tutorials to increase your productivity (sans the ardjuous directions for setup and configuration). For more information about WP-CLI, visit the “Common Tasks” section of Konstantinos Kouratoras’ Advanced WordPress Management With WP-CLI. You can skip the WP-CLI installation section as well as the extended tools installation for PHPUnit and SSH (also pre-installed with DS-CLI).

In addition to furnishing a pre-installed WP-CLI environment, DS-CLI includes the following popular CLI tools:

PHPUnit for unit testing WordPress and your own PHP code
SSH for secure remote access to hosting provider servers
Gulp for automating and enhancing your workflows
Grunt, the JavaScript task runner for automation
Composer for PHP dependency management
LFTP for fault tolerant file transfers
git and svn for version control

Additional convenience utilities such as curl, wget, and node-sass are included.

Blueprint Integration

The DS-CLI plugin adds additional functionality to the DesktopServer blueprints folder. You can now automate your site creation tasks by simply including a blueprint.php file within your blueprints. If present, the contents of the blueprint.php file will execute whenever a new site is created. Also, the blueprint.php file has access to a new unique function call:


This function takes a single string parameter and allows you to execute arbitrary commands on the command line as if they were typed using the cross-platform, bash environment that is furnished with DS-CLI. The current working directory is automatically in the context of your newly created site’s DOCUMENT_ROOT folder and you can script CLI commands to fire off when the new site is created.

For example, you can now have DesktopServer automatically retrieve the latest version of WordPress every time you use the “Create a new development website” option (note: an Internet connection would be required). Simply download and install the “WordPress-Latest” example blueprint that provides this feature from ServerPress’ github repo and place it in your DesktopServer blueprints folder. To understand how it works, review the blueprint.php file contents:

 * Automate the setup of the freshest version of WordPress

/** Download, unzip WordPress, and move the contents into root. */
ds_cli_exec( "wget && unzip && mv ./wordpress/* ./" );

/** Check if index.php unpacked okay */
if ( is_file( "index.php" ) ) {

   /** Cleanup the empty folder, download, and delete this script. */
   ds_cli_exec( "rm -rf wordpress && rm index.htm && rm && rm blueprint.php" );


The new DS-CLI plugin in DesktopServer 3.8.2 enables designers and developers to step up their game and start increasing efficiency with CLI based tools and enhanced blueprint automation. Users can skip the cumbersome installation and configuration of the tools themselves and instead jump right into using them. Whether it’s submitting a WordPress plugin using Subversion or getting a Quick Start with WP-CLI, the new pre-installed features in DS-CLI makes them instantly accessible.