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

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

wp-php-toolkit/cli
==================

CLI component for WordPress.

v0.8.1(1mo ago)0118GPL-2.0-or-laterPHPPHP &gt;=7.2

Since Jun 4Pushed 1mo agoCompare

[ Source](https://github.com/wp-php-toolkit/cli)[ Packagist](https://packagist.org/packages/wp-php-toolkit/cli)[ Docs](https://wordpress.github.io/php-toolkit/reference/cli.html)[ RSS](/packages/wp-php-toolkit-cli/feed)WikiDiscussions trunk Synced today

READMEChangelogDependenciesVersions (49)Used By (0)

   slug cli   title CLI   install wp-php-toolkit/cli   see\_also    filesystem | Filesystem | Keep command behavior testable with in-memory storage.

 blueprints | Blueprints | Build repeatable site setup commands around parsed options.

 httpserver | HttpServer | Add a local web UI to a CLI workflow.

    POSIX-style argument parser. Long options, short bundles, inline values, positional args — one static call.

Why this exists
---------------

[](#why-this-exists)

Real CLI tools in PHP usually mean either pulling in `symfony/console` (and the transitive dependencies that come with it) or hand-rolling argv parsing that breaks the first time someone writes `-vvv` or `--port=8080`. The toolkit's `CLI` class is one static method, no dependencies, and handles the POSIX shapes you actually see.

Parse a single flag
-------------------

[](#parse-a-single-flag)

The smallest useful invocation: one boolean flag, one positional. Each option is a four-tuple of `[ short, has_value, default, description ]`.

```
