PHPackages                             southan/wp-cli - 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. southan/wp-cli

ActiveWp-cli-package[CLI &amp; Console](/categories/cli)

southan/wp-cli
==============

Extension pack for developing with WP-CLI &amp; remote WordPress

00PHP

Since Jan 14Pushed 4mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

southan/wp-cli
==============

[](#southanwp-cli)

Extension pack for developing with WP-CLI &amp; remote WordPress.

Fluent shell API
----------------

[](#fluent-shell-api)

Easily build, execute, and handle system commands.

```
$zip = new WP_CLI\Shell( 'zip' );

// Add command options & arguments
$zip->add( [ 'recurse-paths' => true, '-q' => true ], 'archive.zip', '.' );

// Set working directory
$zip->cwd( __DIR__ . '/src' );

// Set environment variables
$zip->env([
	'ZIPOPT' => '-D',
]);

// Exit on failure
$zip->fail();

// Throw exception on failure
$zip->throw();

// Print warning on failure
$zip->warn();

// Chainable
$zip->add( 'archive.zip', '.' )
	->cwd( __DIR__ . '/src' )
	->env([
		'ZIPOPT' => '-FS'
	])
	->fail();

// Get command output
$out = $zip->get();

// Get command error output
$error = $zip->get_error();

// Stream command output instead (non-capturing)
$zip->stream();

// Command exit code was zero
$is_ok = $zip->is_ok();

// Check command exit code
if ( $shell->is( 12 ) ) {
	WP_CLI::warning( 'Nothing to ZIP.' );
}
```

Commander
---------

[](#commander)

Universal API for both system and WP-CLI commands.

```
$commander = new WP_CLI\Commander([
	// Set debug group for all commands
	'debug' => 'my_debug',

	// Set default failure mode (default THROW)
	'mode' => WP_CLI\Shell::EXIT,

	// Set WP-CLI runtime config (default is current runtime)
	'wp_config' => [
		'path' => '/path/to/another/wordpress',
	],
]);

// System shell
$home = $commander->sh( 'echo $HOME' )->get();

// WP-CLI shell
$table_prefix = $commander->wp( 'config get table_prefix' )->get();
```

Remote
------

[](#remote)

Run system &amp; WP-CLI commands on remote WordPress installations.

```
// Get remote control for WordPress on filesystem
$remote = WP_CLI\Remote::create( '/path/to/wordpress' );

// Get remote control for WordPress over SSH
$remote = WP_CLI\Remote::create( 'user@host' );

// Get remote control for WP-CLI alias
$remote = WP_CLI\Remote::create( '@staging' );

// Get remote controls for all WP-CLI aliases
$remotes = WP_CLI\Remote::resolve( '@all' );

// Get remote controls for WP-CLI alias group "@both"
$remotes = WP_CLI\Remote::resolve( '@both' );
```

A remote (control) is an extended `Commander` instance but with some additional methods specific to WordPress.

```
// Get remote WordPress path (returns path as-is if configured)
$path = $remote->path();

// Get remote WordPress realpath (always execs WP)
$realpath = $remote->get_path();

// Get remote WordPress URL
$url = $remote->get_url();

// Get remote WordPress constant
$cookie_domain = $remote->get_const( 'COOKIE_DOMAIN' );

// Get remote WordPress option
$page_for_posts = $remote->get_option( 'page_for_posts' );

// Eval PHP on remote WordPress
$remote->eval( 'wp_mail( "john@example.com", "Test", "Test" );' )->run();

// Filesystem API
$remote->is_file( 'foo.txt' );
$remote->is_dir( 'foo/' );
$remote->mkdir( 'foo' );
$remote->unlink( 'foo.txt' );
$remote->file_put_contents( 'foo.txt', 'Foo' );

// Copy file from local filesystem to remote
$remote->copy( 'foo.txt', "$remote:foo.txt" );

// Copy file from remote to local filesystem
$remote->copy( "$remote:foo.txt", 'foo.txt' );

// Sync local directory to remote
$remote->rsync( "foo/", "$remote:foo/" )->stream();

// Sync remote directory to local
$remote->rsync( "$remote:foo/", 'foo/' )->stream();
```

MU Plugin
---------

[](#mu-plugin)

Install (&amp; uninstall) persistent scripts.

```
$mu_plugin = new WP_CLI\MU_Plugin(
	name: 'Welcome Notice',
	description: 'Set a welcome notice in the WordPress admin.'
);

$code = install( $code, $remote ) ;

// ... or delete on a remote WordPress
$mu_plugin->delete( $remote );
```

Contributing
------------

[](#contributing)

We appreciate you taking the initiative to contribute to this project.

Contributing isn’t limited to just code. We encourage you to contribute in the way that best fits your abilities, by writing tutorials, giving a demo at your local meetup, helping other users with their support questions, or revising our documentation.

For a more thorough introduction, [check out WP-CLI's guide to contributing](https://make.wordpress.org/cli/handbook/contributing/). This package follows those policy and guidelines.

### Reporting a bug

[](#reporting-a-bug)

Think you’ve found a bug? We’d love for you to help us get it fixed.

Before you create a new issue, you should [search existing issues](https://github.com/southan/wp-cli/issues?q=label%3Abug%20) to see if there’s an existing resolution to it, or if it’s already been fixed in a newer version.

Once you’ve done a bit of searching and discovered there isn’t an open or fixed issue for your bug, please [create a new issue](https://github.com/southan/wp-cli/issues/new). Include as much detail as you can, and clear steps to reproduce if possible. For more guidance, [review our bug report documentation](https://make.wordpress.org/cli/handbook/bug-reports/).

### Creating a pull request

[](#creating-a-pull-request)

Want to contribute a new feature? Please first [open a new issue](https://github.com/southan/wp-cli/issues/new) to discuss whether the feature is a good fit for the project.

Once you've decided to commit the time to seeing your pull request through, [please follow our guidelines for creating a pull request](https://make.wordpress.org/cli/handbook/pull-requests/) to make sure it's a pleasant experience. See "[Setting up](https://make.wordpress.org/cli/handbook/pull-requests/#setting-up)" for details specific to working on this package locally.

###  Health Score

18

—

LowBetter than 8% of packages

Maintenance52

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity12

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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/926886318414ddd13c6d213d5ea5c329745ac172e98fb83ef89fea2caba75195?d=identicon)[southan](/maintainers/southan)

---

Top Contributors

[![southan](https://avatars.githubusercontent.com/u/7716370?v=4)](https://github.com/southan "southan (2 commits)")

### Embed Badge

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

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

###  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)
