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.
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).