PHPackages                             ricardopedias/freep-console - 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. [Framework](/categories/framework)
4. /
5. ricardopedias/freep-console

ActiveTool[Framework](/categories/framework)

ricardopedias/freep-console
===========================

Toolkit for implementing PHP-based terminal commands

v1.2.0(4y ago)11.5k1MITPHPPHP ^8.0.0

Since May 30Pushed 3y ago1 watchersCompare

[ Source](https://github.com/ricardopedias/freep-console)[ Packagist](https://packagist.org/packages/ricardopedias/freep-console)[ RSS](/packages/ricardopedias-freep-console/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (5)Dependencies (6)Versions (6)Used By (1)

Freep Console
=============

[](#freep-console)

[![PHP Version](https://camo.githubusercontent.com/911a83e2aa6fe73660ab613629a95c76622bf03049a7344e80c5ea72d4ef9c7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e302d626c7565)](https://camo.githubusercontent.com/911a83e2aa6fe73660ab613629a95c76622bf03049a7344e80c5ea72d4ef9c7d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e302d626c7565)[![License](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)[![Codacy Badge](https://camo.githubusercontent.com/4476837b9e46762afc3446a5ed1b12e5017fa852cf33e54b7f870d0fa02627d0/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3561393131653533663063633432313238326438343764333233663530323033)](https://www.codacy.com/gh/ricardopedias/freep-console/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ricardopedias/freep-console&utm_campaign=Badge_Coverage)[![Codacy Badge](https://camo.githubusercontent.com/b4788dff66ebc734e2db3532e99e67d4f2d5beaaadbcbcbca429b16e3af6f7fd/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3561393131653533663063633432313238326438343764333233663530323033)](https://www.codacy.com/gh/ricardopedias/freep-console/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ricardopedias/freep-console&utm_campaign=Badge_Grade)

[English](readme.md)[Português](./docs/pt-br/leiame.md)Synopsis
--------

[](#synopsis)

This repository contains the necessary functionality to easily implement a terminal command manager in a PHP application.

```
composer require ricardopedias/freep-console
```

For detailed information, see [Documentation Summary](docs/en/index.md).

How to use
----------

[](#how-to-use)

### 1. Create a command

[](#1-create-a-command)

Implement a command called "my-command", based on the abstract class `Freep\Console\Command`:

```
class MyCommand extends Command
{
    protected function initialize(): void
    {
        $this->setName("my-command");
        $this->addOption(
            new Option('-r', '--read', 'Read a text file', Option::REQUIRED)
        );
    }

    protected function handle(Arguments $arguments): void
    {
        $this->info("Hello");
    }
}
```

### 2. Create a script

[](#2-create-a-script)

Create a file, call it for example "myconsole", and add the following content:

```
#!/bin/php
