Bundle's of karaf consol

Someone can tell me which bundles in the openhab-core project handles the commands openhab:user add , openhab:user list, …

I think I have already found these three bundle’s in the bundle folder of the openhab-core project:
org.openhab.core.addon.marketplace.karaf
org.openhab.core.io.consol.karaf
org.openhab.core.karaf

But can you tell me if there are others or if I am wrong in any of these bundles.

Thanks in advance.

The .java file that contains

    private static final String SUBCMD_LIST = "list";
    private static final String SUBCMD_ADD = "add";
    private static final String SUBCMD_REMOVE = "remove";
    private static final String SUBCMD_CHANGEPASSWORD = "changePassword";
    private static final String SUBCMD_LISTAPITOKENS = "listApiTokens";
    private static final String SUBCMD_ADDAPITOKEN = "addApiToken";
    private static final String SUBCMD_RMAPITOKEN = "rmApiToken";
    private static final String SUBCMD_CLEARSESSIONS = "clearSessions";

is

openhab-core/bundles/org.openhab.core.io.console/src/main/java/org/openhab/core/io/console/internal/extension/UserConsoleCommandExtension.java

so I would assume it is e.g.

org.openhab.core.io.console-3.1.0.jar
1 Like

Ok thank you very much.

There are few things to note. Normal Apache Karaf (lower level tool) commands are implemented differently. Bundles which you have mentioned are related to OH implementation of commands. The org.openhab.core.io.consol.karaf is implementation of openHAB console API based on libraries supported within Karaf.

Historically OH/Eclipse Smart-House was working with various assemblies hence it was necessary to keep some unification.

Complete tutorial on how to write commands is here: Apache Karaf Container 4.x - Documentation. If you rely on Karaf command API then you loose portability but also gain possibility to provide suggestions (command completion).

Best,
Łukasz

1 Like