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

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

wp-cli/php-cli-tools
====================

Console utilities for PHP

v0.12.8(2mo ago)68325.0M↑21.4%11520MITPHPPHP &gt;= 7.2.24CI passing

Since Aug 15Pushed 5d ago27 watchersCompare

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

READMEChangelog (10)Dependencies (4)Versions (49)Used By (20)

PHP Command Line Tools
======================

[](#php-command-line-tools)

A collection of functions and classes to assist with command line development.

Requirements

- PHP &gt;= 5.6

Suggested PHP extensions

- mbstring - Used for calculating string widths.

Function List
-------------

[](#function-list)

- `cli\out($msg, ...)`
- `cli\out_padded($msg, ...)`
- `cli\err($msg, ...)`
- `cli\line($msg = '', ...)`
- `cli\input()`
- `cli\prompt($question, $default = false, $marker = ':')`
- `cli\choose($question, $choices = 'yn', $default = 'n')`
- `cli\menu($items, $default = false, $title = 'Choose an Item')`

Progress Indicators
-------------------

[](#progress-indicators)

- `cli\notify\Dots($msg, $dots = 3, $interval = 100)`
- `cli\notify\Spinner($msg, $interval = 100)`
- `cli\progress\Bar($msg, $total, $interval = 100)`

Tabular Display
---------------

[](#tabular-display)

- `cli\Table::__construct(array $headers = null, array $rows = null)`
- `cli\Table::setHeaders(array $headers)`
- `cli\Table::setRows(array $rows)`
- `cli\Table::setRenderer(cli\table\Renderer $renderer)`
- `cli\Table::addRow(array $row)`
- `cli\Table::sort($column)`
- `cli\Table::display()`

The display function will detect if output is piped and, if it is, render a tab delimited table instead of the ASCII table rendered for visual display.

You can also explicitly set the renderer used by calling `cli\Table::setRenderer()` and giving it an instance of one of the concrete `cli\table\Renderer` classes.

Tree Display
------------

[](#tree-display)

- `cli\Tree::__construct()`
- `cli\Tree::setData(array $data)`
- `cli\Tree::setRenderer(cli\tree\Renderer $renderer)`
- `cli\Tree::render()`
- `cli\Tree::display()`

Argument Parser
---------------

[](#argument-parser)

Argument parsing uses a simple framework for taking a list of command line arguments, usually straight from `$_SERVER['argv']`, and parses the input against a set of defined rules.

Check `examples/arguments.php` for an example.

Usage
-----

[](#usage)

See `examples/` directory for examples.

Todo
----

[](#todo)

- Expand this README
- Add doc blocks to rest of code

###  Health Score

72

—

ExcellentBetter than 100% of packages

Maintenance94

Actively maintained with recent releases

Popularity72

Solid adoption and visibility

Community55

Growing community involvement

Maturity61

Established project with proven stability

 Bus Factor3

3 contributors hold 50%+ of commits

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 ~110 days

Recently: every ~94 days

Total

46

Last Release

63d ago

PHP version history (3 changes)v0.9PHP &gt;= 5.3.0

v0.12.0PHP &gt;= 5.6.0

v0.12.6PHP &gt;= 7.2.24

### Community

Maintainers

![](https://www.gravatar.com/avatar/2439e3f2481a972350cdb74bdeaef11d15082a3b8fca1dbf33e8bbe3fbdcd3a7?d=identicon)[scribu](/maintainers/scribu)

![](https://www.gravatar.com/avatar/4b5740d002b5556abcceed36e016c8f8ba6f533eefef6107b3c60a830704993b?d=identicon)[danielbachhuber](/maintainers/danielbachhuber)

![](https://www.gravatar.com/avatar/6dde7f578e5530884238e7173f768ae3a890b6d66eb99262a82f2c494a1b67d4?d=identicon)[schlessera](/maintainers/schlessera)

---

Top Contributors

[![danielbachhuber](https://avatars.githubusercontent.com/u/36432?v=4)](https://github.com/danielbachhuber "danielbachhuber (87 commits)")[![jlogsdon](https://avatars.githubusercontent.com/u/88460?v=4)](https://github.com/jlogsdon "jlogsdon (57 commits)")[![swissspidy](https://avatars.githubusercontent.com/u/841956?v=4)](https://github.com/swissspidy "swissspidy (47 commits)")[![gitlost](https://avatars.githubusercontent.com/u/481982?v=4)](https://github.com/gitlost "gitlost (36 commits)")[![schlessera](https://avatars.githubusercontent.com/u/83631?v=4)](https://github.com/schlessera "schlessera (33 commits)")[![Copilot](https://avatars.githubusercontent.com/in/1143301?v=4)](https://github.com/Copilot "Copilot (8 commits)")[![tollmanz](https://avatars.githubusercontent.com/u/921795?v=4)](https://github.com/tollmanz "tollmanz (8 commits)")[![igorsantos07](https://avatars.githubusercontent.com/u/532299?v=4)](https://github.com/igorsantos07 "igorsantos07 (7 commits)")[![miya0001](https://avatars.githubusercontent.com/u/309946?v=4)](https://github.com/miya0001 "miya0001 (7 commits)")[![scribu](https://avatars.githubusercontent.com/u/225715?v=4)](https://github.com/scribu "scribu (6 commits)")[![jesseoverright](https://avatars.githubusercontent.com/u/2953809?v=4)](https://github.com/jesseoverright "jesseoverright (5 commits)")[![mrsdizzie](https://avatars.githubusercontent.com/u/1669571?v=4)](https://github.com/mrsdizzie "mrsdizzie (5 commits)")[![aerogus](https://avatars.githubusercontent.com/u/767901?v=4)](https://github.com/aerogus "aerogus (4 commits)")[![lf-jeremy](https://avatars.githubusercontent.com/u/9966465?v=4)](https://github.com/lf-jeremy "lf-jeremy (4 commits)")[![urlund](https://avatars.githubusercontent.com/u/376721?v=4)](https://github.com/urlund "urlund (4 commits)")[![jrfnl](https://avatars.githubusercontent.com/u/663378?v=4)](https://github.com/jrfnl "jrfnl (3 commits)")[![thanj](https://avatars.githubusercontent.com/u/1890887?v=4)](https://github.com/thanj "thanj (2 commits)")[![tiagohillebrandt](https://avatars.githubusercontent.com/u/1733911?v=4)](https://github.com/tiagohillebrandt "tiagohillebrandt (2 commits)")[![dllh](https://avatars.githubusercontent.com/u/2738252?v=4)](https://github.com/dllh "dllh (2 commits)")[![leewillis77](https://avatars.githubusercontent.com/u/1097338?v=4)](https://github.com/leewillis77 "leewillis77 (2 commits)")

---

Tags

clicommand-linehacktoberfestwp-clicliconsole

### Embed Badge

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

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

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B11.3k](/packages/symfony-console)[nunomaduro/collision

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

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

It's like Tailwind CSS, but for the console.

2.5k239.8M286](/packages/nunomaduro-termwind)[php-school/cli-menu

A command line menu helper in PHP

2.0k1.1M27](/packages/php-school-cli-menu)[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)[kevinlebrun/colors.php

Colors for PHP CLI scripts

3426.7M45](/packages/kevinlebrun-colorsphp)

PHPackages © 2026

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