PHPackages                             slk/icm - 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. slk/icm

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

slk/icm
=======

Interactive Command line Markup

25.4k1PHP

Since Aug 12Pushed 10y ago1 watchersCompare

[ Source](https://github.com/slaff/slk-icm)[ Packagist](https://packagist.org/packages/slk/icm)[ RSS](/packages/slk-icm/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (1)

Interactive Command line Markup(ICM)

ICM is created to allow you easily create intereactive tutorials for your command line program similar to the interactive tutorials of Redis () or Docker ().

Installation
============

[](#installation)

Add the following line in in require compose.json section:

"slk/icm" : "dev-master"

After that in your PHP application you can use the Slk\\View\\ICMRenderer.

Markup Langage
==============

[](#markup-langage)

Prompt

```
To prompt the user input you can add in the beginning of a line the following

>_

To prompt for user output and show also the name of the command line program use:

>$_

The sequence below can be used to check against the user input against expected value:

>$_
==--help

That above two lines will create a prompt with the name of the current program and will expect
from the user to enter --help

You can also use also regular experession for input matching

>$_
==/\s*\-\-help\s*/

The command above will check if the user entered --help with or without trailing spaces.

If the expected input from the user is difficult for him to guess you can add an example.

>$_
==/\s*command\s+\-\-help\s*/
===command --help

And finally if you want to save the user input you can store it in a variable with a name

>$_
==/\s*command\s+\-\-help\s*/
===command --help
=> input

The above three lines will ask the user for an input, he has to answer with "command --help" or will be shown the
example at the end and the input of the user will be saved in a variable with the name input.

Command exection

```

To pass arguments to the current console line program and execute them you can use the following syntax:

$\_ xyz

This will execute the in a separate shell " xyz". The result will be save in a variable with a name "result".

Variables

```
Variables are describe in the same way that you do in PHP. There is one pre-defined variable $script that contains
the full name of the command line application that is currently executed.

After command execution with $_ the result is saved in $result.
The input from a promt can be saved in a named variable that can be used later on.

>$_
==/\s*command\s+\-\-help\s*/
===command --help
=> input

In the example above after these four lines are executed you can get the info by reading $input.

Page breaks

```

If you have a line starting with three or more dashes (-) then this will ask the user to press enter to continue. And if you have three or more &gt; symbols this will ask the user to press enter in order to go on the next page. Going on the next page in a command line context means to clear the currect screen.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

[![slaff](https://avatars.githubusercontent.com/u/247452?v=4)](https://github.com/slaff "slaff (2 commits)")

### Embed Badge

![Health badge](/badges/slk-icm/health.svg)

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

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

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[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)

PHPackages © 2026

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