PHPackages                             phico/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. phico/cli

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

phico/cli
=========

Lightweight terminal support for Phico

043PHP

Since Sep 4Pushed 1y agoCompare

[ Source](https://github.com/phico-php/cli)[ Packagist](https://packagist.org/packages/phico/cli)[ RSS](/packages/phico-cli/feed)WikiDiscussions main Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

CLI
===

[](#cli)

Lightweight terminal support for [Phico](https://github.com/phico-php/phico)

Installation
------------

[](#installation)

Using composer

```
composer require phico/cli
```

Usage
-----

[](#usage)

CLI provides a handful of useful methods for terminal interaction.

It is useful when creating your own commands.

### Cli

[](#cli-1)

#### Write a line to the terminal

[](#write-a-line-to-the-terminal)

```
$input = write('Hello world');
```

##### Continue on the same line

[](#continue-on-the-same-line)

```
write(', this is Phico', $newline = false);
```

##### Colour support

[](#colour-support)

Use error(), info(), success(), warning() to use different highlight colours.

#### Request user input

[](#request-user-input)

```
$input = prompt('What is your name? ');
```

##### Limit choices in response

[](#limit-choices-in-response)

```
// only one of red, blue or green is accepted
$input = prompt('What is your favourite colour? ', [
    'red',
    'blue',
    'green
]);
```

#### Write a title

[](#write-a-title)

```
$input = title('This will be underlined');

// This will be underlined
// =======================
```

#### Draw a table

[](#draw-a-table)

```
$data = [
    ['Kermit', 'Green'],
    ['Fozzy Bear', 'Brown'],
    ['Miss Piggy', 'Pink'],
    ['Gonzo', 'Blue'],
];
$headings = [ 'Name', 'Colour' ];

$input = table($data, $headings);
```

Args
----

[](#args)

Args handles terminal inout by organising it into flags (short or long), arguments and values.

### Flags

[](#flags)

Specify single character flags with a single dash

```
phico -v
```

Multiple single flags can be set with a single dash

```
phico -vrt
```

Use has() to check if a flag is set

```
phico -vrt
```

```
$args->has('v'); // true
$args->has('r'); // true
$args->has('t'); // true

$args->has('a'); // false
```

Issues
------

[](#issues)

CLI is considered feature complete, however if you discover any bugs or issues in it's behaviour or performance please create an issue, and if you are able a pull request with a fix.

Please make sure to update tests as appropriate.

For major changes, please open an issue first to discuss what you would like to change.

License
-------

[](#license)

[BSD-3-Clause](https://choosealicense.com/licenses/bsd-3-clause/)

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance27

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity18

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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://avatars.githubusercontent.com/u/65541311?v=4)[indgy](/maintainers/indgy)[@indgy](https://github.com/indgy)

---

Top Contributors

[![indgy](https://avatars.githubusercontent.com/u/65541311?v=4)](https://github.com/indgy "indgy (6 commits)")

### Embed Badge

![Health badge](/badges/phico-cli/health.svg)

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

###  Alternatives

[illuminate/console

The Illuminate Console package.

13046.0M6.5k](/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)[tomatophp/filament-artisan

Simple but yet powerful library for running some artisan commands for FilamentPHP

3275.4k1](/packages/tomatophp-filament-artisan)

PHPackages © 2026

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