Hello Magento Friends,

In today’s article, we will learn about How to Add a Progress Bar using Custom CLI Command in Magento 2.

Sometimes a customer needs to wait for the process to be completed while working with Magento. A progress bar is used when you want to indicate to the customer about the process and its status.

You can create a progress bar using custom CLI commands in Magento 2. Let’s learn how

Steps to Add a Progress Bar using Custom CLI Command in Magento 2:

Step 1: Navigate to the below path

app\code\Vendor\Extension\etc\di.xml

Now, add the below code

Step 2: Then go to the following path

app\code\Vendor\Extension\Console\Command\ProgressBar.php

Then move to the below path

Step 3: After that run the below commands

Now, you need to run the below command in Magento root:

The output will be as follows in the terminal after executing the above command.

progress bar

Conclusion:

This way you can Add a Progress Bar using Custom CLI Command in Magento 2. Check out the list of useful CLI Commands. If you face any obstacles, let me know via the comment part. Share the article with your developer friends. Stay tuned with us for another Magento solution.

Happy Coding!

Click to rate this post!
[Total: 2 Average: 5]