PHPackages                             koshkin/yii-reach-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. koshkin/yii-reach-cli

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

koshkin/yii-reach-cli
=====================

Decorators and helpers for console applications based on Yii 1.\* framework

v0.2.2(10y ago)045MIT

Since Jun 17Compare

[ Source](https://github.com/KoshkinAlex/yii-reach-cli)[ Packagist](https://packagist.org/packages/koshkin/yii-reach-cli)[ RSS](/packages/koshkin-yii-reach-cli/feed)WikiDiscussions Synced today

READMEChangelogDependencies (1)Versions (4)Used By (0)

yii-reach-cli
=============

[](#yii-reach-cli)

Component for Yii 1.\* framework that helps to make console application more interactive and pretty for less time.

Requirements
------------

[](#requirements)

1. Yii framework &gt;= 1.1.9
2. PHP &gt;= 5.5

Usage
-----

[](#usage)

The simplest and fastest way for receive all functionality is to extend console commands in your applications from `\ReachCli\ConsoleCommand` base class. This class contains everything from this package.

Most of provided functionality is divided to separate and independent traits that are located under `./src/ReachCli/ConsoleCommandTraits` directory and `\ReachCli\ConsoleCommandTraits` namespace. You can choose and use any of them in any combination.

If you need all traits, but you don't want to extend from `\ReachCli\ConsoleCommand` base class, you can find all traits combined into one `\ReachCli\ConsoleCommandTraits\AllTogether` for easier include to projects.

Examples
--------

[](#examples)

In all examples `RCli` means `\ReachCli\RCli` class, and `$this` means instance of object that extends `\ReachCli\ConsoleCommand` class.

Output messages
---------------

[](#output-messages)

```
    // Message
    RCli::msg('Message text', RCli::FONT_RED)
    $this->msg('Message text', RCli::FONT_RED);

    // Message with line ending
    RCli::line('Message text', RCli::FONT_RED)
    $this->line('Message text', RCli::FONT_RED);

    // Horizontal line
    RCli::hr();
    $this->hr();
    RCli::hr('*', RCli::FONT_BLUE);

    // Header
    RCli::header('Message text');
    $this->header('Message text');
    $this->header('Message text', RCli::FONT_RED, RCli::FONT_BLUE);

    // Message with some status
    $this->status('Good news', true);
    $this->status('Bad news', false);
    $this->status('Status with some value', true, 300);
```

Interact with user
------------------

[](#interact-with-user)

```
    // Ask user for question with binary answer
    $userReply = $this->confirm("Do you want to launch rocket to Mars?", RCli::FONT_YELLOW);

    // Ask user for question with custom answer
    $userReply = $this->prompt("Please enter new password", RCli::FONT_BLUE);

	// Ask user for one of predefined answers
    $answers = [ 'banana', 'apple', 'strawberry', 'stone',];
    $userReply = $this->listSelect($answers, 'Please select most tasteless thing', 'apple');
```

Help for console command that is generated using PHPDoc annotations
-------------------------------------------------------------------

[](#help-for-console-command-that-is-generated-using-phpdoc-annotations)

Use trait `ReachCli\ConsoleCommandTraits\Help` to use this functionality separately. See `ReachCli\Examples\HelpCommand` for example.

```
    // Include trait
	use \ReachCli\ConsoleCommandTraits\Help;

	// Optional Set default action to 'help'
	public $defaultAction = 'help';

	// Or use this everywhere you want
	echo $this->getHelp();
```

Receive command, actions and parameters description, generated from command class structure and it's PHPDoc

```
 ReachCli\Examples\HelpCommand
 Class HelpCommand. This command shows functionality of automatic help generation.

	Available actions:

	message - Print message.
		--message=value

	repeatMessage - Print one message many times.
		--message=value	many times
		[--repeat=3]	Times to repeat message

	help [default]  - Default action - show command help.

```

Errors and warnings
-------------------

[](#errors-and-warnings)

Use trait `ReachCli\ConsoleCommandTraits\ErrorWarning` to use this functionality separately.

```
    $this->warning('Please try one more time');
    $this->error('Thank you Mario, but your princess is in another castle!');
```

Count different events and prints statistic for this events
-----------------------------------------------------------

[](#count-different-events-and-prints-statistic-for-this-events)

Use trait `ReachCli\ConsoleCommandTraits\Statistic` to use this functionality separately.

```
    // Remember "Event 1"
    $this->inc('Event 1');
    // Remember "Event 2" for 3 times
    $this->inc('Event 2', 3);

    // Print statistic
    $this->printStat();
```

Command execution timers
------------------------

[](#command-execution-timers)

Use trait `ReachCli\ConsoleCommandTraits\Timer` to use this functionality separately. See `ReachCli\Examples\TimerCommand` for example.

```
    $this->beginTimer(); // Start timer
    // ... Do something, maybe iteration of some cycle
    print "Execution time" . $this->stopTimer(); // Get iteration time

    print "Command total execution time" . $this->getExecutionTime();
```

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

3665d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3756587?v=4)[koshkin](/maintainers/koshkin)[@koshkin](https://github.com/koshkin)

---

Top Contributors

[![KoshkinAlex](https://avatars.githubusercontent.com/u/3653224?v=4)](https://github.com/KoshkinAlex "KoshkinAlex (20 commits)")

### Embed Badge

![Health badge](/badges/koshkin-yii-reach-cli/health.svg)

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

###  Alternatives

[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.3k](/packages/illuminate-console)

PHPackages © 2026

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