# CLI commands

Thanks to the console (opens new window) library, SIM offers you commands for the fast creation of Controller, Middleware, Entity, fixture as well as to empty the twig cache and update your database.

This is the console file that allows you to use the following commands :

To see the list of available orders :

$ php console list

To empty the twig cache

$ php console cache:clear

# Generate files

To generate a controller, middleware, entity or fixture :

$ php console generate:controller TestController

app/src/Controllers/TestController.php

$ php console generate:middleware TestMiddleware

app/src/Middlewares/TestMiddleware.php

$ php console generate:entity Test

app/src/Entity/Test.php

$ php console generate:fixture TestFixture

app/src/Entity/DataFixtures/TestFixture.php

# CLI menu

You can install the library cli-menu (opens new window) with a composer require php-school/cli-menu and you will have a menu via the console to perform the various commands mentioned above, convenient in case of forgetfulness!

Important

cli-menu (opens new window) uses php posix extension which is not supported on windows, this part is useful for Linux and Mac OS developers only.

To access the menu, just launch :

$ php console

For the generation of Controllers, Middlewares, Entity and fixture, you will be asked for their name later.