Introduction
Introduction
The list-apps
feature is an integral part of the Empress system, enabling developers to gain insights into the Empress Applications installed on a specified site. The versatility of this feature lies in its ability to fetch information from the Installed Applications DocType, which tracks the latest version of the apps the site has migrated to. It uses the global default installed_apps
as a fallback.
Technical Advantages and Usage
The list-apps
feature offers several technical advantages:
-
Multi-site Support: Introduced in Version 13, the feature now supports multi-site operations. Developers can now view the summary for all sites by setting the site’s value as
all
. -
Format Flexibility: Developers have the flexibility to choose the format for listing apps installed on the specified site, options being “text” and “json”. The default format is “json”.
Here is the basic usage of the feature:
bench list-apps [OPTIONS]
Implementation and Modification
The core functionality of the list-apps
feature is determined by the interaction with the Installed Applications DocType and the global default installed_apps
. It fetches the information about the installed applications and their latest versions on the specified site.
Here are some examples of how it can be used:
- To list apps installed on all sites, use:
bench --site all list-apps
- For a parsable JSON format, use:
bench --site all list-apps --format json
- To list apps installed on a specific site in text format, use either of the following:
bench --site {site} list-apps --format text
bench --site {site} list-apps -f text
bench --site {site} list-apps
Debugging and Security Considerations
In terms of debugging, be aware of the format options and the site parameter. Errors may occur if an invalid format is chosen or if the site parameter is not correctly set.
Regarding security, user roles and permissions play a vital role. The ability to list apps should be restricted to authorized users, respecting the system’s architecture and security considerations.
Conclusion
The list-apps
feature is a powerful tool for managing and understanding the Empress Applications installed on your sites. It provides an easy way for developers to view, manage, and debug installed apps, adding value to business solutions’ development and customization. Its flexible design, format options, and multi-site support make it a versatile feature in the Empress system.