You can use the following command to delete a device:
pw device delete <device> [ -y ]
You must ensure that the target device is no longer connected or trying to connect to the Integration Server first.
If you have additional questions or run into issues, please do not hesitate to open a BMC Support Case
You may try REST API and use curl to delete the Agent from command line.
There are some good docs in the community about the REST API
get list of PatrolAgents REST API
Delete Agent PATROL whith API REST
Web Services , REST API