Since the Command API makes use of the Component API, make sure you read Component first
The most comfortable way to create a new command is the
Command.Parameterized builder, which will be detailed in
this section. It supports child commands and takes advantage of Minecraft’s Brigadier system.
Alternatively, you can use
Command.Raw, a lower-level interface which you can extend your own command system onto.