Reactant integrated Picocli into
You can create a command class and extend
ReactantCommand, then you can declare your own command just like a normal Picocli command.
For more usage of Picocli, please refer to Picocli Documentation
Also, you can add
internal keyword to the command class to avoid exposing it.
Now, we can register the command we just created with the
Injectables for Command
Since only Component can get the injections of objects, if your command needs to inject other objects, you can inject in the Command Register and pass it through the command class constructor.
Sometimes we might need to create multi-level command, following is an example of how it works.
Then register them all commands in your register component with the correct nesting structure.
You should be able to call the command with
/main sub1 and
/main sub2 after registered the command.