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

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

spryker/console
===============

Console module

4.18.0(5mo ago)02.7M↓21.1%120proprietaryPHPPHP &gt;=8.3CI passing

Since Mar 1Pushed 2mo ago8 watchersCompare

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

READMEChangelog (10)Dependencies (11)Versions (48)Used By (20)

Console Module
==============

[](#console-module)

[![Latest Stable Version](https://camo.githubusercontent.com/1907077b3ffb5cb5277260a600b114dab38b022d7a9ab1ac669a52ac4e30044f/68747470733a2f2f706f7365722e707567782e6f72672f737072796b65722f636f6e736f6c652f762f737461626c652e737667)](https://packagist.org/packages/spryker/console)[![Minimum PHP Version](https://camo.githubusercontent.com/9c50dc780fa576f5c39b4feff00c05345c1471be0808881a09e750b91220dc54/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230382e332d3838393242462e737667)](https://php.net/)

Console is a wrapper over Symfony's Console component, that makes the implementation and configuration of a console command easier. A console command is a php class that contains the implementation of a functionality that can get executed from the command line.

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

[](#installation)

```
composer require spryker/console

```

Documentation
-------------

[](#documentation)

[Spryker Documentation](https://docs.spryker.com)

Testing Console Commands
------------------------

[](#testing-console-commands)

The Console module provides a `ConsoleHelper` to simplify testing console commands using Codeception.

### Using ConsoleHelper

[](#using-consolehelper)

The `ConsoleHelper` wraps your console command in a `CommandTester` instance, which allows you to execute the command programmatically and inspect its output and exit code.

#### Basic Usage

[](#basic-usage)

```
use Codeception\Test\Unit;
use Symfony\Component\Console\Tester\CommandTester;
use Spryker\Zed\YourModule\Communication\Plugin\Console\YourConsoleCommand;

class YourConsoleCommandTest extends Unit
{
    protected YourModuleTester $tester;

    public function testExecutesSuccessfully(): void
    {
        // Arrange
        $command = new YourConsoleCommand();
        $commandTester = $this->tester->getConsoleTester($command);

        // Act
        $commandTester->execute([]);

        // Assert
        $this->assertSame(YourConsoleCommand::CODE_SUCCESS, $commandTester->getStatusCode());
        $this->assertStringContainsString('Expected output', $commandTester->getDisplay());
    }
}
```

#### Passing Arguments and Options

[](#passing-arguments-and-options)

The `execute()` method accepts an array of input parameters where:

- **Arguments** are passed by name: `['argumentName' => 'value']`
- **Options** are passed with the `--` prefix: `['--option-name' => 'value']`

```
public function testExecutesWithArguments(): void
{
    // Arrange
    $command = new YourConsoleCommand();
    $commandTester = $this->tester->getConsoleTester($command);

    // Act
    $commandTester->execute([
        'entityId' => 123,
        '--format' => 'json',
        '--verbose' => true,
    ]);

    // Assert
    $this->assertSame(YourConsoleCommand::CODE_SUCCESS, $commandTester->getStatusCode());
}
```

#### Execution Options

[](#execution-options)

The `execute()` method accepts a second parameter for execution options:

```
$commandTester->execute(
    ['--option' => 'value'],
    [
        'interactive' => false,
        'decorated' => false,
        'verbosity' => OutputInterface::VERBOSITY_VERBOSE,
        'capture_stderr_separately' => true,
    ]
);
```

Available execution options:

- `interactive`: Sets the input interactive flag
- `decorated`: Sets the output decorated flag
- `verbosity`: Sets the output verbosity level
- `capture_stderr_separately`: Make output of standard output and standard error separately available

#### Inspecting Command Output

[](#inspecting-command-output)

After execution, you can inspect the command results:

```
$commandTester->execute([]);

$exitCode = $commandTester->getStatusCode();
$output = $commandTester->getDisplay();
$input = $commandTester->getInput();
```

#### Testing Exception Cases

[](#testing-exception-cases)

```
public function testThrowsExceptionWhenFileNotFound(): void
{
    // Expect
    $this->expectException(FileNotFoundException::class);

    // Act
    $command = new YourConsoleCommand();
    $commandTester = $this->tester->getConsoleTester($command);
    $commandTester->execute([
        '--file' => 'invalid-file-path',
    ]);
}
```

### Helper Configuration

[](#helper-configuration)

Ensure the `ConsoleHelper` is configured in your `codeception.yml`:

```
modules:
    enabled:
        - \SprykerTest\Shared\Console\Helper\ConsoleHelper
```

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance80

Actively maintained with recent releases

Popularity40

Moderate usage in the ecosystem

Community35

Small or concentrated contributor base

Maturity91

Battle-tested with a long release history

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~87 days

Recently: every ~63 days

Total

42

Last Release

165d ago

Major Versions

0.20.0 → 1.0.02016-04-01

1.0.0 → 2.0.0-RC12016-04-01

2.1.1 → 3.0.02017-02-22

3.2.1 → 4.0.02017-11-29

PHP version history (8 changes)4.1.0PHP &gt;=7.1

4.4.1PHP &gt;=7.2

4.10.0PHP &gt;=7.3

4.10.3PHP &gt;=7.4

4.11.0PHP &gt;=8.0

4.13.0PHP &gt;=8.1

4.14.0PHP &gt;=8.2

4.17.0PHP &gt;=8.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10738957?v=4)[Spryker Bot](/maintainers/spryker-bot)[@spryker-bot](https://github.com/spryker-bot)

---

Top Contributors

[![dereuromark](https://avatars.githubusercontent.com/u/39854?v=4)](https://github.com/dereuromark "dereuromark (123 commits)")[![stereomon](https://avatars.githubusercontent.com/u/1382877?v=4)](https://github.com/stereomon "stereomon (117 commits)")[![karlvalentin](https://avatars.githubusercontent.com/u/12029511?v=4)](https://github.com/karlvalentin "karlvalentin (10 commits)")[![olhalivitchuk](https://avatars.githubusercontent.com/u/77281282?v=4)](https://github.com/olhalivitchuk "olhalivitchuk (9 commits)")[![tamasnyulas](https://avatars.githubusercontent.com/u/3429362?v=4)](https://github.com/tamasnyulas "tamasnyulas (9 commits)")[![ehsanmx](https://avatars.githubusercontent.com/u/7711957?v=4)](https://github.com/ehsanmx "ehsanmx (8 commits)")[![m7moud](https://avatars.githubusercontent.com/u/3217954?v=4)](https://github.com/m7moud "m7moud (7 commits)")[![kraal-spryker](https://avatars.githubusercontent.com/u/42177964?v=4)](https://github.com/kraal-spryker "kraal-spryker (7 commits)")[![lmanzke](https://avatars.githubusercontent.com/u/7486693?v=4)](https://github.com/lmanzke "lmanzke (6 commits)")[![geega](https://avatars.githubusercontent.com/u/1426310?v=4)](https://github.com/geega "geega (5 commits)")[![pushokwhite](https://avatars.githubusercontent.com/u/4017411?v=4)](https://github.com/pushokwhite "pushokwhite (5 commits)")[![a-sabaa](https://avatars.githubusercontent.com/u/1667759?v=4)](https://github.com/a-sabaa "a-sabaa (5 commits)")[![gechetspr](https://avatars.githubusercontent.com/u/42143273?v=4)](https://github.com/gechetspr "gechetspr (4 commits)")[![vol4onok](https://avatars.githubusercontent.com/u/5063777?v=4)](https://github.com/vol4onok "vol4onok (3 commits)")[![spryker-release-bot](https://avatars.githubusercontent.com/u/26904324?v=4)](https://github.com/spryker-release-bot "spryker-release-bot (3 commits)")[![gund](https://avatars.githubusercontent.com/u/3644678?v=4)](https://github.com/gund "gund (2 commits)")[![artem-png](https://avatars.githubusercontent.com/u/15310986?v=4)](https://github.com/artem-png "artem-png (2 commits)")[![demkos](https://avatars.githubusercontent.com/u/2093777?v=4)](https://github.com/demkos "demkos (2 commits)")[![dmitry-volkov](https://avatars.githubusercontent.com/u/56629149?v=4)](https://github.com/dmitry-volkov "dmitry-volkov (2 commits)")[![hacfi](https://avatars.githubusercontent.com/u/428841?v=4)](https://github.com/hacfi "hacfi (2 commits)")

### Embed Badge

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

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

###  Alternatives

[spryker/search

Search module

152.8M64](/packages/spryker-search)

PHPackages © 2026

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