Configure remote scripts.

Recently we finished a project that was being moved to Pantheon.

We created a couple custom scripts for pushing data into the pantheon environment, and for pulling data down for continuous integration runs.

The scripts require the Terminus CLI tool created by Pantheon to interact with it's service.

Terminus is a composer project, but it's dependencies don't align with the latest Drupal sites. It's best to install it as a phar file and run it that way.

Since we implemented automated jobs that need terminus, we decided to use composer to download and install it for us using the instructions provided in the documentation: 

At first we did this using composer's "post-install-cmd" hook to curl the phar to the bin directory.

Then we realized how nice it would be to have a plugin to do this for us.

Introducing Remote Bin Scripts

If you have a script accessible by URL and want to install into your composer bin dir, this plugin is for you.

$ composer require operations/remote-bin-scripts

Then, add the scripts you want to your composer.json file:

  "extra": {
    "remote-scripts": {
      "vendor/bin/hello-world": "…",

      "vendor/bin/terminus": "…"


When `composer install` is run, the file is downloaded to the specified location, and marked executable.

See for more information.


This method ensures that your site is entirely self contained and doesn't rely on any external scripts. It makes life easier for your developers who don't have to go and install something else before the site will work. It keeps things more stable because your codebase decides what version of the script to install.


Submitted by admin on