> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Magento Connect extensions from the command line

> Learn how to use the Magento Connect Command Line Tool To Easily Manage Your Magento Extensions. Just Follow Our Easy Step-By-Step Instructions.

This article describes how to use the *mage* script to manage Magento Connect extensions from the command line.

<Warning>
  **Important**

  The information in this article only applies to Magento 1.9 and older versions. Magento 2 does not have the *mage* script.
</Warning>

## About the mage script

Magento includes the *mage* script to help you manage Magento Connect extensions. Because it is a command-line application, the *mage* script can be used in cron jobs and other automation tools.

<Note>
  Unfortunately, older versions of Magento do not have a complete command-line interface administration solution like [WP-CLI for WordPress](/docs/administering-wordpress-from-the-command-line) or [Drush for Drupal](/docs/using-drush-for-drupal). Magento 2, however, does have a complete command-line interface; for more information, please see [this article](/docs/using-the-magento-command-line-interface-cli).
</Note>

## Configuring the mage script

The *mage* script is included with Magento by default, but it is not configured to run. To configure the *mage* script, follow these steps:

1. Log in to your account [using SSH](/docs/using-ssh-secure-shell).
2. At the command prompt, type the following commands:
   ```bash theme={null}
   cd ~/public_html
   chmod 700 mage
   ```
   > 📘 Note
   >
   > If you installed Magento in a subdirectory beneath the *public\_html* directory, change to that directory instead before running the **chmod** command.
3. To see a list of available commands for the *mage* script, type the following command:
   ```bash theme={null}
   ./mage
   ```

## Listing Magento extensions

To view the extensions currently installed for your Magento site, type the following command:

```bash theme={null}
./mage list-installed
```

To view a list of all of the extensions available in the default **community** channel, type the following command:

```bash theme={null}
./mage list-available
```

This command generates a very long list. To filter the results, you can use the *grep* command. For example, to list all Magento extensions related to **search,** type the following command:

```bash theme={null}
./mage list-available | grep -i search
```

<Note>
  Most, if not all, of the extensions you manage are in the default **community** channel. However, if you need to work with extensions from a third-party channel, you can use the **channel-add** option to add a channel. Type the following command, replacing ***channel*** with the URL of the channel you want to add:

  ```bash theme={null}
  ./mage channel-add channel
  ```

  The commands in this article assume that you are using the **community** channel.
</Note>

## Download and install Magento extensions

To download and install an extension in one step, type the following command, replacing ***name*** with the name of the extension you want to install:

```bash theme={null}
./mage install community name
```

To download an extension **without** installing it, type the following command, replacing ***name*** with the name of the extension you want to download:

```bash theme={null}
./mage download community name
```

To install an extension you have already downloaded, type the following command, replacing ***filename*** with the path and name of the file that you want to install:

```bash theme={null}
./mage install-file filename
```

## Upgrading extensions

To determine if there are any upgrades available for your installed extensions, type the following command:

```bash theme={null}
./mage list-upgrades
```

You can upgrade a specific extension, or you can upgrade all extensions at once. To upgrade all extensions at once, type the following command:

```bash theme={null}
./mage upgrade-all
```

To upgrade a specific extension, type the following command, replacing ***name*** with the name of the extension that you want to upgrade:

```bash theme={null}
./mage upgrade community name
```

## Uninstall Magento extensions

To uninstall an extension, type the following command, replacing ***name*** with the name of the extension you want to remove:

```bash theme={null}
./mage uninstall community name
```

## Using cron to automate extension management

You can easily use the *mage* script in cron jobs to automate administration tasks for your extensions. For example, the following cron configuration upgrades all extensions every Sunday at 2:00 AM:

```text theme={null}
0 2 * * Sun     cd /home/username/public_html &&./mage upgrade-all
```

For more information about how to run PHP scripts from cron jobs, please see [this article](/docs/run-php-scripts-from-cron-jobs).

## Related articles

* [Run PHP scripts from cron jobs](/docs/run-php-scripts-from-cron-jobs)
