Skip to content
Latchkey

Symfony "Command not found" for bin/console in CI

A bin/console subcommand is missing because the bundle that registers it is not installed (dev dependencies skipped), or that bundle is not enabled in the environment CI runs. The console only lists commands from loaded bundles.

What this error means

php bin/console <name> fails with "Command \"<name>\" is not defined." or "There are no commands defined in the \"...\" namespace.", commonly for maker or fixtures commands under APP_ENV=test.

Symfony
In Application.php line 663:
  Command "make:entity" is not defined.

Common causes

The bundle is a dev dependency skipped in CI

MakerBundle and fixtures live in require-dev. A composer install --no-dev in CI omits them, so their commands do not exist.

The bundle is not enabled for this environment

Commands only register when their bundle is enabled for the current APP_ENV in config/bundles.php.

How to fix it

Install dev dependencies where the command lives

  1. Confirm the command's bundle is in require-dev.
  2. Install with dev dependencies for jobs that need it.
  3. List available commands to verify it now registers.
Terminal
composer install --no-interaction
php bin/console list

Enable the bundle for the environment

Ensure the bundle is enabled for the env CI uses in config/bundles.php.

config/bundles.php
// config/bundles.php
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],

How to prevent it

  • Install dev dependencies for jobs that run maker or fixtures commands.
  • Keep bundle environment maps aligned with the commands each job needs.
  • Run bin/console list early to confirm required commands exist.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →