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

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

adeptoas/sweet-cli
==================

Framework for making easy CLI applications

v1.4.0(4y ago)1128proprietaryPHPPHP &gt;=7.4

Since Dec 28Pushed 4y ago6 watchersCompare

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

READMEChangelog (2)Dependencies (3)Versions (13)Used By (0)

SweetCLI
========

[](#sweetcli)

A framework for creating awesome CLI applications using PHP.

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

[](#installation)

Add this to `composer.json`:

```
"require": {
	"adeptoas/sweet-cli": "^1.4.0"
}
```

Make sure to merge your `require`-blocks!

Examples
--------

[](#examples)

For examples have a look in `/example`. There you'll find a step-by-step tutorial on how to create a CLI application.

Concept
-------

[](#concept)

Your CLI application will consist of the main entry point and your subcommands. Each subcommand can have options and arguments and is free to do whatever it needs to do. Commands look like this:

- `cli subcommand -o -n 2 --long-opt --long-opt-string Example`
- `cli subcommand -on 2 --long-opt "Some Argument"`
- `cli -vv subcommand -on 2`
- …

How to Build an Application
---------------------------

[](#how-to-build-an-application)

1. Create a new file you want to use as your "binary" to be run. I recommend `cli`.
2. Put this in the top of your file (*nothing* before it!):

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