PHPackages                             plumphp/plum-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. [CLI &amp; Console](/categories/cli)
4. /
5. plumphp/plum-console

ActiveLibrary[CLI &amp; Console](/categories/cli)

plumphp/plum-console
====================

Integrates the Symfony Console component into Plum.

v0.5(10y ago)35.6k1MITPHPPHP &gt;=5.5

Since Mar 24Pushed 10y ago1 watchersCompare

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

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

 [![Plum](https://camo.githubusercontent.com/a81342cbfd6f64a484988488ad37bbd0e665d0f14f65ec655ae986097447bfb6/687474703a2f2f63646e2e666c6f7269616e2e65632f706c756d2d6c6f676f2e737667)](https://camo.githubusercontent.com/a81342cbfd6f64a484988488ad37bbd0e665d0f14f65ec655ae986097447bfb6/687474703a2f2f63646e2e666c6f7269616e2e65632f706c756d2d6c6f676f2e737667)
==================================================================================================================================================================================================================================================================================================================================================================

[](#----)

> PlumConsole integrates the [Symfony Console](http://symfony.com/doc/current/components/console/introduction.html)component into Plum. [Plum](https://github.com/plumphp/plum) is a data processing pipeline for PHP.

[![Build Status](https://camo.githubusercontent.com/4276c47385f9adc7fc3b8d8216e53bd1d421b925d305efddf5a438ce3117437e/68747470733a2f2f7472617669732d63692e6f72672f706c756d7068702f706c756d2d636f6e736f6c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/plumphp/plum-console)[![Windows Build status](https://camo.githubusercontent.com/cef7ed573fc7c53bba27c426485037e445468273d6f2caeff312345fc4aa9042/68747470733a2f2f63692e6170707665796f722e636f6d2f6170692f70726f6a656374732f7374617475732f336e35786633366a78326d7433326c373f7376673d74727565)](https://ci.appveyor.com/project/florianeckerstorfer/plum-console)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/7845e7641ac673e2e87c5402050abcecf861762fc15c2d9b5d5b363c5a6aa365/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706c756d7068702f706c756d2d636f6e736f6c652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/plumphp/plum-console/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/d15526215df2cb4a49ca04cfdcd4de55f89da6fab22a537f9d38a96bf5cbb4c9/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f706c756d7068702f706c756d2d636f6e736f6c652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/plumphp/plum-console/?branch=master)[![StyleCI](https://camo.githubusercontent.com/727440c17806e50cfa8ce38e941e10f0ac6e8a8bd94bbdf8c5ac2fa4ef0d6722/68747470733a2f2f7374796c6563692e696f2f7265706f732f33303637313733362f736869656c64)](https://styleci.io/repos/30671736)

Developed by [Florian Eckerstorfer](https://florian.ec) in Vienna, Europe.

Installation
------------

[](#installation)

You can install Plum using [Composer](http://getcomposer.org).

```
$ composer require plumphp/plum-console
```

Usage
-----

[](#usage)

Please refer to the [Plum documentation](https://github.com/plumphp/plum/blob/master/docs/index.md) for more information about Plum in general.

PlumConsole currently contains two writers: [`ConsoleProgressWriter`](#consoleprogresswriter) and [`ConsoleTableWriter`](#consoletablewriter). Both are intended to be used in an application that use the [Symfony Console](http://symfony.com/doc/current/components/console/introduction.html) component. In addition it provides [`ExceptionFormatter`](#exceptionformatter), which helps you printing nice error messages to users.

### `ConsoleProgressWriter`

[](#consoleprogresswriter)

`Plum\PlumConsole\ConsoleProgressWriter` displays the progress of a workflow in the console.

```
use Plum\PlumConsole\ConsoleProgressWriter;
use Symfony\Component\Console\Helper\ProgressBar;

// ...
// $output is an instance of Symfony\Component\Console\Output\OutputInterface
// $reader is an instance of Plum\Plum\Reader\ReaderInterface

$writer = new ConsoleProgressWriter(new ProgressBar($output, $reader->count()));
```

### `ConsoleTableWriter`

[](#consoletablewriter)

`Plum\PlumConsole\ConsoleTableWriter` outputs the processed data as table in the console.

```
use Plum\PlumConsole\ConsoleTableWriter;
use Symfony\Component\Console\Helper\Table;

// ...
// $output is an instance of Symfony\Component\Console\Output\OutputInterface

$writer = new ConsoleTableWriter(new Table($output));

// ConsoleTableWriter can automatically detect and set the headers
$writer->autoDetectHeader();

// Headers can also be set manually. This is required when the item is an object
$writer->setHeader(['Country', 'City']);
```

### `ExceptionFormatter`

[](#exceptionformatter)

Plum does offer the option to catch exceptions. When this option is active the workflow can resume processing even if an item is causing errors. However, you have to manually output exceptions, which can be a tedious process. `Plum\PlumConsole\ExceptionFormatter` can help you printing exceptions.

The granularity of the information can be controlled using the `--verbose` flag of Symfony Console. By default, the exception messages will be printed when the application is invoked using `--verbose` or `-v` and the messages and stack traces are printed when using `-vv`.

```
use Plum\Plum\Workflow;
use Plum\PlumConsole\ExceptionFormatter;

$workflow = Workflow(['resumeOnError' => true]);
// Build workflow
$result = $workflow->process($reader);

// $output is an instance of Symfony\Component\Console\Output\OutputInterface

$formatter = new ExceptionFormatter($output);
$formatter->outputExceptions($result);
```

The formatter offers options to configure both the granularity when messages and stack traces are shown and let you configure how they are printed. The following example shows all available options and the default values. Please note, that `messageTemplate` and `traceTemplate` are being printed using `sprintf()`.

```
use Plum\PlumConsole\ExceptionFormatter;
use Symfony\Component\Console\Output\OutputInterface;

// $output is an instance of Symfony\Component\Console\Output\OutputInterface

$formatter = new ExceptionFormatter($output, [
    'minMessageVerbosity' => OutputInterface::VERBOSITY_VERBOSE,
    'minTraceVerbosity'   => OutputInterface::VERBOSITY_VERY_VERBOSE,
    'messageTemplate'     => '%s',
    'traceTemplate'       => '%s',
]);
```

Change Log
----------

[](#change-log)

### Version 0.5 (1 March 2016)

[](#version-05-1-march-2016)

- Add support for Symfony 3

### Version 0.4 (24 October 2015)

[](#version-04-24-october-2015)

- [\#2](https://github.com/plumphp/plum-console/pull/2) Add helper to print nice exception messages
- [\#3](https://github.com/plumphp/plum-console/pull/3) ConsoleTableWriter can now write object items

### Version 0.3 (15 May 2015)

[](#version-03-15-may-2015)

- Add `ConsoleTableWriter`

### Version 0.2.1 (28 April 2015)

[](#version-021-28-april-2015)

- Fix Plum version

### Version 0.2 (21 April 2015)

[](#version-02-21-april-2015)

- Fix dependency to Plum

### Version 0.1 (24 March 2014)

[](#version-01-24-march-2014)

- Initial release
- Works with Plum v0.1

License
-------

[](#license)

The MIT license applies to plumphp/plum-console. For the full copyright and license information, please view the LICENSE file distributed with this source code.

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~34 days

Recently: every ~73 days

Total

11

Last Release

3730d ago

PHP version history (2 changes)0.1.x-devPHP &gt;=5.4

v0.5PHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/a80f9fc61cd3a7d7779e8f120b458ca4d18fdd885d719bb77d3379b96bf714d9?d=identicon)[florianeckerstorfer](/maintainers/florianeckerstorfer)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/plumphp-plum-console/health.svg)

```
[![Health](https://phpackages.com/badges/plumphp-plum-console/health.svg)](https://phpackages.com/packages/plumphp-plum-console)
```

###  Alternatives

[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[crazywhalecc/static-php-cli

Build single static PHP binary, with PHP project together, with popular extensions included.

1.8k13.9k](/packages/crazywhalecc-static-php-cli)[matthiasnoback/symfony-console-form

Use Symfony forms for Console command input

368264.8k8](/packages/matthiasnoback-symfony-console-form)[phpcr/phpcr-shell

Shell for PHPCR

721.3M8](/packages/phpcr-phpcr-shell)[madewithlove/license-checker

CLI tool to verify allowed licenses for composer dependencies

54449.8k21](/packages/madewithlove-license-checker)[shel/neos-terminal

Neos CMS Ui terminal for running Eel expressions and other commands

1441.3k](/packages/shel-neos-terminal)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
