PHPackages                             janvoracek/wp-cli-ssh - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. janvoracek/wp-cli-ssh

ActiveLibrary[CLI &amp; Console](/categories/cli)

janvoracek/wp-cli-ssh
=====================

Invoke WP-CLI on another server via SSH from local machine

0395PHP

Since Nov 25Pushed 10y ago1 watchersCompare

[ Source](https://github.com/JanVoracek/wp-cli-ssh)[ Packagist](https://packagist.org/packages/janvoracek/wp-cli-ssh)[ RSS](/packages/janvoracek-wp-cli-ssh/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (4)Used By (0)

WP-CLI SSH
==========

[](#wp-cli-ssh)

*Seamlessly run WP-CLI commands on a remote server via SSH*

[![Running wp plugin status on production](screenshot1.png)](screenshot1.png)

WP-CLI is an extremely useful tool for managing WordPress installs, but it requires you to invoke it on the same server where WordPress is installed. This means you have to SSH into the server, navigate to the install, and then run the command. It would be much more convenient if you could remain on your local shell and invoke WP-CLI remotely; this is especially the case when using Vagrant.

The WP-CLI SSH script is also TTY-aware, so if you try piping the results of a WP-CLI SSH command to another program, it will return the machine-formatted output (e.g. no colors or table cells).

Configuration
-------------

[](#configuration)

Assuming you have a clone of your WordPress install on your machine, add an `ssh` section to your `wp-cli.yml` config file. In this section you define the remote servers which host the other environments for your site, e.g. `vagrant`, `staging`, and `production`. Then you just invoke WP-CLI normally, but supply an additional `--host` argument with host you want to connect to:

```
wp ssh plugin status --host=production
```

You can also provide Bash aliases to supply this argument by default:

```
alias wp="wp ssh --host=vagrant"
alias wpprod="wp ssh --host=production"
```

Add an `ssh` section to your `wp-cli.yml`/`wp-cli.local.yml`, as seen in the [sample config](wp-cli.sample.yml). You indicate the `ssh` command templates for each host you want to connect to. The template variable `%cmd%` is replaced with the full command to run on the server; the `%pseudotty%` template variable is replaced with `-t`/`-T` depending on whether you're on a TTY or piping the command output.

For a step-by-step guide, please refer to the [wiki](https://github.com/x-team/wp-cli-ssh/wiki/Configuring-the-plugin).

Installation
------------

[](#installation)

Note that you do not necessarily need WP-CLI installed on your server to use this. If the `wp` command is not recognized on the server, the script will download the `wp-cli.phar` file and use that at runtime.

Installing WP-CLI-SSH on your machine can be done either by installation as a Composer package, or by adding a `require` config to a `wp-cli.local.yml`.

For global composer installation:

```
composer global require x-team/wp-cli-ssh dev-master
```

Alternatives
------------

[](#alternatives)

- [vassh](https://github.com/x-team/vassh)
- [`wp` Bash function](https://github.com/humanmade/Salty-WordPress/issues/16)
- [WP Remote CLI](https://github.com/humanmade/wp-remote-cli/)

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 62.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/c430d3357f43e1fc4d4bd4b58135817a3b68e5b70d564365da869201421b6fff?d=identicon)[JanVoracek](/maintainers/JanVoracek)

---

Top Contributors

[![westonruter](https://avatars.githubusercontent.com/u/134745?v=4)](https://github.com/westonruter "westonruter (22 commits)")[![jonathanbardo](https://avatars.githubusercontent.com/u/1933681?v=4)](https://github.com/jonathanbardo "jonathanbardo (7 commits)")[![JanVoracek](https://avatars.githubusercontent.com/u/703215?v=4)](https://github.com/JanVoracek "JanVoracek (3 commits)")[![gMagicScott](https://avatars.githubusercontent.com/u/2353518?v=4)](https://github.com/gMagicScott "gMagicScott (2 commits)")[![scribu](https://avatars.githubusercontent.com/u/225715?v=4)](https://github.com/scribu "scribu (1 commits)")

### Embed Badge

![Health badge](/badges/janvoracek-wp-cli-ssh/health.svg)

```
[![Health](https://phpackages.com/badges/janvoracek-wp-cli-ssh/health.svg)](https://phpackages.com/packages/janvoracek-wp-cli-ssh)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
