Tools that leverage the Xcode Command Line Tools might have a problem if you install the tools without agreeing to the license. Here, you can see IntelliJ complaining about just that:
To agree to the license agreement, you can use xcrun along with the cc verb:
sudo xcrun cc
This is an interactive command line environment so in order to script it you’d need to use expect to feed in the correct parameters.