Install, Remove, and Upgrade Packages

This page goes over basic package commands to search, install, remove, upgrade and rollback packages within your local Apex installation.

Search Packages

Search all packages available within the repository by running the search CLI command, such as:

apex search <TERM>

This will display a list of all packages that meet your search criteria.

Install Package

You may install any package that you have access to with the install CLI command, for example:

apex install <AUTHOR>/<PACKAGE>

Generally, all packages will be formatted as <AUTHOR>/<PACKAGE>, so for example if your Apex username is "jsmith" and you published a package named "shop", it could be installed with the command:

apex install jsmith/shop

If the package author is "apex" then you may omit the author and simply enter the package name. You may also install multiple packages at one time by specifying them within the command such as:

apex install <AUTHOR1>/<PACKAGE1> <AUTHOR2>/<PACKAGE2> <AUTHOR3>/<PACKAGE3>

Delete Package

You may remove a package from your local installation with the package delete CLI command, for example:

apex package delete <PACKAGE>

If you are the author of the package and also want to delete it off the repository, simply add the --remote flag to the above command, for example:

apex package delete <PACKAGE> --remote

This will confirm that you want to remove the package, and will then proceed to permanently delete the package from your hard drive. If the --remote flag was included and you are the owner, the package will also be permanently removed from the repository.

Upgrade package

You may check for and install any available upgrades for a single package with the upgrade CLI command, such as:

apex package upgrade <PACKGE>

If any of the upgrades were marked as having breaking changes by the author you will be prompted for confirmation before the upgrade is installed. Alternatively, you may search for and install upgrades on all packages installed on the local machine with the command:

apex upgrade

This will scroll through and check for any available upgrades for all installed packages.

Rollback Upgrades

If you encounter an unexpected issue while upgrading, you may rollback the upgrade and return your system to its previous state using the package rollback CLI command with simple:

apex package rollback

This will display a list of the most recent times the system was upgraded, and allow you to select up to which point you want the system reverted to. This will revert the system to its previous state including all PHP scripts, database structure, configuration variables, and so on.