Mage
Mage is a tool built on top of bin/magento that makes Magento 2 and Mage-OS development faster, with shortcuts and helpers for the work you repeat every day.
mage create my-shop
cd my-shop
mage add hyva
mage open adminFeatures
A new project in one command
mage create installs and sets up Mage-OS, Magento Open Source or Adobe Commerce, ready to log in to.
Works from any folder
Run mage from anywhere in a project, it finds the Magento root on its own. Anything it does not know goes to bin/magento.
Environment aware
The same commands work on your machine, with Laravel Valet, Warden and DDEV, mage runs them where they belong.
One place to add things
mage add takes composer packages, git repositories and composer fragments, generates themes, modules and store views, and adds the Hyvä Theme.
Clean without side effects
mage clean only clears the caches, Redis keys and search indices of the project you are in, never those of another.
Ready for scripts and agents
No silent defaults without a terminal, -y for the defaults, and json output, so CI and AI agents can use mage too.
Install
Download the script with curl:
curl -O https://raw.githubusercontent.com/GrimLink/mage/main/mage && chmod +x mageOr with wget:
wget https://raw.githubusercontent.com/GrimLink/mage/main/mage && chmod +x mageThen move it to a folder in your PATH, such as ~/.local/bin:
mv mage ~/.local/bin/Requirements
- bash 3.2 or newer, the version macOS ships with is enough.
- git, and curl or wget.
- jq for a few commands, such as adding a composer fragment or showing the modules.
Updating
Mage updates itself, together with its templates:
mage self-updateCommands
Anything mage does not know runs bin/magento, so mage cache:clean just works. Run mage help for the full list, including help, version and self-update.
Projects
create- Create, install and set up a new project
setup- Install Magento on an existing codebase
nuke- Permanently delete a project (database, environment, files)
backup- Back up the database, and optionally the media
restore- Restore a backup, and set it up for this device
sync- Pull the media, and optionally the latest backup, from a server
Add to a project
add- Add a package, git repository, composer fragment or handler
add theme- Create a child theme
add module- Create a module
add hyva- Add the Hyvä Theme
add sample- Add the Luma or the Koti sample data
add patch- Add composer patches, or create one from changes in vendor
add bfcache- Add the BFCache compatibility patches
add store- Create a store view with its own domain
add i18n- Collect the translations of a module or theme
add admin- Create an admin user
add customer- Create a customer
add storeinfo- Add the Siteation StoreInfo modules
Packages and modules
del- Remove packages by name or term
upd- Update packages by name or term
enable, disable- Enable or disable modules by name or term
outdated- List the direct dependencies with a newer version
Daily work
Learn more
The docs describe each command, the configuration and the environments, and the changelog lists what changed in every release.