<commit_before># Console commands

To execute a console command open your Terminal and go into the base directory of your *LUYA* project. The base diretory is where vendor, public_html, runtime, etc. folders are located, for instance when you run the [luya-kickstarter](install.md) its in `luya-kickstarter`.

```sh
./vendor/bin/luya <command>
```

> On Windows systems you can run commands by going into the public_html folder an run: `php index.php <command>`

Where *command* is one of the following commands below:

## Standard built in commands

Global LUYA commands:

|Command|Description
|--------|---------
|`import`|Updates permission, import cms blocks, updates cms layouts, updates image filters. Create your custom [importer](app-module.md#import-method) to run jobs while importing. Import is base of the main concepts of LUYA. It tryes to synchronize your project data into the database. This way you can track your files within version control systems and you don't have to copy database between enviroments.
|`migrate`|Execute all migrations from all modules, updates your database if any. The main difference to the Yii migrate command is its going to collect all migrations from all modules.
|`migrate/create migration1 modulename`|Create new migration file named `mymigration1` in the module `modulename`: `migrate/create mymigration1 modulename`.
|`health`|Tests all basic directory if they are writeable and existing.
|`health/mailer`|Check if you mailer component is working and can send mails.
|`module/create`|Create new [frontend/admin module](app-module.md) with a wizzard.
|`module/controller/action`|All comands stored in the folder `commands` can be run by default routing.

Admin Module commands:

|Command|Description
|---    |---
|`admin/setup`|Execute the *LUYA* Setup will create a user, group and base table informations.
|`admin/setup/user`|Create a new user for the *LUYA* Admin from command line.
|`admin/filter`|Generate a [Filter](app-filters.md) Class.
|`admin/proxy`|Start the [content sync](concept-depandsync) process.
|`admin/proxy/clear`|Flush the configuration setup for the content sync process.
|`admin/storage/cleanup`|Cleanup not existing files compare file system and database.
|`admin/storage/cleanup-image-table`|Find if dupliations are available in the image table (same filter and file id). If confirmed it will remove all duplications except of one, the first one created.
|`admin/storage/process-thumbnails`|Create all thumbnails for filemanager preview. Otherwhise they are created on request load.
|`admin/active-window/create`|Generate a [new Active Window](ngrest-activewindow.md) class file based on your configuration.
|`admin/crud/create`|Create new [NgRest CRUD](ngrest-concept.md) with a wizzard.
|`admin/crud/model`|Generates only the [NgRestModel](ngrest-model.md). Usage `./vendor/bin/luya admin/crud/model "app\models\Customer"` 

CMS Module commands:<commit_msg>Update luya-console.md<commit_after># Console commands

To execute a console command open your Terminal and go into the base directory of your *LUYA* project. The base diretory is where vendor, public_html, runtime, etc. folders are located, for instance when you run the [luya-kickstarter](install.md) its in `luya-kickstarter`.

```sh
./vendor/bin/luya <command>
```

> On Windows systems you can run commands by going into the public_html folder an run: `php index.php <command>`

Where *command* is one of the following commands below:

## Standard built in commands

Global LUYA commands:

|Command|Description
|--------|---------
|`import`|Updates permission, cms blocks, cms layouts, image filters. Import is a one of the main concepts of LUYA. Its saving your project data into the database. This way you can track your files within VCS (Git, SVN) and import them. [Create Import Commmand](app-module.md#import-method).
|`migrate`|Execute all migrations from all modules, updates your database if any. The main difference to the Yii migrate command is its going to collect all migrations from all modules.
|`migrate/create migration1 modulename`|Create new migration file named `mymigration1` in the module `modulename`: `migrate/create mymigration1 modulename`.
|`health`|Tests all basic directory if they are writeable and existing.
|`health/mailer`|Check if you mailer component is working and can send mails.
|`module/create`|Create new [frontend/admin module](app-module.md) with a wizzard.
|`module/controller/action`|All comands stored in the folder `commands` can be run by default routing.

Admin Module commands:

|Command|Description
|---    |---
|`admin/setup`|Execute the *LUYA* Setup will create a user, group and base table informations.
|`admin/setup/user`|Create a new user for the *LUYA* Admin from command line.
|`admin/filter`|Generate a [Filter](app-filters.md) Class.
|`admin/proxy`|Start the [content sync](concept-depandsync) process.
|`admin/proxy/clear`|Flush the configuration setup for the content sync process.
|`admin/storage/cleanup`|Cleanup not existing files compare file system and database.
|`admin/storage/cleanup-image-table`|Find if dupliations are available in the image table (same filter and file id). If confirmed it will remove all duplications except of one, the first one created.
|`admin/storage/process-thumbnails`|Create all thumbnails for filemanager preview. Otherwhise they are created on request load.
|`admin/active-window/create`|Generate a [new Active Window](ngrest-activewindow.md) class file based on your configuration.
|`admin/crud/create`|Create new [NgRest CRUD](ngrest-concept.md) with a wizzard.
|`admin/crud/model`|Generates only the [NgRestModel](ngrest-model.md). Usage `./vendor/bin/luya admin/crud/model "app\models\Customer"` 

CMS Module commands:
{'fraction_non_alphanumeric': 0.09930555555555555, 'fraction_numerical': 0.0010416666666666667, 'mean_word_length': 5.077004219409282, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6480729', 'n_tokens_mistral': 1667, 'n_tokens_neox': 1605, 'n_words': 684}