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

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

corpnet/console
===============

console service provider for Silex

v2.1.0(8y ago)023MITPHPPHP &gt;=5.5.9

Since Jun 13Pushed 8y ago1 watchersCompare

[ Source](https://github.com/leninalive/ConsoleServiceProvider)[ Packagist](https://packagist.org/packages/corpnet/console)[ Docs](http://knplabs.com)[ RSS](/packages/corpnet-console/feed)WikiDiscussions master Synced 2w ago

READMEChangelogDependencies (8)Versions (6)Used By (0)

ConsoleServiceProvider
======================

[](#consoleserviceprovider)

Provides a [`Symfony\Component\Console`](http://symfony.com/doc/current/components/console.html) based console for Silex 2.x.

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

[](#installation)

Add `knplabs/console-service-provider` to your `composer.json` and register the service provider:

```
composer require knplabs/console-service-provider

```

```
use Knp\Provider\ConsoleServiceProvider;

$app->register(new ConsoleServiceProvider());
```

You can now copy the `console` executable from the `bin` folder to whatever place you see fit, and tweak it to your needs.

You will need a way to fetch your silex application, the most common way is to return it from your bootstrap file:

```
use Knp\Provider\ConsoleServiceProvider;
use Silex\Application;

$app = new Application();

$app->register(new ConsoleServiceProvider());
$app->register(new SomeOtherServiceProvider());

return $app;
```

For the rest of this documentation, we will assume you do have a `bin`directory, so the `console` executable will be located at `bin/console`.

Usage
-----

[](#usage)

Use the console just like any `Symfony\Component\Console` based console:

```
$ bin/console my:command

```

or on Windows:

```
$ php bin/console my:command

```

Configuration parameters
------------------------

[](#configuration-parameters)

ParameterDefaultDescription`console.name` (string)Silex consoleName of your console application`console.version` (string)UNKNOWNVersion of your console application`console.project_directory` (string)(auto-detected)Your project's directory path. The default value should work, assuming the provider is installed in `vendor/knplabs/console-service-provider``console.class` (string)Knp\\Console\\ApplicationClass name of the console service`console.boot_in_constructor` (bool)falseWhether the console should boot Silex when loaded (set it to `true` if you depend on [a bug that was fixed in 2.1](CHANGELOG.md#booting-silex-from-the-console-constructor))`console.command.ids` (array)array()Console commands registered as servicesDefault commands
----------------

[](#default-commands)

The service provider will register the following commands if the corresponding Symfony components are installed:

- From `symfony/twig-bridge`, the `lint:twig` and `debug:twig` commands
- From `symfony/yaml`, the `lint:yaml` command

### Web-server-bundle support

[](#web-server-bundle-support)

The `WebServerServiceProvider` will register the commands provided by `symfony/web-server-bundle`.

```
$app = new Silex\Application();

$app->register(new Knp\Provider\ConsoleServiceProvider());
$app->register(new Knp\Provider\WebServerServiceProvider(), array(
    // Folder that contains your front controller/public files
    'web_server.document_root' => __DIR__.'/../public',
));
```

The server commands expect your front controller to be located in your document root and be called `app_dev.php`, `app.php`, `index_dev.php` or `index.php`.

For more information, please consult the [Symfony documentation](https://symfony.com/doc/current/setup/built_in_web_server.html).

Recipes
-------

[](#recipes)

- [Writing and registering commands](doc/adding-commands.md)
- [Testing your commands](doc/testing-commands.md)
- [Listening to console events](doc/console-events.md)

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Total

4

Last Release

3270d ago

Major Versions

1.1 → 2.02016-06-01

PHP version history (2 changes)v1.0PHP &gt;=5.3.2

v2.1.0PHP &gt;=5.5.9

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/192490?v=4)[Phil Akalp](/maintainers/corpnet)[@corpnet](https://github.com/corpnet)

---

Top Contributors

[![skalpa](https://avatars.githubusercontent.com/u/4943191?v=4)](https://github.com/skalpa "skalpa (24 commits)")[![crimsonlabs](https://avatars.githubusercontent.com/u/97939377?v=4)](https://github.com/crimsonlabs "crimsonlabs (9 commits)")[![ubermuda](https://avatars.githubusercontent.com/u/10758?v=4)](https://github.com/ubermuda "ubermuda (7 commits)")[![weaverryan](https://avatars.githubusercontent.com/u/121003?v=4)](https://github.com/weaverryan "weaverryan (3 commits)")[![batwolf](https://avatars.githubusercontent.com/u/30409909?v=4)](https://github.com/batwolf "batwolf (2 commits)")[![TiGR](https://avatars.githubusercontent.com/u/281226?v=4)](https://github.com/TiGR "TiGR (2 commits)")[![ovr](https://avatars.githubusercontent.com/u/572096?v=4)](https://github.com/ovr "ovr (1 commits)")[![flip111](https://avatars.githubusercontent.com/u/2244480?v=4)](https://github.com/flip111 "flip111 (1 commits)")[![leninalive](https://avatars.githubusercontent.com/u/16370118?v=4)](https://github.com/leninalive "leninalive (1 commits)")[![rybakit](https://avatars.githubusercontent.com/u/533861?v=4)](https://github.com/rybakit "rybakit (1 commits)")

---

Tags

consolesilex

### Embed Badge

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

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

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k569.8M788](/packages/psy-psysh)[cilex/console-service-provider

Console Service Provider

233.2M3](/packages/cilex-console-service-provider)[shel/neos-terminal

Neos CMS Ui terminal for running Eel expressions and other commands

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

PHPackages © 2026

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