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

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

lokhman/silex-console
=====================

Silex 2.0+ console application

2.0.6(9y ago)311.7k—4.2%1MITPHP

Since Jan 24Pushed 9y ago1 watchersCompare

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

READMEChangelogDependencies (3)Versions (8)Used By (1)

silex-console
=============

[](#silex-console)

[![StyleCI](https://camo.githubusercontent.com/9420c75015dd1925a7e45564743208502c9c26442712cc3230c2df9fec6b374f/68747470733a2f2f7374796c6563692e696f2f7265706f732f37393930343132312f736869656c643f6272616e63683d6d6173746572)](https://styleci.io/repos/79904121)

Console application for [**Silex 2.0+**](http://silex.sensiolabs.org/) micro-framework.

> This project is a part of [`silex-tools`](https://github.com/lokhman/silex-tools) library.

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

[](#installation)

You can install `silex-console` with [Composer](http://getcomposer.org):

```
composer require lokhman/silex-console

```

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

[](#documentation)

A wrapper class for [Symfony Console](https://github.com/symfony/console) application that registers console commands and service providers.

```
#!/usr/bin/env php
require __DIR__ . '/../vendor/autoload.php';

use Silex\Application;
use Silex\Provider as Providers;
use Lokhman\Silex\Console\Console;
use Lokhman\Silex\Console\Command as Commands;
use Lokhman\Silex\Console\Provider as Providers;

$app = new Application();
$app->register(new Providers\DoctrineServiceProvider());

$console = new Console($app);

// add console command
$console->add(new Commands\Session\SchemaCreateCommand());

// register console service providers
$console->registerServiceProvider(new Providers\DoctrineServiceProvider());
$console->registerServiceProvider(new Providers\DoctrineMigrationsServiceProvider(), [
    'migrations.directory' => __DIR__ . '/../app/migrations',
    'migrations.namespace' => 'Project\Migrations',
]);

$console->run();

```

Console supports [`ConfigServiceProvider`](https://github.com/lokhman/silex-config) and adds `--env` (`-e` in short) option to all registered commands.

### Cron Commands

[](#cron-commands)

The library provides commands for running background tasks as cron. Configuration supports cron schedule expressions.

```
$app = new Application([
    'cron' => [
        'task1' => [
            'command' => 'app:some:command',        // internal commands (always sync!)
            'arguments' => ['--env' => $env],       // arguments as array
            'at' => '0 0 * * *',                    // cron expression
            'output' => '&',                        // "&" is to redirect output to cron stdout
        ],
        'task2' => [
            'raw' => '/path/to/task2',              // raw command line
            'at' => '@daily',                       // cron expression
            'output' => '/path/to/task2.log',       // output to file
        ],
        'task3' => [
            'raw' => '/path/to/task3',              // raw command line
            'at' => '@annually',                    // cron expression
            'output' => null,                       // disable output (default)
        ],
    ],
]);

$console = new Console($app);
$console->add(new Commands\Cron\RunCommand());
$console->run();

```

License
------------------------------------------

[](#license)

Library is available under the MIT license. The included LICENSE file describes this in detail.

###  Health Score

35

—

LowBetter than 80% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Total

7

Last Release

3349d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/17a4b2bb3c64905c2663115cb0a3ef36854123b51709645576a591fb72fbef10?d=identicon)[lokhman](/maintainers/lokhman)

---

Top Contributors

[![lokhman](https://avatars.githubusercontent.com/u/7714105?v=4)](https://github.com/lokhman "lokhman (25 commits)")

---

Tags

consolesilextoolsconsoletoolssilex

### Embed Badge

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

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

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k545.6M719](/packages/psy-psysh)[nunomaduro/phpinsights

Instant PHP quality checks from your console.

5.6k10.8M426](/packages/nunomaduro-phpinsights)[helhum/typo3-console

A reliable and powerful command line interface for TYPO3 CMS

2939.0M192](/packages/helhum-typo3-console)[drupal/console-core

Drupal Console Core

13514.7M12](/packages/drupal-console-core)[matthiasnoback/symfony-console-form

Use Symfony forms for Console command input

368264.8k8](/packages/matthiasnoback-symfony-console-form)[cilex/console-service-provider

Console Service Provider

273.1M3](/packages/cilex-console-service-provider)

PHPackages © 2026

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