Place the plugin binary somewhere in the PATH and give it the name "protoc-gen-NAME" (replacing "NAME" with the name of your plugin). If you then invoke protoc with the parameter –NAME_out=OUT_DIR (again, replace "NAME" with your plugin's name), protoc will invoke your plugin to generate the output, which will be placed in OUT_DIR.

Place the plugin binary anywhere, with any name, and pass the –plugin parameter to protoc to direct it to your plugin like so: