Command Line Interface
Below are the available commands for the AI Assistant module.
Command to apply the automation rules
bin/magento mirasvit:assistant:apply-rule
The command allows you to apply an automation rule to products that meet the rule's conditions. This command requires one of the following options.
Option | Description |
---|---|
--id | add the ID of applied rule. This option is required. |
--entity-id | specify only one entity ID (e.g., product_id) that will be changed by the rule. |
--reset | reset already applied rule so it can be re-applied again later. Will affect only rules with Apply only once = Yes. This option can be combined with the --entity-id option. It is not applicable when used with --dry-run . |
--dry-run | Use this option to execute the rule without saving the resulting changes to the database. |
--force | forcibly applies the rule (will terminate the previous process for the current rule if it is running). |
Examples
Command options can be combined:
-
Applies the rule with ID 1 to the entity (e.g., product) with ID 10 only if the product matches the rule's conditions:
bin/magento mirasvit:assistant:apply-rule --id 1 --entity_id 10
-
Resets the rule with ID 1 only if the Apply only once option of the rule is set to Yes.
bin/magento mirasvit:assistant:apply-rule --id 1 --reset
Reindexes the relationships between automation rules and products
bin/magento mirasvit:assistant:reindex
The command updates the relationships between automation rules and products after changes are made.
Option | Description |
---|---|
--reset | removes all data from the automation rule - product relations table. |