Download the PHP package inanepain/cli without Composer
On this page you can find all versions of the php package inanepain/cli. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download inanepain/cli
More information about inanepain/cli
Files in inanepain/cli
Informations about the package cli
= inanepain/cli image:./icon.png[title=inanepain/cli,25] // tag::tagConfig[] :author: Philip Michael Raab :email: [email protected] :description: Utilities to simplify working with the console. :keywords: inanepain, library, console, cli, utility, text-table, prompt :homepage: https://github.com/inanepain/cli :copyright: Unlicense :revnumber: 26.10.1 :revdate: 2026-Oct-26 :experimental: :hide-uri-scheme: :icons: font :source-highlighter: highlight.js :toc: left :sectanchors: :idprefix: topic- :idseparator: - :pkg-vendor: inanepain :pkg-name: cli :pkg-id: {pkg-vendor}/{pkg-name} // end::tagConfig[]
== image:./icon.png[title={pkg-id},25] {pkg-id}
{description}
:sectnums:
<<<
Requirements
- PHP >= 8.5
Suggested PHP extensions
- mbstring - Used for calculating string widths.
<<<
:leveloffset: +1
= Install
.composer [source,shell,subs=attributes+]
composer require {pkg-id}
:leveloffset!:
<<<
== Function List
Inane\Cli\out($msg, ...)Inane\Cli\out_padded($msg, ...)Inane\Cli\err($msg, ...)Inane\Cli\line($msg = '', ...)Inane\Cli\input()Inane\Cli\prompt($question, $default = false, $marker = ':')Inane\Cli\choose($question, $choices = 'yn', $default = 'n')Inane\Cli\menu($items, $default = false, $title = 'Choose an Item')
== Progress Indicators
Inane\Cli\notify\Dots($msg, $dots = 3, $interval = 100)Inane\Cli\notify\Spinner($msg, $interval = 100)Inane\Cli\progress\Bar($msg, $total, $interval = 100)
== Tabular Display
Inane\Cli\Table::__construct(array $headers = null, array $rows = null)Inane\Cli\Table::setHeaders(array $headers)Inane\Cli\Table::setRows(array $rows)Inane\Cli\Table::setRenderer(cli\table\Renderer $renderer)Inane\Cli\Table::addRow(array $row)Inane\Cli\Table::sort($column)Inane\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 Inane\Cli\Table::setRenderer() and giving it an instance of one
of the concrete Inane\Cli\table\Renderer classes.
== TextTable Display
Alternative table display.
[source,php]
$tt = new \Inane\Cli\TextTable(); $tt->addHeader(['Name', 'Description']); $tt->addRow(['TextTable', 'Alternative table display.']); echo $tt->render();
== Tree Display
Inane\Cli\Tree::__construct()Inane\Cli\Tree::setData(array $data)Inane\Cli\Tree::setRenderer(cli\tree\Renderer $renderer)Inane\Cli\Tree::render()Inane\Cli\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
- Expand this README
- Add doc blocks to rest of code
All versions of cli with dependencies
inanepain/stdlib Version >=0.11.0 || dev-master || dev-develop
ext-intl Version *
ext-mbstring Version *
ext-posix Version *