PHPackages                             highliuk/wordpress-command - 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. highliuk/wordpress-command

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

highliuk/wordpress-command
==========================

Easy way to define custom commands in WordPress powered by Symfony Console instead of WP-CLI

1.2.1(1y ago)117MITPHPPHP ^8.1

Since Jun 7Pushed 1y ago1 watchersCompare

[ Source](https://github.com/HighLiuk/wordpress-command)[ Packagist](https://packagist.org/packages/highliuk/wordpress-command)[ RSS](/packages/highliuk-wordpress-command/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (8)Used By (0)

WordPress Command
=================

[](#wordpress-command)

An easy way to define custom commands in WordPress powered by Symfony Console instead of WP-CLI.

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

[](#installation)

Use composer to install the package:

```
composer require highliuk/wordpress-command
```

Usage
-----

[](#usage)

First, create your custom command by extending the `Command` class:

```
use Highliuk\WordPressCommand\Command;

/**
 * Greets the blog with its name.
 */
class HelloBlog extends Command
{
    protected function handle(): void
    {
        $name = get_bloginfo('name');

        $this->line("Hello, $name!");
    }
}
```

Then, register your command in your WordPress code:

```
use Highliuk\WordPressCommand\Application;

$app = Application::getInstance();
$app->add(new HelloBlog());
```

Now you can run your custom command:

```
vendor/bin/console hello:blog
# Hello, My Blog!
```

You have access to all of the Symfony Console features, such as options and arguments. See the [Symfony Console documentation](https://symfony.com/doc/current/components/console.html) for more information.

Features
--------

[](#features)

### Auto Inference for Name and Description

[](#auto-inference-for-name-and-description)

By default, the command name is inferred from the class name. For instance, the `HelloBlog` command will be available as `hello:blog`. Similarly, the command description is inferred from the class docblock. If you want to customize the command name and description, you can use the `setName` and `setDescription` methods in the `configure` method (see [Customization](#customization)), or you can use the shorthand properties:

```
use Highliuk\WordPressCommand\Command;

class HelloBlog extends Command
{
    protected $name = 'greet:blog';
    protected $description = 'Greets the blog with its name.';

    protected function handle(): void
    {
        $name = get_bloginfo('name');

        $this->line("Hello, $name!");
    }
}
```

### Customization

[](#customization)

You can customize the command by overriding the `configure` method (as for Symfony Console commands):

```
use Highliuk\WordPressCommand\Command;

class HelloBlog extends Command
{
    protected function configure(): void
    {
        $this->setName('greet:blog');
    }

    protected function handle(): void
    {
        $name = get_bloginfo('name');

        $this->line("Hello, $name!");
    }
}
```

### Argument and Option Bindings

[](#argument-and-option-bindings)

You can access arguments and options from your handle method:

```
use Highliuk\WordPressCommand\Command;
use Symfony\Component\Console\Input\InputArgument;

class GreetUser extends Command
{
    protected function configure(): void
    {
        $this
            ->addArgument('user', InputArgument::REQUIRED, 'The user to greet')
            ->addOption('uppercase', 'u', 'Whether to uppercase the user name');
    }

    protected function handle(string $user, bool $uppercase): void
    {
        if ($uppercase) {
            $user = strtoupper($user);
        }

        $this->line("Hello, $user!");
    }
}
```

```
vendor/bin/console greet:user john -u
# Hello, JOHN!
```

License
-------

[](#license)

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~2 days

Total

7

Last Release

697d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7ab73500015458452d2ee5531aa38b2571e8a65fed47b185698feb7b06d0d6bb?d=identicon)[highliuk](/maintainers/highliuk)

---

Top Contributors

[![HighLiuk](https://avatars.githubusercontent.com/u/65017775?v=4)](https://github.com/HighLiuk "HighLiuk (10 commits)")

---

Tags

phpconsolesymfonywordpresscommandwp-cli

###  Code Quality

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/highliuk-wordpress-command/health.svg)

```
[![Health](https://phpackages.com/badges/highliuk-wordpress-command/health.svg)](https://phpackages.com/packages/highliuk-wordpress-command)
```

###  Alternatives

[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.6k331.8M8.5k](/packages/nunomaduro-collision)[zenstruck/console-extra

A modular set of features to reduce configuration boilerplate for your Symfony commands.

8057.6k1](/packages/zenstruck-console-extra)

PHPackages © 2026

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