Developer's Guide to Empress’s Show-Config Feature: Streamline Configuration Management

Introduction

Welcome to this comprehensive developer’s guide on the Show-Config feature in Empress. This feature is integral to the seamless operation and customization of your Empress sites. It provides an interface to view the applied frappe.conf values for your sites in various formats, streamlining the process of configuration management and enhancing the developer’s experience.

Understanding the Show-Config Feature

The Show-Config feature provides a unified interface to view the applied configuration for your sites. The configuration is applied as a combination of the bench directory’s common_site_config.json and the site’s own site_config.json. You may choose to access this information in tabular or JSON formats.

This feature is particularly important as it offers a clear picture of the applied configuration, removing any ambiguity and offering a solid foundation for further development and customization.

Implementing the Show-Config Feature

To implement the Show-Config feature, you use the following command:

bench show-config [OPTIONS]

Modifiers for Show-Config

The Show-Config feature provides modifiers to customize the output format of the configuration view. These modifiers are passed as flags at the command line.

The -f, --format flag allows you to choose the format for listing apps installed on the specified site. The available options are “text” and “json”. By default, the format is set to “text”.

Examples of Using Show-Config

Here are a few examples of how you can use the Show-Config feature:

  1. To show site config for all sites in JSON format, use:
bench --site all show-config -f json
  1. To show the site config in tabular form for a specific site, use:
bench --site {site} show-config --format text

or

bench --site {site} show-config -f text

or simply

bench --site {site} show-config

Note: Replace {site} with your actual site name.

Conclusion

The Show-Config feature is a powerful tool for developers working with Empress. It not only provides a clear view of the applied configurations for your sites but also allows customization of the output view. With this feature, developers can work more efficiently, reducing the time spent on configuration management and increasing focus on actual development and customization tasks.