Terminus is Pantheon's Command Line Interface (CLI), providing at least equivalent functionality to the Pantheon's browser-based Dashboard and easier scripting.
If you would like to contribute, pull requests are welcome!
Our documentation is kept in the Terminus Manual, located here: https://pantheon.io/docs/terminus
Once you have at least the requirements installed, you can install Terminus via Composer or Git. Additionally, you may want to install the optional software below to enhance your use of Terminus:
You can install Terminus just about anywhere on your system. In this README, we'll use /install/location
to stand in for your chosen installation location.
There are several ways to install Terminus, depending on your use case:
Download the latest terminus.phar
from the Releases page. In the example below, we're directing the file to $HOME/bin/
and renaming the file to terminus
:
wget https://github.com/pantheon-systems/terminus/releases/download/2.3.0/terminus.phar -O ~/.bin/terminus
Remember to get the latest version of Terminus from the Releases page, don't copy the command above vermatim.
Make the Terminus file exectable. The example below assumes the same installation path as above:
chmod +X ~/.bin/terminus
Note: Your installation directory must be in or added to your $PATH
environment variable in order to call terminus
from any working directory.
Run this in your Terminal client:
curl -O https://raw.githubusercontent.com/pantheon-systems/terminus-installer/master/builds/installer.phar && php installer.phar install
For more information on installation options or to report an issue with this method, please see the Terminus Installer README.md file.
Note: Terminus installed this way cannot use terminus update
to self-update versions.
Run this in your terminal client:
cd /install/location ; composer require pantheon-systems/terminus
If you are having issues installing, please see to it that any old versions of Terminus are removed by using
composer remove pantheon-systems/terminus
before requiring it.
Do not install Terminus via composer global require
. composer global require
should not be used to install php applications. If you need to globally install something using composer
, use the cgr
utility as a replacement instead.
Note: Terminus installed this way cannot use terminus update
to self-update versions.
To install with Git and use Terminus HEAD, you should clone this repository and run Terminus directly. If you would like to contribute to the Terminus source, this is the way you should install it. You will require Composer for this installation.
cd /install/location ; git clone https://github.com/pantheon-systems/terminus.git terminus
cd terminus ; composer install
You can now run the bleeding-edge version of Terminus via:
bin/terminus
Note: Terminus installed this way cannot use terminus update
to self-update versions.
Run this in your Terminal client:
curl -O https://raw.githubusercontent.com/pantheon-systems/terminus-installer/master/builds/installer.phar && php installer.phar update
For more information on update options or to report an issue with this method, please see the Terminus Installer README.md file.
Run this in your terminal client:
cd /install/location ; composer update
Update Terminus with this command:
brew upgrade homebrew/php/terminus
To update with Git and use Terminus HEAD, you should update this repository and then update its dependencies via Composer.
cd /install/location/terminus ; git pull
composer update
Optionally, for ease of development we suggest aliasing, setting the PATH in the bash configuration file, or
symlinking to it. This file is located at ~/.bashrc
on Linux systems and at ~/.bash_profile
on Mac.
alias terminus="/install/location/terminus/bin/terminus"
Once you source the file or restart your terminal client, you can now make use of Terminus using
terminus
export PATH="$PATH:/install/location/terminus/bin"
Once you source the file or restart your terminal client, you can now make use of Terminus using
terminus
Adding a symlink to /install/location/terminus/bin/terminus
inside your bin directory will work.
To get started with Terminus, you must first authenticate:
terminus auth:login --machine-token=xxxxxxxx
[notice] Logging in via machine token
If you are planning to run WP-CLI or Drush commands through Terminus, please upload an SSH key for the user that will be executing Terminus.
Commands in Terminus follow a predictable pattern:
terminus command:subcommand:subcommand param param --option=value --option
terminus
is the name of the application.command[:subcommand[:subcommand]]
is the name of the command to run. Terminus commands may consist of only a command
.param
are parameters, and are almost always required for operating the command.option
are options, and are never required to run a command. They may or may not require a value.Terminus can use certain environment variables to set certain default values when invoking commands. Check the
config/constants.yml
file for the names of variables which can be set. Do not alter this file - add global settings to
your ~/.terminus/config.yml
file or export them in your terminal client.
Terminus also has built-in support for PHP Dotenv, which provides an alternative
to manually exporting environment variables. This involves defining environment variables within a .env
file that
Terminus will automatically use when invoked within that working directory.
composer install
at the repository root directory to install all necessary dependencies.Your pull request will be reviewed by Pantheon and changes may be requested before the code is accepted.
Tests are run via the .scripts/test.sh
script. Components thereof can be run as follows:
composer cs
runs the code sniffer to ensure all code is appropriately formatted.composer phpunit
runs the PHPUnit unit tests.composer behat
runs the Behat feature testsPlease make ready the steps to reproduce the issue, outputs, pertinent information about your system, and what you believe the correct reaction of the system ought to be. Reporting of issues encountered should happen in one of two ways:
If we cannot duplicate an issue, we cannot resolve it. Giving us as much information about the problem you're having as you can will help reduce the amount of time between an issue's being reported and being resolved. This is typically the most helpful information:
terminus self:info
.--vvv
appended to it.)Head over to your support tickets in the Pantheon Dashboard and submit a new issue ticket. Please include the helpful information you have gathered.
Dependencies are easily updated by Composer. To update this codebase:
composer update
at the repository root directory.To deploy a new version of Terminus:
CHANGELOG.md
and in config/constants.yml
are updated to the new version.CHANGELOG.md
entries for the new version into the description of the release.-vvv
option to get debug output.PHP Fatal error: Uncaught exception 'ReflectionException' ...
, install php-xml.cURL error 60: SSL certificate problem: ...
, download a cacert.pem
file and add curl.cainfo = "[path_to_file]\cacert.pem"
to your php.ini
. If using XAMPP, you can add this to your
xampp\php\extras\ssl
directory.CHANGELOG.md
and include the pull request number. (You will have to push a second time once you have one.)