Create terminal applications with ease

2.0.1 2023-05-10 15:59 UTC

This package is auto-updated.

Last update: 2024-05-23 10:09:05 UTC


README

A component to create easily extendible and executable CLI scripts. Includes a class to format text as terminal output in a simplified way.

Installation

requires PHP ^8.2

Require GSpataro/CLI via composer:

composer require gspataro/cli

Quick Start

use GSpataro\CLI;

// Initialize the commands collection
$commands = new CLI\CommandsCollection();

// Create a command called 'hi' that will print 'hello world' to the console
$commands->create('hi')
    ->setCallback(fn(CLI\Input $input, CLI\Output $output) => $output->print('Hello world!'));

// Initialize the component by providing a collection of commands
$handler = new CLI\Handler($commands);
$handler->deploy();

If you want to learn more about this component's features please read the WIKI.

Contribute

If you want to contribute to this repository please follow the guidelines here: CONTRIBUTING.md

Consider also following me on twitter: @gspataro96

Changelog

To see all the latest changes see the CHANGELOG.

License

The GSpataro/CLI component is licensed under the MIT License.