accepting Xcode license without having whole Xcode I have installed XCL(Xcode command line) through xcode-select --install therefore, not whole Xcode installed.

and I can see the path

xcode-select -print-path
/Library/Developer/CommandLineTools


However, I need to accept the license, but it complains that the Xcode is not installed 

sudo xcodebuild -license
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance


If you recommend me to install whole Xcode first ? should I uninstall XCT first ? and if so how !
Running xcodebuild requires you to have the whole Xcode (GUI) package installed.

Instead run this command:

 sudo xcrun cc


It will allow you to accept the license from the CLI.