DesktopServer Ds Cli Command Line Interface By ServerPress

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.

Introduction

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:

ds_cli_execute

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:

Conclusion

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.

As the Founder of ServerPress, LLC and the Coding Genius behind DesktopServer, Stephen J. Carnam continues to invent new ways to improve developer Workflow through technology. As a huge Advocate of Open Source Software, he promotes Creativity, Community and Collaboration.

Leave a Reply

Your email address will not be published. Required fields are marked *