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

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

fenzland/cli
============

For build cli applications.

0.2.0(8y ago)05MITPHPPHP &gt;=7.1

Since Feb 27Pushed 8y ago1 watchersCompare

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

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

PHP CLI
=======

[](#php-cli)

A PHP CLI support library.

Basic Usage
-----------

[](#basic-usage)

#### 1. Improt library by composer.

[](#1-improt-library-by-composer)

```
composer require fenzland/cli
```

```
require PROJECT_PATH.'/vendor/autoload.php';
```

#### 2. Build your commands.

[](#2-build-your-commands)

```
class FooCmd extends \Fenzland\CLI\ACmd
{
	protected function main( \Fenzland\CLI\IArgs$args ):int
	{
		# TODO code of your command.
	}
}
```

#### 3. Build your cli entry.

[](#3-build-your-cli-entry)

##### PlanA: To run a single command.

[](#plana-to-run-a-single-command)

```
vim foo.php
```

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