PHP Classes

How to Create A PHP Command Line Application with the PackageEasyCLI: Create CLI applications using handler functions

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-05-02 (3 months ago) RSS 2.0 feedNot enough user ratingsTotal: 4 This week: 1All time: 11,423 This week: 59Up
Version License PHP version Categories
easy-cli 1.0.0Custom (specified...8Console, Traits, PHP 8
Description 

Author

This package can create CLI applications using handler functions.

It provides an application class that processes the parameters passed to the PHP CLI as text parameters from the console.

The package also provides command classes that store the values of parameters passed from the console defined by the developer.

The application class will invoke the callback functions after it processes the parameters passed from the console.

Picture of Andrey Postal
  Performance   Level  

 

Documentation

Progress Bar Gif

Easy CLI for PHP

A simple and easy to use library with no dependencies for creating pretty and organized CLI apps in PHP.

Probably I should have thought of a name for it.

Installation

composer require andreypostal/cli

Basic Usage

$app = new App(
    appName: 'MyApp',
    description: 'My app has a cool description',
    cmd: 'php cmd',
    params: [],
    commands: [
        new Command(
            key: 'run',
            description: 'This action will run soon',
            service: [
                'handler' => static function(Context $context): void {
                    App::console('It is so easy!!!');
                },
            ],
        ),
    ],
);
$app->run($argv);

Docs

Examples

About

Author

Andrey Postal - <andreypostal@gmail.com> <br />

License

CLI is licensed under the Apache License 2.0 - see the LICENSE file for details

Acknowledgements

Highly inspired by the Go library urfave/cli


  Files folder image Files (34)  
File Role Description
Files folder imageassets (5 files)
Files folder imagedoc (3 files)
Files folder imageexamples (7 directories)
Files folder imagesrc (1 file, 4 directories)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:4
This week:1
All time:11,423
This week:59Up