Create terminal applications with ease

Maintainers

Details

github.com/gspataro/CLI

Source

Issues

Installs: 18

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/gspataro/cli

2.0.1 2023-05-10 15:59 UTC

This package is auto-updated.

Last update: 2025-10-05 15:57:33 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.