Python command-line utility to clean up outdated Adobe Experience Manager (AEM) package versions. It automatically identifies and removes old package versions while retaining the most recent version of each package.
- Python 3.6 or higher
-
Clone or download this repository:
git clone <repository-url> cd aem-purge-packages
-
Install required dependencies:
pip3 install -r requirements.txt
-
Verify the installation:
python3 aem-purge-packages.py -h
Run against a local AEM instance with default credentials:
python3 aem-purge-packages.py
This will connect to localhost:4502 using admin:admin credentials and analyze all packages created up to today.
Connect to a remote AEM instance:
python3 aem-purge-packages.py --host author.example.com:4502 -u myuser:mypassword
| Option | Description |
|---|---|
-h, --help |
Show help message and exit |
-d DATE, --date DATE |
Only consider packages created before this date (format: YYYY-MM-DD) |
-f, --force |
Skip confirmation prompts before each package deletion |
--host HOST |
AEM instance host and port (format: host:port, default: localhost:4502) |
-p PATH, --path PATH |
Target a specific package subdirectory (e.g., adobe searches /etc/packages/adobe) |
-u USER, --user USER |
AEM credentials (format: username:password, default: admin:admin) |
-v, --verbose |
Enable detailed logging output |
The tool only processes packages that follow this naming pattern:
package-name-X.Y.Z.b.zip
Where X.Y.Z.b represents version numbers (supports up to 4 numeric segments).
Packages not following this convention are ignored for safety.