PHPackages                             minicli/minicli - 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. minicli/minicli

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

minicli/minicli
===============

Experimental micro CLI framework for PHP

4.2.1(1y ago)1.1k382.5k↑47.2%5720MITPHPPHP &gt;=8.2CI failing

Since Sep 20Pushed 3mo ago19 watchersCompare

[ Source](https://github.com/minicli/minicli)[ Packagist](https://packagist.org/packages/minicli/minicli)[ Docs](https://github.com/minicli/minicli)[ GitHub Sponsors](https://github.com/erikaheidi)[ RSS](/packages/minicli-minicli/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (43)Used By (20)

[![logo](https://camo.githubusercontent.com/3a10c5b6fd47ffb182a9e7596410a76d01d1253e852595bed782f8db034d91c1/68747470733a2f2f646f63732e6d696e69636c692e6465762f656e2f6c61746573742f696d616765732f6c6f676f2f6d696e69636c695f6c6f676f5f7465726d5f70696e6b2e706e67 "Minicli logo")](https://camo.githubusercontent.com/3a10c5b6fd47ffb182a9e7596410a76d01d1253e852595bed782f8db034d91c1/68747470733a2f2f646f63732e6d696e69636c692e6465762f656e2f6c61746573742f696d616765732f6c6f676f2f6d696e69636c695f6c6f676f5f7465726d5f70696e6b2e706e67)

 [ ![Latest Stable Version](https://camo.githubusercontent.com/838517110373e3b98ac2adb59db0566996b92a880ace7a9cc7e481e1553ba275/68747470733a2f2f706f7365722e707567782e6f72672f6d696e69636c692f6d696e69636c692f76 "Latest Stable Version") ](//packagist.org/packages/minicli/minicli) [ ![Total Downloads](https://camo.githubusercontent.com/31f081324dfb0a082234e52a09b272f7f57bdcf338f8d3b724ffe80d9daf7d55/68747470733a2f2f706f7365722e707567782e6f72672f6d696e69636c692f6d696e69636c692f646f776e6c6f616473 "Total Downloads") ](//packagist.org/packages/minicli/minicli) [ ![License](https://camo.githubusercontent.com/3488eb286f832e0ef6e09b37c3e7afc001000765ab434605a690fb122d9129e9/68747470733a2f2f706f7365722e707567782e6f72672f6d696e69636c692f6d696e69636c692f6c6963656e7365 "License") ](//packagist.org/packages/minicli/minicli) [ ![Documentation Status](https://camo.githubusercontent.com/5ab7d63c947ce192555aee9455f0842962b1935ec57b5f66a5f9befa538f93e3/68747470733a2f2f72656164746865646f63732e6f72672f70726f6a656374732f6d696e69636c697068702f62616467652f3f76657273696f6e3d6c6174657374 "Documentation Status") ](https://docs.minicli.dev/en/latest/?badge=latest)

 Minicli
=========

[](#--------minicli----)

####  Minimalist, dependency-free framework for building CLI-centric PHP applications

[](#--------minimalist-dependency-free-framework-for-building-cli-centric-php-applications----)

---

[Minicli](https://docs.minicli.dev) is a minimalist, dependency-free framework for building CLI-centric PHP applications. It provides a structured way to organize your commands, as well as various helpers to facilitate working with command arguments, obtaining input from users, and printing colored output.

Quick links:

- [Documentation](https://docs.minicli.dev)
- [Demos](https://github.com/minicli/demos)
- [Contributing](CONTRIBUTING.md)
- [Contributors](CONTRIBUTORS.md)

Dependency-free: What Does it Mean
----------------------------------

[](#dependency-free-what-does-it-mean)

What does it mean to be dependency-free? It means that you can build a working CLI PHP application without dozens of nested user-land dependencies. The basic `minicli/minicli` package has only **testing** dependencies, and a single system requirement:

- PHP &gt;= 8.1

> Note: If you want to obtain user input, then the [`readline`](https://www.php.net/manual/en/function.readline.php) PHP extension is required as well.

It gives you a lot of room to choose your own dependencies.

Getting Started
---------------

[](#getting-started)

There are two ways to get started. If you want the bare minimum, what we'll call "Minimalist App", you can create a single PHP script with your whole application. If you want a more structured application, with commands and subcommands, then you should use Command Namespaces to organize your commands into Controllers.

### Minimalist App

[](#minimalist-app)

If you just want to set up a few simple commands to run through `minicli`, all you need to do is to create an `App` and register your commands as anonymous functions.

1. Create an empty project
2. Run `composer require minicli/minicli` - this will generate a new `composer.json` file.
3. Create a `minicli` script with the following content:

```
#!/usr/bin/env php
