A Few of Our Favorite Terminus Use Cases

Here at Pantheon, we love to talk about the problems our development tools solve for dev teams. One of those tools is Terminus, our command line interface. To celebrate the release of our 1.0 version, we decided to show you a few examples of how we use this feature internally to keep our team moving fast.

Here is a list of some of the Terminus 1.0 scripts and plugins we like to use regularly here at Pantheon. We hope they are useful and inspire some creative scripting of your own!

Terminus 1.0 Scripts

Modern Management Practices for WordPress & Drupal

Advanced WordPress on Pantheon & Example Drops-8 Composer both offer an extensive list of scripts completing the loop between an external Github repository and Pantheon, while also handling a build step on CircleCI. In both instances, WordPress & Drupal, it shows modern management practices such as using Composer and an updated directory structure.

Testing Drupal Modules and WordPress Plugins

We maintain a few WordPress plugins and Drupal modules that address common needs like caching and search. Terminus helps tests those repositories by by creating fresh sites using the modules and plugins.

For example, to test our Search API integration module for Drupal 8, we want to verify that a clean Drupal 8 site can add the module, enable it, and then index and search content. To do that, we use Terminus to string together a few operations. Terminus creates a new Multidev environment, helps add modules via Composer, enables the modules with Drush, and finally grabs Drush aliases that can be used by the Drush driver in automated Behat testing.

Scripts vs Plugins

One of our recommendations is that if you are using a script multiple times, it is likely more efficient to turn it into a plugin. Plugins allow you to take advantage of Terminus’ built-in argument handling, logging, and help systems. A plugin is also easier to package and distribute than a script or set of scripts.

Check out the full directory of existing Terminus plugins here, and read on for some detail around our favorites. 

Terminus 1.0 Plugins

Mass Updates Plugin

The Mass Update plugin applies all of the available upstream updates to any list of sites. This allows users who manage a lot of sites to stay on top of Drupal and Wordpress core updates more easily. The plugin takes as input a list of site ids which can be easily generated using terminus commands such as site:list or org:site:list. This lets you build and filter the list of sites to update any way you like.

Terminus Build Tools Plugin

Terminus Build Tools Plugin contains a collection of commands useful during the build step on a Pantheon site that uses a GitHub PR workflow. An example circle.yml file has been provided to show how this tool should be used with CircleCI.

Need More Terminus?

There are a variety of ways that you can get involved and customize Terminus for your liking. Join our Power Users channel on Slack to share and discuss your findings, or you can also find more information about Terminus, plugins, & creating your own plugins in our documentation.

You can also join next month’s couch coding with my colleagues Josh & Greg to learn more about all you can do with the Terminus CLI—live Q&A included!

Related Information:

Let’s get in touch