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

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

hydrakit/console
================

Console command library for Hydra PHP framework

v0.2.0(yesterday)014—0%1MITPHP &gt;=8.2

Since Jul 2Compare

[ Source](https://github.com/hydra-foundation/console)[ Packagist](https://packagist.org/packages/hydrakit/console)[ RSS](/packages/hydrakit-console/feed)WikiDiscussions Synced today

READMEChangelogDependencies (4)Versions (4)Used By (1)

Hydra Console
=============

[](#hydra-console)

The framework's batteries-included console commands — the generic verbs every Hydra app needs, lifted out of the app skeleton so two projects don't carry two copies. This package ships the *commands*; the app owns its `bin/console`entrypoint, wires them to its composition root, and adds its own app-specific generators.

There is no `ServiceProvider` and no seam to register. A command is a plain `Symfony\Component\Console\Command\Command`; the app constructs each one with the dependencies it needs and hands it to a `Symfony\Component\Console\Application`. The package exists to be `new`-ed, not bound.

What ships here
---------------

[](#what-ships-here)

CommandClassNeeds`key:generate``KeyGenerateCommand`a path to `.env``make:migration``MakeMigrationCommand`a migrations directory`route:cache``RouteCacheCommand``Hydra\Http\RouteCache` + a controller list`route:cache:clear``RouteCacheClearCommand``Hydra\Http\RouteCache``migrate:run``MigrateRunCommand``Hydra\Database\MigrationRunner``migrate:fresh``MigrateFreshCommand`a `MigrationRunner` + the debug flag`migrate:status``MigrateStatusCommand`a `MigrationRunner`Every dependency is a constructor argument — a path, a list, an already-built collaborator. Nothing is resolved from a container in here, so the same command is trivially testable against a temp file or in-memory sqlite.

The `MakeClassCommand` seam
---------------------------

[](#the-makeclasscommand-seam)

`MakeClassCommand` is the abstract base the class-emitting generators share. It owns the mechanics — turn a loose name into a PascalCase class (appending a fixed suffix if missing), refuse to clobber an existing file without `--force`, write the rendered stub. Subclasses supply only the policy: the target directory, the suffix, and the file body.

The app's own generators live in the app, because their stubs are app-namespaced (a `make:controller` emits into `App\Controllers`). They extend this base:

```
use Hydra\Console\Commands\MakeClassCommand;

final class MakeControllerCommand extends MakeClassCommand
{
    protected function nameHint(): string { return 'The controller name'; }
    protected function suffix(): string   { return 'Controller'; }
    protected function stub(string $class): string { /* app-namespaced body */ }
}
```

Wiring it up
------------

[](#wiring-it-up)

The app's `bin/console` builds the composition root and constructs commands from it. DB-free commands are added eagerly; the `migrate:*` commands are loaded lazily through a `FactoryCommandLoader` so the database is only touched when one of them actually runs:

```
$application->addCommands([
    new KeyGenerateCommand(__DIR__ . '/../.env'),
    new RouteCacheCommand($container->get(RouteCache::class), AppServiceProvider::CONTROLLERS),
    new RouteCacheClearCommand($container->get(RouteCache::class)),
    new MakeMigrationCommand(__DIR__ . '/../database/migrations'),
    // ...app-specific generators (make:controller, make:ability, make:user)
]);

$application->setCommandLoader(new FactoryCommandLoader([
    'migrate:run'    => static fn () => new MigrateRunCommand($container->get(MigrationRunner::class)),
    'migrate:fresh'  => static fn () => new MigrateFreshCommand($container->get(MigrationRunner::class), $debug),
    'migrate:status' => static fn () => new MigrateStatusCommand($container->get(MigrationRunner::class)),
]));
```

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance100

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

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

Total

3

Last Release

1d ago

### Community

Maintainers

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

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

PHPackages © 2026

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