Quick Tip: Command Alias

Published by Christian Münch on

Every developer is using n98-magerun in a different way. Some uses the cache:clear command multiple times a day.
For this we have support for command aliases to simplify the usage.

Making aliases is nearly the same as unix bash aliases. You define an alias and n98-magerun will run the alias instead.

Register alias

Aliases can be defined in any config. For personal use you can add the config in your home folder in file ~/.n98-magerun.yaml

Example Config:

commands:
  aliases:
     - "db:dump:time": "db:dump --add-time"
     - "ccc": "cache:clean config"
     - "cf": "cache:flush"
     - "test-customer": "customer:create [email protected] password123 John Doe"

If you run i.e. “n98-magerun.phar test-customer” a new customer with your defined data will be created.
This is very useful and saves a lot of time.

To bust the cache a simple “n98-magerun.phar cf” will do the job.

Happy working with n98-magerun!

Categories: MagerunTips

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.