PHPackages                             bear8421/command-line-tool - 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. bear8421/command-line-tool

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

bear8421/command-line-tool
==========================

Base Command Line Tool use Silly CLI micro-framework based on Symfony Console

v1.1.9(1y ago)341MITPHPPHP ^7.4 || ^8.0

Since Sep 22Pushed 1y ago2 watchersCompare

[ Source](https://github.com/bear8421/command-line-tool)[ Packagist](https://packagist.org/packages/bear8421/command-line-tool)[ Docs](https://github.com/bear8421/command-line-tool)[ RSS](/packages/bear8421-command-line-tool/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (5)Versions (21)Used By (0)

Command Line Tool with PHP
==========================

[](#command-line-tool-with-php)

[![Latest Stable Version](https://camo.githubusercontent.com/5c7769c356978db3f656ff02531dc02011f498aab7a330a679a66d78b30319fb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62656172383432312f636f6d6d616e642d6c696e652d746f6f6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bear8421/command-line-tool)[![Total Downloads](https://camo.githubusercontent.com/b2e8bb664884c0598ecae6cd34f9d3ec0edc2d5606271ab94073e835ecc9f0b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62656172383432312f636f6d6d616e642d6c696e652d746f6f6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bear8421/command-line-tool)[![License](https://camo.githubusercontent.com/90a67acc31399bf7c036c573ad23eb13db2bd13b7ea7223ec49c35e06407cb5a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f62656172383432312f636f6d6d616e642d6c696e652d746f6f6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/bear8421/command-line-tool)[![PHP Version Require](https://camo.githubusercontent.com/61b816543ba566331b7fedd0ffec73027e589515dc86c69a074ac44741b02a4e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f62656172383432312f636f6d6d616e642d6c696e652d746f6f6c2f706870)](https://packagist.org/packages/bear8421/command-line-tool)

Start Project Command Line Tool use PHP with Silly CLI micro-framework based on Symfony Console

Donate Me
---------

[](#donate-me)

Buy me a coffee:

Summary
-------

[](#summary)

KeyValueProjectCommand Line ToolFrameworkSilly CLI micro-frameworkGitHubPackagistInstall the Application
-----------------------

[](#install-the-application)

Run this command from the directory in which you want to install your new CLI micro-framework application.

```
composer create-project bear8421/command-line-tool [my-app-name]
```

or

```
php composer.phar create-project bear8421/command-line-tool [my-app-name]
```

Replace `[my-app-name]` with the desired directory name for your new application.

Usage
-----

[](#usage)

Create `TestCommand` in namespace `Bear\App\Command`

```
class TestCommand
{
    public function __invoke($name, $upper, OutputInterface $output)
    {
        if ($name) {
            $text = 'Hello, Iam ' . $name;
            $output->writeln("Bear");
        } else {
            $text = 'Hello, Iam. BEAR';
        }
        if ($upper) {
            $text = strtoupper($text);
        }
        $output->writeln($text);
    }
}
```

And declare Command in `Bear` in `bear` file in root folder

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