deleting app from terminal from the /Applications folder, I can launch apps on my Mac using the open command in the terminal like this

open xcode.app
open firefox.app


Is there a way to delete apps from the terminal? This question/answer doesn't provide the answer to this question
This isn't built into OSX, but a guy wrote a cli tool called trash that is cross platform and is intended as a safe alternative to rm. As it seems it should, it moves the target to the trash rather than deleting it immediately.

There is more information and instructions on how to install at the trash github page