commerceguys / platform-cli
Platform.sh CLI
Installs: 177
Dependents: 0
Suggesters: 0
Security: 0
Stars: 201
Watchers: 26
Forks: 105
Open Issues: 107
Requires
- php: >=5.5.9
- ext-json: *
- composer/ca-bundle: ^1.3
- doctrine/cache: ~1.5
- guzzlehttp/guzzle: ^5.3
- guzzlehttp/ringphp: ^1.1
- padraic/phar-updater: ^1.0
- paragonie/random_compat: ^2.0
- platformsh/client: >=0.58.0 <2.0
- platformsh/console-form: >=0.0.25 <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/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
- 4.x-dev
- 3.x-dev
- 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
- v1.10.8
- v1.10.7
- v1.10.6
- v1.10.5
- v1.10.4
- 1.10.3
- v1.10.2
- v1.10.1
- v1.10.0
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.5
- v1.8.4
- v1.8.3
- v1.8.2
- v1.8.1
- v1.8.0
- v1.8.0-alpha2
- v1.8.0-alpha1
- v1.7.5
- v1.7.4
- v1.7.3
- v1.7.2
- v1.7.1
- v1.7.0
- v1.7.0-alpha2
- v1.7.0-alpha1
- v1.6.3
- v1.6.2
- v1.6.1
- v1.6.0
- v1.5.4
- v1.5.3
- v1.5.2
- v1.5.1
- v1.5.0
- v1.4.5
- v1.4.4
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.1
- 1.3.0
- v1.2.6
- v1.2.5
- v1.2.4
- v1.2.3
- v1.2.2
- v1.2.1
- 1.2.0
- 1.1.1
- v1.1.0
- v1.0.3
- v1.0.2
- v1.0.1
- v1.0.0
- v0.0.26
- dev-organization-lifecycle
- dev-organizations
- dev-organizations-and-environment-type-access
- dev-stream-select-error
- dev-pr-1017
- dev-pr-1009
- dev-master
- dev-development
- dev-ralt-patch-1
- dev-revert-869-remove-drush-app-root-ssh
- 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: 2022-02-01 12:34:44 UTC
README
The Platform.sh CLI is the official command-line interface for Platform.sh. Use this tool to interact with your Platform.sh projects, and to build them locally for development purposes.
Requirements
- Operating system: Linux, OS X, or Windows 10
- PHP 5.5.9 or higher, with the following extensions:
curl
,json
,mbstring
,pcre
, andphar
. The installation command will check for these. - Git
- A Bash-like shell:
- On OS X or Linux/Unix: SH, Bash, Dash or ZSH - usually the built-in shell will work.
- On Windows: Windows Subsystem for Linux (recommended), or another Bash-compatible shell such as Git Bash, Cygwin, or MinGW. The built-in Command Prompt may also work for most purposes.
- For building locally, your project's dependencies, e.g.
Installation
Run this command to install the CLI:
curl -sS https://platform.sh/cli/installer | php
In some Windows terminals you may need php.exe
instead of php
.
Installing manually
-
Download the
platform.phar
file from the latest release. -
Rename the file to
platform
, ensure it is executable, and move it into a directory in your PATH. -
Enable autocompletion and shell aliases:
platform self:install
Updating
New releases of the CLI are made regularly. Update with this command:
platform self:update
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
.
These are the possible keys, and their default values:
api: # Whether to disable the docker-credential-helpers credential storage method. # When enabled (default), and if supported, credentials are stored in: # - OS X: the default keychain # - Linux: the default collection in the Secret Service # - Windows: the Credential Manager under "Generic Credentials" # When disabled or not supported, credentials are stored in a hidden file. disable_credential_helpers: false application: # The default timezone for times displayed or interpreted by the CLI. # An empty (falsy) value here means the PHP or system timezone will be used. # For a list of timezones, see: http://php.net/manual/en/timezones.php timezone: ~ # The default date format string, for dates and times displayed by the CLI. # For a list of formats, see: http://php.net/manual/en/function.date.php date_format: c # A directory (relative to the home directory) where the CLI can write # user-specific files, for storing state, logs, credentials, etc. writable_user_dir: '.platformsh' local: # Set this to true to avoid some Windows symlink issues. copy_on_windows: false # Configure the Drush executable to use (defaults to 'drush'). drush_executable: null updates: # Whether to check for automatic updates. check: true # The interval between checking for updates (in seconds). 604800 = 7 days. check_interval: 604800
Other customization is available via environment variables:
PLATFORMSH_CLI_DEBUG
: set to 1 to enable cURL debugging. Warning: this will print all 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). 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_AUTO_LOAD_SSH_CERT
: set to 0 to disable automatic loading of an SSH certificate when running login or SSH commandsCLICOLOR_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.