platformsh / cli
Platform.sh CLI
Requires
- php: >=5.5.9
- ext-json: *
- composer/ca-bundle: ^1.3
- doctrine/cache: ~1.5
- giggsey/libphonenumber-for-php: ^8.13
- guzzlehttp/guzzle: ^5.3
- guzzlehttp/ringphp: ^1.1
- khill/php-duration: ^1.1
- padraic/phar-updater: ^1.0
- paragonie/random_compat: ^2.0
- platformsh/client: >=0.87.0 <2.0
- platformsh/console-form: >=0.0.37 <2.0
- stecman/symfony-console-completion: ^0.11
- symfony/config: ^3.1
- symfony/console: ^3.0 >=3.2
- symfony/dependency-injection: ^3.1
- symfony/event-dispatcher: ^3.0
- symfony/filesystem: ^3.0
- symfony/finder: ^3.0
- symfony/polyfill-iconv: ^1.19
- symfony/polyfill-mbstring: ^1.19
- symfony/process: ^3.0 >=3.4
- symfony/yaml: ^3.0 || ^2.6
Requires (Dev)
- bamarni/composer-bin-plugin: ^1.2
- drush/drush: ^8.0
- phpunit/phpunit: ^4.3 !=4.8.0
Suggests
- drush/drush: For Drupal projects
- dev-main
- 5.x-dev
- v4.22.0
- v4.21.1
- v4.21.0
- v4.20.5
- v4.20.4
- v4.20.3
- v4.20.2
- v4.20.1
- v4.20.0
- v4.19.3
- v4.19.2
- v4.19.1
- v4.19.0
- v4.18.1
- v4.18.0
- v4.17.0
- v4.16.0
- v4.15.3
- v4.15.2
- v4.15.1
- v4.15.0
- v4.14.2
- v4.14.1
- v4.14.0
- v4.13.1
- v4.13.0
- v4.12.1
- v4.12.0
- v4.11.5
- v4.11.4
- v4.11.3
- v4.11.2
- v4.11.1
- v4.11.0
- v4.10.4
- v4.10.3
- v4.10.2
- v4.10.1
- v4.10.0
- v4.9.0
- v4.8.6
- v4.8.5
- v4.8.4
- v4.8.3
- v4.8.2
- v4.8.1
- v4.8.0
- v4.7.2
- v4.7.1
- v4.7.0
- v4.6.1
- v4.6.0
- v4.5.0
- v4.4.1
- v4.4.0
- v4.3.0
- v4.2.1
- v4.2.0
- v4.1.2
- v4.1.1
- v4.1.0
- v4.0.2
- v4.0.1
- v4.0.0
- v3.88.1
- v3.88.0
- v3.87.1
- v3.87.0
- v3.86.1
- v3.86.0
- v3.85.0
- v3.84.2
- v3.84.1
- v3.84.0
- v3.83.1
- v3.83.0
- v3.82.2
- v3.82.1
- v3.82.0
- v3.81.1
- v3.81.0
- v3.80.3
- v3.80.2
- v3.80.1
- v3.80.0
- v3.79.8
- v3.79.7
- v3.79.6
- v3.79.5
- v3.79.4
- v3.79.3
- v3.79.2
- v3.79.1
- v3.79.0
- v3.78.0
- v3.77.0
- v3.76.2
- v3.76.1
- v3.76.0
- v3.75.3
- v3.75.2
- v3.75.1
- v3.75.0
- v3.74.0
- v3.73.2
- v3.73.1
- v3.73.0
- v3.72.2
- v3.72.1
- v3.72.0
- v3.71.0
- v3.70.1
- v3.70.0
- v3.69.2
- v3.69.1
- v3.69.0
- v3.68.0
- v3.67.6
- v3.67.5
- v3.67.4
- v3.67.3
- v3.67.2
- v3.67.1
- v3.67.0
- v3.66.4
- v3.66.3
- v3.66.2
- v3.66.1
- v3.66.0
- v3.65.4
- v3.65.3
- v3.65.2
- v3.65.1
- v3.65.0
- v3.64.6
- v3.64.5
- v3.64.4
- v3.64.3
- v3.64.2
- v3.64.1
- v3.64.0
- v3.63.3
- v3.63.2
- v3.63.1
- v3.63.0
- v3.62.6
- v3.62.5
- v3.62.4
- v3.62.3
- v3.62.2
- v3.62.1
- v3.62.0
- v3.61.0
- v3.60.4
- v3.60.3
- v3.60.2
- v3.60.1
- v3.60.0
- v3.59.1
- v3.59.0
- v3.58.0
- v3.57.6
- v3.57.5
- v3.57.4
- v3.57.3
- v3.57.2
- v3.57.1
- v3.57.0
- v3.56.6
- v3.56.5
- v3.56.4
- v3.56.3
- v3.56.2
- v3.56.1
- v3.56.0
- v3.55.0
- v3.54.2
- v3.54.1
- v3.54.0
- v3.53.1
- v3.53.0
- v3.52.3
- v3.52.2
- v3.52.1
- v3.52.0
- v3.51.3
- v3.51.2
- v3.51.1
- v3.51.0
- v3.50.1
- v3.50.0
- v3.49.3
- v3.49.2
- v3.49.1
- v3.49.0
- v3.48.2
- v3.48.1
- v3.48.0
- v3.47.0
- v3.46.0
- v3.45.0
- v3.44.0
- v3.43.2
- v3.43.1
- v3.43.0
- v3.42.2
- v3.42.1
- v3.42.0
- v3.41.1
- v3.41.0
- v3.40.16
- v3.40.15
- v3.40.14
- v3.40.13
- v3.40.12
- v3.40.11
- v3.40.10
- v3.40.9
- v3.40.8
- v3.40.7
- v3.40.6
- v3.40.5
- v3.40.4
- v3.40.3
- v3.40.2
- v3.40.1
- v3.40.0
- v3.39.0
- v3.38.1
- v3.38.0
- v3.37.2
- v3.37.1
- v3.37.0
- v3.36.0
- v3.35.4
- v3.35.3
- v3.35.2
- v3.35.1
- v3.35.0
- v3.34.3
- v3.34.2
- v3.34.1
- v3.34.0
- v3.33.6
- v3.33.5
- v3.33.4
- v3.33.3
- v3.33.2
- v3.33.1
- v3.33.0
- v3.32.5
- v3.32.4
- v3.32.3
- v3.32.2
- v3.32.1
- v3.32.0
- v3.31.6
- v3.31.5
- v3.31.4
- v3.31.3
- v3.31.2
- v3.31.1
- v3.31.0
- v3.30.1
- v3.30.0
- v3.29.2
- v3.29.1
- v3.29.0
- v3.28.0
- v3.27.2
- v3.27.1
- v3.27.0
- v3.26.1
- v3.26.0
- v3.25.1
- v3.25.0
- v3.24.1
- v3.24.0
- v3.23.0
- v3.22.3
- v3.22.2
- v3.22.0
- v3.21.0
- v3.20.5
- v3.20.4
- v3.20.3
- v3.20.2
- v3.20.1
- v3.20.0
- v3.19.1
- v3.19.0
- v3.18.0
- v3.17.0
- v3.16.2
- v3.16.1
- v3.16.0
- v3.15.4
- v3.15.3
- v3.15.2
- v3.15.1
- v3.15.0
- v3.14.5
- v3.14.4
- v3.14.3
- v3.14.2
- v3.14.1
- v3.14.0
- v3.13.0
- v3.12.2
- v3.12.1
- v3.12.0
- v3.11.0
- v3.10.2
- v3.10.1
- v3.10.0
- v3.9.0
- v3.8.1
- v3.8.0
- v3.7.1
- v3.7.0
- v3.6.0
- v3.5.4
- v3.5.3
- v3.5.2
- v3.5.1
- v3.5.0
- v3.4.1
- v3.4.0
- v3.3.6
- v3.3.5
- v3.3.4
- v3.3.3
- v3.3.2
- v3.3.1
- v3.3.0
- v3.2.2
- v3.2.1
- v3.2.0
- v3.1.2
- v3.1.1
- v3.1.0
- v3.0.7
- v3.0.6
- v3.0.5
- v3.0.4
- v3.0.3
- v3.0.2
- v3.0.1
- v3.0.0
- v3.0.0-beta4
- v3.0.0-beta3
- v3.0.0-beta2
- v3.0.0-beta1
- 2.x-dev
- v2.13.3
- v2.13.2
- v2.13.1
- v2.13.0
- v2.12.3
- v2.12.2
- v2.12.1
- v2.12.0
- v2.11.2
- v2.11.1
- v2.11.0
- v2.10.2
- v2.10.1
- v2.10.0
- v2.10.0-alpha1
- v2.9.2
- v2.9.1
- v2.9.0
- v2.8.3
- v2.8.2
- v2.8.1
- v2.8.0
- v2.7.3
- v2.7.2
- v2.7.1
- v2.7.0
- v2.6.3
- v2.6.2
- v2.6.1
- v2.6.0
- v2.5.6
- v2.5.5
- v2.5.4
- v2.5.3
- v2.5.2
- v2.5.1
- v2.5.0
- v2.4.6
- v2.4.5
- v2.4.4
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- v2.3.2
- v2.3.1
- v2.3.0
- v2.2.0
- v2.1.1
- v2.1.0
- v2.0.7
- v2.0.6
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-alpha6
- v2.0.0-alpha5
- v2.0.0-alpha4
- v2.0.0-alpha3
- v2.0.0-alpha2
- v2.0.0-alpha1
- 1.x-dev
- 1.3.0
- 1.2.0
- 1.1.1
- 1.1.0
- v1.0.0
- v0.0.26
- dev-upgrade-php-8-dependencies
- dev-upgrade-php-8
- dev-new-services-rector-rules
- dev-client-library-v3
- dev-refresh-token-after-curl-401
- dev-add-golangci-lint
- dev-refactor-commandbase-services-for-later-di
- dev-add-trufflehog-integration
- dev-symfony-compiled-service-container
- dev-symfony-7
- dev-ssh-warn-instance
- dev-pr-1502
- dev-update-psh-docker-config
- dev-send-term-env-if-valid
- dev-branch-ensure-remote-before-set-upstream
- dev-push-handle-integration-2
- dev-push-handle-integration-activate-error
- dev-ssh-cert-new-extensions
- dev-ssh-warn-prod
- dev-lock-ensure-exists
- dev-revert-1335-forward-options
- dev-push-activate-dirty
- dev-test-push-activities
- dev-fix-delete-inactive
- dev-pr-1259
- dev-remove-unnecessary-platform-files
- dev-organizations-and-environment-type-access
- dev-stream-select-error
- dev-master
- dev-development
- dev-require-curl
- dev-helpers
- dev-pf-972-init-generalized
- dev-fleet-option
- dev-pf-972-init
This package is not auto-updated.
Last update: 2024-12-21 17:28:50 UTC
README
The Legacy Platform.sh CLI is the legacy version of the command-line interface for Platform.sh. For the current Platform.sh CLI, check this repository.
Install
To install the CLI, use either Homebrew (on Linux, macOS, or the Windows Subsystem for Linux) or Scoop (on Windows):
HomeBrew
brew install platformsh/tap/platformsh-cli
Scoop
scoop bucket add platformsh https://github.com/platformsh/homebrew-tap.git scoop install platform
Manual installation
For manual installation, you can also download the latest binaries.
Legacy installer
This installation method is considered legacy and is discouraged, use one of the methods above instead. Starting with version 5.x, this installation method will not be supported.
In order to use the Legacy installer, you need to have an operating system supported by PHP (Linux, OS X, or Windows) and PHP 5.5.9 or higher, with the following extensions: curl
, json
, pcre
, and phar
.
Run this command to install the CLI using the legacy installer, given that you have PHP already installed:
curl -sS https://platform.sh/cli/installer | php
In some Windows terminals you may need php.exe
instead of php
.
Upgrade
Upgrade using the same tool:
HomeBrew
brew upgrade platformsh-cli
Scoop
scoop update platform
Usage
You can run the Platform.sh CLI in your shell by typing platform
.
platform
Use the 'list' command to get a list of available options and commands:
platform list
Authentication
There are two ways to authenticate:
-
The recommended way is
platform login
, which lets you log in via a web browser, including via third-party providers such as Google, GitHub, GitLab and Bitbucket. -
If using a browser is not possible, use an API token.
An interactive command is available for this:
platform auth:api-token-login
For non-interactive uses such as scripts or CI systems, set the API token in an environment variable named
PLATFORMSH_CLI_TOKEN
. This can be insecure if not handled properly, although it is appropriate for systems such as CircleCI, Jenkins and GitLab.Warning: An API token can act as the account that created it, with no restrictions. Use a separate machine account to limit the token's access.
Customization
You can configure the CLI via the user configuration file ~/.platformsh/config.yaml
.
The possible keys that can be overridden are in the config-defaults.yaml and config.yaml files.
Other customization is available via environment variables, including:
PLATFORMSH_CLI_DEBUG
: set to 1 to enable debugging. Warning: this could print HTTP request information in the terminal, including sensitive access tokens.PLATFORMSH_CLI_DEFAULT_TIMEOUT
: the timeout (in seconds) for most individual API requests. The default is 30.PLATFORMSH_CLI_DISABLE_CACHE
: set to 1 to disable cachingPLATFORMSH_CLI_HOME
: override the home directory (inside which the .platformsh directory is stored)PLATFORMSH_CLI_NO_COLOR
: set to 1 to disable colors in outputPLATFORMSH_CLI_NO_INTERACTION
: set to 1 to disable interaction (useful for scripting). Equivalent to the--no-interaction
command-line option. Warning: this will bypass any confirmation questions.PLATFORMSH_CLI_SESSION_ID
: change user session (default 'default'). Thesession:switch
command (beta) is now available as an alternative.PLATFORMSH_CLI_SHELL_CONFIG_FILE
: specify the shell configuration file that the installer should write to (as an absolute path). If not set, a file such as~/.bashrc
will be chosen automatically. Set this to an empty string to disable writing to a shell config file.PLATFORMSH_CLI_TOKEN
: an API token. Warning: An API token can act as the account that created it, with no restrictions. Use a separate machine account to limit the token's access. Additionally, storing a secret in an environment variable can be insecure. It may be better to use theauth:api-token-login
command. The environment variable is preferable on CI systems like Jenkins and GitLab.PLATFORMSH_CLI_UPDATES_CHECK
: set to 0 to disable the automatic updates checkPLATFORMSH_CLI_SSH_AUTO_LOAD_CERT
: set to 0 to disable automatic loading of an SSH certificate when running login or SSH commandsPLATFORMSH_CLI_REPORT_DEPRECATIONS
: set to 1 to enable PHP deprecation notices (suppressed by default). They will only be displayed in debug mode (-vvv
).CLICOLOR_FORCE
: set to 1 or 0 to force colorized output on or off, respectivelyhttp_proxy
orhttps_proxy
: specify a proxy for connecting to Platform.sh
Known issues
Caching
The CLI caches details of your projects and their environments, and some other
information. These caches could become out-of-date. You can clear caches with
the command platform clear-cache
(or platform cc
for short).
Contributing
See CONTRIBUTING.md for how to contribute to the CLI.