Apache NiFi Toolkit Guide
Also available as:

Adding Commands

To add a NiFi command, create a new class that extends AbstractNiFiCommand:

         public class MyCommand extends AbstractNiFiCommand {

  public MyCommand() {

  protected void doExecute(NiFiClient client, Properties properties)
          throws NiFiClientException, IOException, MissingOptionException, CommandException {
      // TODO implement

  public String getDescription() {
      return "This is my new command";

Add the new command to NiFiCommandGroup:

         commands.add(new MyCommand());

To add a NiFi Registry command, perform the same steps, but extend from AbstractNiFiRegistryCommand, and add the command to NiFiRegistryCommandGroup.