Problem

Many hosts don’t permit accessing a WordPress install over SSH, limiting your ability to use WP-CLI.

Proposed Algorithm

For security purposes, many WordPress hosts restrict SSH access to the server, forcing you to instead use SFTP or FTP. Because calling the WP-CLI executable on a server requires SSH access, not having SSH restricts your ability to use WP-CLI.

If the database is publicly accessible, one known workaround is to set up a local copy of the site, and have that copy connect directly to the production database. This approach enables you to run WP-CLI commands that perform database operations. However, because the code is executing locally, any filesystem operations will happen in your local environment, not the production environment you intend.

Because WordPress uses an abstraction to interact with the filesystem, it may be possible for WP-CLI to hook into WordPress and sync any local filesystem changes up to production.

Related Spark: Using WP-CLI through a web interface