private static void exportCommandlineShell(final File dataPath) {
        var parentPath = new File(dataPath, "shell");
        if (parentPath.exists()) {
            FileUtils.deleteQuietly(parentPath);
        }
        if (!parentPath.mkdirs()) {
            LOGGER.debug("Unable to create directory");
        }
        var subTypes = ReflectionUtils.findClassesWithAnnotationsInPackage(List.of(ShellComponent.class), CasShellCommand.NAMESPACE);
        var properties = new ArrayList<Map<?, ?>>();

        subTypes.forEach(clazz -> {
            LOGGER.debug("Locating shell command group for [{}]", clazz.getSimpleName());
            var group = clazz.getAnnotation(ShellCommandGroup.class);
            if (group == null) {
                LOGGER.warn("Shell command group is missing for {}", clazz.getName());
            }

            var methods = new LinkedHashMap();
            for (var method : clazz.getDeclaredMethods()) {
                if (method.isAnnotationPresent(ShellMethod.class)) {
                    var annotInstance = method.getAnnotation(ShellMethod.class);
                    var cmd = new ShellCommand();

                    cmd.parameters = new ArrayList<Map<String, String>>();
                    var parameterAnnotations = method.getParameterAnnotations();
                    for (var parameterAnnotation : parameterAnnotations) {
                        for (var annotation : parameterAnnotation) {
                            var ann = (ShellOption) annotation;
                            cmd.parameters.add(Map.of(
                                "name", String.join(",", ann.value()),
                                "help", String.valueOf(ann.help()),
                                "optOut", String.valueOf(ann.optOut()),
                                "defaultValue", ann.defaultValue()));
                        }
                    }

                    cmd.description = annotInstance.value();
                    cmd.name = String.join(",", annotInstance.key());
                    cmd.group = group == null ? "other" : group.value();

                    LOGGER.debug("Adding shell command [{}]", cmd.name);
                    methods.put(cmd.name, cmd);
                }
            }
            properties.add(methods);
        });

        if (!properties.isEmpty()) {
            var configFile = new File(parentPath, "config.yml");
            CasConfigurationMetadataCatalog.export(configFile, properties);
        }

    }
This is {@link CasDocumentationApplication}.

@author Misagh Moayyed
@since 6.4.0
docs/cas-server-documentation-processor/src/main/java/org/apereo/cas/documentation/CasDocumentationApplication.java