wp-cli / php-cli-tools

A collection of tools to help with PHP command line utilities
MIT License
673 stars 118 forks source link
cli command-line hacktoberfest wp-cli

PHP Command Line Tools

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

Requirements

Suggested PHP extensions

Function List

Progress Indicators

Tabular 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

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

See examples/ directory for examples.

Todo