Skip to content

Stratus CLI

The Stratus Command Line Interface (CLI) is available to run cache clearing and other commands for easier management of a Magento deployment

The following commands are accessible via SSH access. See the *SSH > SSH Info* Stratus Control panel for access parameters.

Help

Run /usr/share/stratus/cli help for a list of viewable commands with descriptions.

Command Format

CLI commands are entered as /usr/share/stratus/cli <command>. For example, to use the command database.config run /usr/share/stratus/cli database.config

Common Commands

autoscaling.reinit

If autoscaling is enabled, this command will issue a redeploy of PHP-FPM services and update the code copied out to the various physical nodes. This is a rolling redeployment for zero instance downtime and minimal site downtime. The command executes asynchronously and will return before all the redeployment is completed.

NOTE: On average a redeployment takes several seconds or more depending on the size of the code base deployed.

cache.all.clear

Except for Redis or Memcache sessions, this command clears all other caches, including Cloudfront, PHP OpCache, Redis FPC, Redis Config, and Varnish (if enabled).

NOTE: CloudFront may take up to 15 minutes to clear all edge nodes.

cache.opcache.flush

Flushes only the PHP OpCache.

cache.cloudfront.invalidate

Clears the CloudFront CDN cache, and can take up to 15 minutes to complete.

cache.redis.clear

Flushes Redis. Equivalent to running redis-cli -h redis flushall.

cache.varnish.clear

Purges Varnish cache.

database.config

Returns the database credentials in JSON format.

magento.install

Installs the latest Magento 2 code base.

NOTE: this will completely delete all data and replace the code base.

php.options.add

Adds PHP option values, such as "memory_limit." For example, to set the PHP memory limit to 4,096 megabytes, run php.options.add memory_limit=4096M.

php.options.remove

Removes PHP option values previously added using php.options.add.

See also Deploying on Stratus.