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

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

ikm/cli
=======

CLI formatting tools

0.2.0(4mo ago)06411MITPHPPHP ^8.3

Since Dec 9Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/ian-maurmann-2/ikm-cli)[ Packagist](https://packagist.org/packages/ikm/cli)[ RSS](/packages/ikm-cli/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (3)Used By (1)

ikm-cli
=======

[](#ikm-cli)

PHP lib with CLI formatting tools

Install:
--------

[](#install)

- Open the terminal and navigate to the directory your project will be in.
- Install Composer:
- Require `ikm/cli` with Composer:

```
php composer.phar require ikm/cli
```

Usage:
------

[](#usage)

Write a line of text:

```
require '../vendor/autoload.php';

$writer = new \IKM\CLI\CommandLineWriter();

$writer->writeLine('Hello, World!');
```

Write a line of text in yellow:

```
require '../vendor/autoload.php';

$writer = new \IKM\CLI\CommandLineWriter();
$format = new \IKM\CLI\CommandLineFormatter();

$writer->writeLine($format->fg_bright_yellow  . 'Yellow, World!' . $format->reset);
```

### Colors:

[](#colors)

(See: [https://en.wikipedia.org/wiki/ANSI\_escape\_code#Colors](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors))

Text color

darkbright`fg_dark_black``fg_bright_black``fg_dark_red``fg_bright_red``fg_dark_green``fg_bright_green``fg_dark_yellow``fg_bright_yellow``fg_dark_blue``fg_bright_blue``fg_dark_magenta``fg_bright_magenta``fg_dark_cyan``fg_bright_cyan``fg_dark_white``fg_bright_white`Background color

darkbright`bg_dark_black``bg_bright_black``bg_dark_red``bg_bright_red``bg_dark_green``bg_bright_green``bg_dark_yellow``bg_bright_yellow``bg_dark_blue``bg_bright_blue``bg_dark_magenta``bg_bright_magenta``bg_dark_cyan``bg_bright_cyan``bg_dark_white``bg_bright_white````
require '../vendor/autoload.php';

$writer = new \IKM\CLI\CommandLineWriter();
$format = new \IKM\CLI\CommandLineFormatter();

// Write a line of text
$writer->writeLine('Hello, World!');

// Write a yellow line of text
$writer->writeLine($format->fg_bright_yellow  . 'Yellow, World!' . $format->reset);

// Write, without any line break
$writer->write('Foo');

// Write a line break
$writer->br();

// Clear the screen
$writer->clearScreen();

// Add a divider
$writer->hr();

// Bold
$writer->writeLine($format->bold  . 'Bold' . $format->reset);

// Italic
$writer->writeLine($format->italic  . 'Italic' . $format->reset);

// Underline
$writer->writeLine($format->underline  . 'Underline' . $format->reset);

// Dim
$writer->writeLine($format->dim  . 'Dim' . $format->reset);

// Blink
$writer->writeLine($format->blink  . 'Blink' . $format->reset);
```

---

Tables (WIP)
------------

[](#tables-wip)

```
require '../vendor/autoload.php';

$writer = new \IKM\CLI\CommandLineWriter();
$format = new \IKM\CLI\CommandLineFormatter();
$table_builder = new \IKM\CLI\CommandLineTableBuilder();

// Data
$pets = [
    [
        'pet_name' => 'Spot',
        'kind_of_animal' => 'dog',
        'pet_number_legs' => 4,
        'pet_owner_name' => 'John Doe',
        'pet_owner_number_legs' => 2,
    ],
    [
        'pet_name' => 'Fluffy',
        'kind_of_animal' => 'cat',
        'pet_number_legs' => 4,
        'pet_owner_name' => 'Jane Doe',
        'pet_owner_number_legs' => 2,
    ],
    [
        'pet_name' => 'Flint',
        'kind_of_animal' => 'parrot',
        'pet_number_legs' => 2,
        'pet_owner_name' => 'John Silver',
        'pet_owner_number_legs' => 1,
    ],
];

$table_style = [
    'table_text_align' => 'left', // 'left' | 'right' | 'center'
    'table_border_fg_color' => 'dark-yellow',
    'table_cell_fg_color' => 'bright-yellow',
    'table_show_head' => true,
    'table_head_text_align' => 'center',
    'table_head_fg_color' => 'bright-green',
    'table_head_bg_color' => 'dark-blue',
    'table_head_weight' => 'bold',
];

$table_columns = [
    [
        'attribute' => 'pet_owner_name',
        'label'     => 'Owner',
    ],
    [
        'attribute' => 'pet_owner_number_legs',
        'label'     => 'Num. Legs',
    ],
    [
        'attribute' => 'pet_name',
        'label'     => 'Pet Name',
        'head_text_align' => 'left',
    ],
    [
        'attribute' => 'kind_of_animal',
        'label'     => 'Type',
        'text_align' => 'right',
    ],
    [
        'attribute' => 'pet_number_legs',
        'label'     => 'Num. Legs',
    ],
];

$table_builder->buildTable($pets, $table_style, $table_columns);
```

### Tags (For text in tables)

[](#tags-for-text-in-tables)

```
{previous}

{bold}
{dim}
{italic}
{underline}
{blink}

{fg_dark_black}
{fg_dark_red}
{fg_dark_green}
{fg_dark_yellow}
{fg_dark_blue}
{fg_dark_magenta}
{fg_dark_cyan}
{fg_dark_white}

{fg_bright_black}
{fg_bright_red}
{fg_bright_green}
{fg_bright_yellow}
{fg_bright_blue}
{fg_bright_magenta}
{fg_bright_cyan}
{fg_bright_white}

{bg_dark_black}
{bg_dark_red}
{bg_dark_green}
{bg_dark_yellow}
{bg_dark_blue}
{bg_dark_magenta}
{bg_dark_cyan}
{bg_dark_white}

{bg_bright_black}
{bg_bright_red}
{bg_bright_green}
{bg_bright_yellow}
{bg_bright_blue}
{bg_bright_magenta}
{bg_bright_cyan}
{bg_bright_white}

```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance78

Regular maintenance activity

Popularity10

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity44

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 92.5% 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 ~405 days

Total

2

Last Release

120d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/836c6cd2b579c2f3358039e6c64292b65ea0c51b338874d33d9c0239766785fe?d=identicon)[ikm](/maintainers/ikm)

---

Top Contributors

[![ian-maurmann](https://avatars.githubusercontent.com/u/10981013?v=4)](https://github.com/ian-maurmann "ian-maurmann (49 commits)")[![ian-maurmann-2](https://avatars.githubusercontent.com/u/181606881?v=4)](https://github.com/ian-maurmann-2 "ian-maurmann-2 (4 commits)")

### Embed Badge

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

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.1k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[seld/cli-prompt

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

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)[codedungeon/php-cli-colors

Liven up you PHP Console Apps with standard colors

10210.1M26](/packages/codedungeon-php-cli-colors)

PHPackages © 2026

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