The xcode_tools script I wrote a while back has been updated to better handle newer releases of Xcode.
The new version can process most recent macOS releases (only tested 10.9+) to find the most recent Command Line Tools and SDK release for that version of macOS, as well as install found packages.
It requires python 2.7.10 and be run on a macOS release newer than 10.9.
To see available arguments, clone the repo and run
./xcodetools.py --help. By default, running
./xcodetools.py will download the latest version of the Command Line Tools and SDK (if available) to