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

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

titpetric/php-cli-tools
=======================

Console utilities for PHP

03671PHP

Since Oct 30Pushed 12y ago1 watchersCompare

[ Source](https://github.com/titpetric/php-cli-tools)[ Packagist](https://packagist.org/packages/titpetric/php-cli-tools)[ RSS](/packages/titpetric-php-cli-tools/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependenciesVersions (2)Used By (0)

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

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

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

Requirements

- PHP &gt;= 5.3
- [git\_hooks](https://github.com/titpetric/git_hooks) - optional, for some git hooks
- [phpunit](https://github.com/sebastianbergmann/phpunit/) - optional, for running tests

If you can, please use composer to install and use php-cli-tools from [titpetric/php-cli-tools](https://packagist.org/packages/titpetric/php-cli-tools).

Run `composer require titpetric/php-cli-tools` to get started. Stability `dev-master` should be ok.

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\notifier\Dots($msg, $dots = 3, $interval = 100)`
- `\cli\notifier\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.

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.

Usage
-----

[](#usage)

Check `examples/` folder for various examples. Also check out tests if you want to see how some features actually work and are used.

Todo
----

[](#todo)

- Expand this README
- Add doc blocks to rest of code
- Increase code coverage with phpunit tests

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 82.2% 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/d0de88347bf2bb82b06873a7a3476cc70ea46c22b6c151af63c2206afea9ebbd?d=identicon)[titpetric](/maintainers/titpetric)

---

Top Contributors

[![jlogsdon](https://avatars.githubusercontent.com/u/88460?v=4)](https://github.com/jlogsdon "jlogsdon (37 commits)")[![scribu](https://avatars.githubusercontent.com/u/225715?v=4)](https://github.com/scribu "scribu (6 commits)")[![thanj](https://avatars.githubusercontent.com/u/1890887?v=4)](https://github.com/thanj "thanj (2 commits)")

### Embed Badge

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

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

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.4k](/packages/illuminate-console)[styleci/cli

The CLI tool for StyleCI

71470.5k9](/packages/styleci-cli)[winbox/args

Windows command-line formatter

20720.9k21](/packages/winbox-args)[macopedia/magento2-categoryimporter

Category Importer for Magento 2

344.7k](/packages/macopedia-magento2-categoryimporter)

PHPackages © 2026

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