Skip to main content

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.

OptionDescription
--idadd the ID of applied rule. This option is required.
--entity-idspecify only one entity ID (e.g., product_id) that will be changed by the rule.
--resetreset 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-runUse this option to execute the rule without saving the resulting changes to the database.
--forceforcibly 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.

OptionDescription
--resetremoves all data from the automation rule - product relations table.