@Override
    public Integer doCall() throws Exception {
        List<Row> rows = new ArrayList<>();

        JsonObject plugins = loadConfig().getMap("plugins");
        plugins.forEach((key, value) -> {
            JsonObject details = (JsonObject) value;

            String name = details.getStringOrDefault("name", key);
            String command = details.getStringOrDefault("command", name);
            String dependency = details.getStringOrDefault("dependency",
                    "org.apache.camel:camel-jbang-plugin-%s".formatted(command));
            String description
                    = details.getStringOrDefault("description", "Plugin %s called with command %s".formatted(name, command));

            rows.add(new Row(name, command, dependency, description));
        });

        printRows(rows);

        if (all) {
            rows.clear();
            for (PluginType camelPlugin : PluginType.values()) {
                if (plugins.get(camelPlugin.getName()) == null) {
                    String dependency = "org.apache.camel:camel-jbang-plugin-%s".formatted(camelPlugin.getCommand());
                    rows.add(new Row(
                            camelPlugin.getName(), camelPlugin.getCommand(), dependency,
                            camelPlugin.getDescription()));
                }
            }

            if (!rows.isEmpty()) {
                printer().println();
                printer().println("Supported plugins:");
                printer().println();

                printRows(rows);
            }
        }

        return 0;
    }
@Test
    public void shouldGetAllPlugins() throws Exception {
        JsonObject pluginConfig = PluginHelper.getOrCreatePluginConfig();
        JsonObject plugins = pluginConfig.getMap("plugins");

        JsonObject fooPlugin = new JsonObject();
        fooPlugin.put("name", "foo-plugin");
        fooPlugin.put("command", "foo");
        fooPlugin.put("dependency", "org.apache.camel:foo-plugin:1.0.0");
        plugins.put("foo-plugin", fooPlugin);

        PluginHelper.savePluginConfig(pluginConfig);

        PluginGet command = new PluginGet(new CamelJBangMain().withPrinter(printer));
        command.all = true;
        command.doCall();

        List<String> output = printer.getLines();
        Assertions.assertEquals(9, output.size());
        Assertions.assertEquals("NAME        COMMAND  DEPENDENCY                         DESCRIPTION", output.get(0));
        Assertions.assertEquals(
                "foo-plugin  foo      org.apache.camel:foo-plugin:1.0.0  Plugin foo-plugin called with command foo",
                output.get(1));

        Assertions.assertEquals("Supported plugins:", output.get(3));
        Assertions.assertEquals("NAME        COMMAND     DEPENDENCY                                      DESCRIPTION",
                output.get(5));
        Assertions.assertEquals(
                "camel-k     k           org.apache.camel:camel-jbang-plugin-k           %s"
                        .formatted(PluginType.CAMEL_K.getDescription()),
                output.get(6));
        Assertions.assertEquals(
                "kubernetes  kubernetes  org.apache.camel:camel-jbang-plugin-kubernetes  %s"
                        .formatted(PluginType.KUBERNETES.getDescription()),
                output.get(7));
        Assertions.assertEquals(
                "generate    generate    org.apache.camel:camel-jbang-plugin-generate    %s"
                        .formatted(PluginType.GENERATE.getDescription()),
                output.get(8));
    }