Managing Magento Connect extensions from the command line
Magento 1.x includes the mage script, a command‑line tool that allows you to manage Magento Connect extensions without using the web interface. On ruachost.com, this is useful for automation, cron jobs, and troubleshooting.
Why Use the Command Line?
Section titled “Why Use the Command Line?”- Faster than using the Magento admin panel.
- Enables automation with cron jobs.
- Useful for bulk extension management.
- Provides more control for developers.
About the Mage Script
Section titled “About the Mage Script”- The mage script is included with Magento 1.x by default.
- It is located in the Magento installation directory.
- Magento 2 does not use the mage script — it has its own CLI tool.
Configuring the Mage Script
Section titled “Configuring the Mage Script”-
Log in to your hosting account via SSH.
-
Navigate to your Magento installation directory:
Terminal window cd ~/public_html -
Set permissions:
Terminal window chmod 700 mage -
Run the mage script:
Terminal window ./mage
Common Commands
Section titled “Common Commands”List Installed Extensions
Section titled “List Installed Extensions”./mage list-installedList Available Extensions
Section titled “List Available Extensions”./mage list-availableInstall an Extension
Section titled “Install an Extension”./mage install community <extension_name>Download an Extension Without Installing
Section titled “Download an Extension Without Installing”./mage download community <extension_name>Install from a File
Section titled “Install from a File”./mage install-file <filename>Upgrade Extensions
Section titled “Upgrade Extensions”-
Upgrade all extensions:
Terminal window ./mage upgrade-all -
Upgrade a specific extension:
Terminal window ./mage upgrade community <extension_name>
Uninstall an Extension
Section titled “Uninstall an Extension”./mage uninstall community <extension_name>Automating with Cron Jobs
Section titled “Automating with Cron Jobs”You can automate extension upgrades with cron. Example: upgrade all extensions every Sunday at 2:00 AM:
./mage uninstall community <extension_name>Important Notes
Section titled “Important Notes”-
The mage script only applies to Magento 1.x.
-
Magento 2 uses its own CLI tool (
bin/magento). -
Always back up your site before installing or upgrading extensions.
-
Use the community channel unless you add a third‑party channel with:
Terminal window ./mage channel-add <channel_url>