PHPackages                             iquety/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. iquety/console

ActiveTool[Framework](/categories/framework)

iquety/console
==============

Toolkit for implementing PHP-based terminal routines

v4.1.2(2mo ago)03.7k—0%3MITPHPPHP ^8.4.0CI passing

Since May 30Pushed 3mo agoCompare

[ Source](https://github.com/iquety/console)[ Packagist](https://packagist.org/packages/iquety/console)[ RSS](/packages/iquety-console/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)Dependencies (14)Versions (18)Used By (3)

Iquety Console
==============

[](#iquety-console)

[![GitHub Release](https://camo.githubusercontent.com/c1755c027a27610866e8d9ecb98cfc4809d909c2b6d74cdbdb0e7da95d61094f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652f6971756574792f636f6e736f6c652e737667)](https://github.com/iquety/console/releases/latest)[![PHP Version](https://camo.githubusercontent.com/504ead6a583c68d8d62d7bfceed24e569ca613d7a36bed380281b3455b5c7b31/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e342d626c7565)](https://camo.githubusercontent.com/504ead6a583c68d8d62d7bfceed24e569ca613d7a36bed380281b3455b5c7b31/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253545382e342d626c7565)[![License](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)](https://camo.githubusercontent.com/b8cadaa967891081f8f165695470689986c028821dd8a040132f6e661795dc0d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c7565)[![Codacy Badge](https://camo.githubusercontent.com/c9617b99d5c90ce73eed3f28dd47c344aa26cc61d54766b6e80add413f26fc6c/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3232656536323135613739383464373039366238333362333865366461323665)](https://www.codacy.com/gh/iquety/console/dashboard?utm_source=github.com&utm_medium=referral&utm_content=iquety/console&utm_campaign=Badge_Grade)[![Codacy Badge](https://camo.githubusercontent.com/b67d5b5034144e24b126f5e6fd37fa48c6d2eb94baa337c244a5af59e5dcbbba/68747470733a2f2f6170702e636f646163792e636f6d2f70726f6a6563742f62616467652f436f7665726167652f3232656536323135613739383464373039366238333362333865366461323665)](https://www.codacy.com/gh/iquety/console/dashboard?utm_source=github.com&utm_medium=referral&utm_content=iquety/console&utm_campaign=Badge_Coverage)

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

[](#synopsis)

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

```
composer require iquety/console
```

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

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

[](#how-to-use)

### 1. Create a routine

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

Implement a routine called "my-routine", based on the abstract class `Iquety\Console\Routine`:

```
class MyRoutine extends Routine
{
    protected function initialize(): void
    {
        $this->setName("my-routine");
        $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
