New docs/reference-cli-commands.md covers all commands, bootstrap helpers, and how to add new commands. Updated lokale-entwicklung, entwickler-checkliste, betriebscheck-doctor, index, and web/index.php error message to reference bin/console instead of legacy bin/*.php scripts. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3.5 KiB
CLI-Kommandoreferenz
Letzte Aktualisierung: 2026-03-19
Einstiegspunkt
Alle CLI-Kommandos laufen ueber einen einzigen Einstiegspunkt:
php bin/console <command> [argumente] [optionen]
Uebersicht aller verfuegbaren Kommandos:
php bin/console list
Hilfe zu einem einzelnen Kommando:
php bin/console <command> --help
Kommandos
module:sync
Fuehrt den vollstaendigen Modul-Runtime-Sync aus: migrate → permissions-sync → build → assets-sync.
docker compose exec php php bin/console module:sync
Noetig nach jeder Aenderung an Modulen, Manifesten, Routen oder APP_ENABLED_MODULES.
Falls web/index.php den Fehler "Module runtime is stale" wirft, ist dieser Befehl die Loesung.
module:migrate
Wendet ausstehende SQL-Migrationen aus aktiven Modulen an.
docker compose exec php php bin/console module:migrate
module:permissions-sync
Synchronisiert Modul-Permissions in die DB. Deaktiviert verwaiste System-Permissions (is_system=1), die kein aktives Modul mehr beansprucht.
docker compose exec php php bin/console module:permissions-sync
module:build
Baut die Runtime-Seitenstruktur (storage/runtime/pages/) mit Symlinks zu Modul-Pages.
docker compose exec php php bin/console module:build
module:assets-sync
Publiziert Modul-Assets nach web/modules/<id>/.
docker compose exec php php bin/console module:assets-sync
module:deactivate
Fuehrt den optionalen Deactivation-Handler eines Moduls aus.
docker compose exec php php bin/console module:deactivate <module-id> --confirm
docker compose exec php php bin/console module:deactivate <module-id> --dry-run
Das Modul muss nicht in der Aktivliste stehen. --dry-run validiert den Handler ohne Ausfuehrung.
scheduler:run
Fuehrt faellige Scheduler-Jobs aus.
docker compose exec php php bin/console scheduler:run
Der Docker-Scheduler-Service ruft dieses Kommando automatisch alle 60 Sekunden auf.
doctor
Fuehrt System-Gesundheitschecks aus (ENV, DB, RBAC, Scheduler-Heartbeat).
docker compose exec php php bin/console doctor
Siehe /docs/howto-betriebscheck-doctor.md fuer Details.
Neue Kommandos anlegen
- Klasse in
lib/Console/Commands/erstellen, dieMintyPHP\Console\Commanderweitert. name(),description()undexecute()implementieren.- Optional:
usage()fuer--help-Ausgabe ueberschreiben.
Das Kommando wird automatisch erkannt — kein manuelles Registrieren noetig.
Beispiel:
namespace MintyPHP\Console\Commands\Make;
use MintyPHP\Console\Command;
final class ModuleCommand extends Command
{
public function name(): string { return 'make:module'; }
public function description(): string { return 'Scaffold a new module'; }
public function execute(array $args, array $options): int
{
// ...
return 0;
}
}
Bootstrap-Helfer
Die Command-Basisklasse stellt Helfer bereit:
| Methode | Zweck |
|---|---|
$this->bootstrapApp($channel) |
App-Bootstrap fuer Nicht-Modul-Kommandos |
$this->bootstrapModuleApp() |
App-Bootstrap mit Modul-Error-Policy und Locking |
$this->requireBinScript('name.php') |
Laedt ein bin/-Script ohne fragile relative Pfade |
$this->projectRoot() |
Gibt den absoluten Projekt-Root-Pfad zurueck |
Legacy-Scripts
Die alten bin/*.php-Scripts funktionieren weiterhin, geben aber einen Hinweis auf bin/console aus:
Hint: prefer `php bin/console module:sync` instead.