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

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

bheisig/cli
===========

Framework for command line interfaces

0.3(7y ago)07411AGPL-3.0+PHPPHP &gt;=5.6.0

Since Apr 24Pushed 6y ago1 watchersCompare

[ Source](https://github.com/bheisig/cli)[ Packagist](https://packagist.org/packages/bheisig/cli)[ Docs](https://github.com/bheisig/cli)[ RSS](/packages/bheisig-cli/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (1)Dependencies (10)Versions (4)Used By (1)

CLI
===

[](#cli)

PHP Framework for command line interfaces

[![Latest Stable Version](https://camo.githubusercontent.com/77e5f8dbd62862b064f38386ff757feb4877c419d25c7ec8a4d8f65ca98e6123/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f626865697369672f636c692e737667)](https://packagist.org/packages/bheisig/cli)[![Minimum PHP Version](https://camo.githubusercontent.com/5c3072425e67297c8ef63d17acd2c86a0d2ef324f19249f2280bd7de902f63a2/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230372e302d3838393242462e737667)](https://php.net/)[![Build Status](https://camo.githubusercontent.com/8cda67c88ef5ee4fcaf889c1a1c41634c5bcd16aac7e06ae7919bbaf6f8e81aa/68747470733a2f2f7472617669732d63692e6f72672f626865697369672f636c692e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/bheisig/cli)

About
-----

[](#about)

You want an easy way to build a command line tool written in PHP? You are bored of big, over-engineered frameworks? And last but not least, you do not want to reinvent the wheel? -- Great, this could be the (almost) perfect solution for your next project.

The goal is to build intuitive CLI tools. Nobody likes to read documentation, so make your application self-descriptive!

Features
--------

[](#features)

- Easy-to-install via [Composer](https://getcomposer.org/)
- Perfectly suited to create a single binary file from your application
- Simple interface
- Separate your features by commands
- Runs on POSIX-like systems (GNU/Linux, MacOS, …) and Windows
- Error/exception handling
- Optional colored output based on log level
- Log to standard or error output
- Pre-defined usage output
- JSON-based configuration with defaults, system-wide, user defined and runtime settings
- Support for long and short options with optional or required values
- Pre-defined options for verbosity/quietness, usage, version information, additional configuration files, runtime settings, configuration test
- Verbosity mode outputs human-readable runtime in seconds and peak memory usage

Example
-------

[](#example)

For a simple application look at the `example/` folder.

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

[](#requirements)

- PHP, version 7.1 or higher (7.0 works but is deprecated, 7.3 is recommended, unreleased 7.4 should work)
- PHP modules `calendar`, `cli`, `date`, `filter` and `json`

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

[](#installation)

Go to your project folder and require this framework via Composer:

```
composer require bheisig/cli

```

Update
------

[](#update)

Composer is the way to go:

```
composer update

```

Copyright &amp; License
-----------------------

[](#copyright--license)

Copyright (C) 2018-19 [Benjamin Heisig](https://benjamin.heisig.name/)

Licensed under the [GNU Affero GPL version 3 or later (AGPLv3+)](https://gnu.org/licenses/agpl.html). This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

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

Total

3

Last Release

2611d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/316b1a776fd7792d9a7cd9e199131cee2724593a712d5723924333c3f731d46d?d=identicon)[bheisig](/maintainers/bheisig)

---

Top Contributors

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

---

Tags

cliphpcliapp

###  Code Quality

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[symfony/console

Eases the creation of beautiful and testable command line interfaces

9.8k1.1B13.6k](/packages/symfony-console)[nunomaduro/collision

Cli error handling for console/command-line PHP applications.

4.7k357.7M10.7k](/packages/nunomaduro-collision)[nunomaduro/termwind

It's like Tailwind CSS, but for the console.

2.5k271.5M375](/packages/nunomaduro-termwind)[wp-cli/wp-cli

WP-CLI framework

5.1k18.5M401](/packages/wp-cli-wp-cli)[wp-cli/php-cli-tools

Console utilities for PHP

68227.8M375](/packages/wp-cli-php-cli-tools)[socialengine/sniffer-rules

A Lumen 5 and Laravel 5 SquizLabs Code Sniffer 2.0 artisan command. Detect violations of a defined coding standard. It helps your code remains clean and consistent.

1348.3k1](/packages/socialengine-sniffer-rules)

PHPackages © 2026

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