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

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

bentools/simple-cli
===================

A very lightweight CLI helper with almost no dependency.

0.2(6y ago)152MITPHPPHP &gt;= 7.1

Since Jan 28Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bpolaszek/simple-cli)[ Packagist](https://packagist.org/packages/bentools/simple-cli)[ RSS](/packages/bentools-simple-cli/feed)WikiDiscussions master Synced 4d ago

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

Simple CLI
==========

[](#simple-cli)

Command-line helper functions, with almost no dependencies, to help you build console scripts quickly.

It is not intended to be a full-featured CLI framework, but rather to help you grab arguments / options that were passed to your script, display some text, and prompt for user input.

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

[](#installation)

```
composer require bentools/simple-cli:0.2.*
```

Usage
-----

[](#usage)

```
# php thatscript.php --file=some-file foobar
require_once __DIR__ . '/vendor/autoload.php';
use function BenTools\SimpleCli\cli;
use function BenTools\SimpleCli\getOption;
use function BenTools\SimpleCli\getArgument;
use function BenTools\SimpleCli\writeLn;
use function BenTools\SimpleCli\text;
use function BenTools\SimpleCli\ask;
use function BenTools\SimpleCli\askHidden;
use function BenTools\SimpleCli\confirm;
use function BenTools\SimpleCli\error;
use function BenTools\SimpleCli\success;

getOption('file'); // some-file
getArgument(0); // foobar
writeLn(text('Hey there!')->yellow());

$user = ask('What is your username?', $default = 'anonymous');
$password = askHidden('Enter your password');

if ('123456' === $password && confirm('Really?')) {
    error('Nope nope nope!', $exit = true);
}

success('Done!');
```

License
-------

[](#license)

MIT.

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity44

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 ~21 days

Total

3

Last Release

2259d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/acdd1a8ee0e657ddd06cf11f98a32100ef7121afb8aa270a5b295f5c29c038b3?d=identicon)[bpolaszek](/maintainers/bpolaszek)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[nategood/commando

PHP CLI Commando Style

8123.3M38](/packages/nategood-commando)[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)

PHPackages © 2026

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