I'll provide some information for each of the version series. My recommendation is for you to target Arduino IDE 2.x since Arduino IDE 1.x is increasingly a tool of the past for the Arduino community and 2.x is increasingly the tool of the present and future.
Arduino IDE 1.x
Arduino IDE 1.x has a "Tool" (often referred to as "plugin") system, which allows additional capabilities to be added to the IDE without modifying the IDE source code. You might be familiar with it already if you have used something like the "ESP Exception Decoder" or "ESP32 filesystem uploader".
Arduino has not provided any documentation of the "Tool" system, but Arduino IDE inherited this "Tool" system from its origin circa 2005 as a fork of the Processing IDE and there is some information about the feature in the Processing IDE (I don't know what sort of divergences there might have been in the Tool system of the two IDEs in the years since the fork):
https://github.com/processing/processing4/wiki/Tool-Overview
You will also find some information in the files under the tools subfolder of the Arduino IDE 1.x installation folder:
https://github.com/arduino/Arduino/blob/master/build/shared/tools/howto.txt
and a simple example Tool named "Mangler":
https://github.com/arduino/Arduino/blob/master/build/shared/tools/Mangler/src/Mangler.java
Arduino IDE 2.x
The way to add additional capabilities to Arduino IDE 2.x is through VS Code extensions:
https://code.visualstudio.com/api
Due to the tremendous popularity of VS Code, you will find a lot of information available on the Internet about creating VS Code extensions.
Although it was possible to do quite a lot with that existing support, previously extensions didn't have any way of getting Arduino-specific data (e.g., the currently selected board, the path to the sketch build folder) from Arduino IDE. That made it either difficult or impossible to create VS Code extensions that would be equivalent to the popular Arduino IDE 1.x "Tools" the community has created.
In addition to the general capabilities of the extensions framework, starting from Arduino IDE 2.2.0, Arduino-specific data is also made available to extensions by Arduino IDE. For your project, you might use this to get the IP address of the network port the user has selected from the Tools > Port menu in Arduino IDE.
That Arduino-specific data availability has already been leveraged to create an Arduino IDE extension equivalent to the popular "ESP Exception Decoder" Tool for Arduino IDE 1.x. You might find the code in that extension to be a useful reference for your own project:
https://github.com/dankeboy36/esp-exception-decoder