There is a related question, "How to download Xcode 13 if the App Store is not accessible?" But if you already have XCode installed and run the following command:
xcode-select --install
The following message appears:
xcode-select: error: command line tools are already installed, use "Software Update" in System Settings to install updates
What is the command to update XCode via the command line or by download?
I know the following basic commands:
List all updates:
softwareupdate -l
To install a specific update in the list, use the following format, but replacing NAME with the update's identifier:
softwareupdate -i NAME
softwareupdate --install 'macOS High Sierra 10.13.3 Supplemental Update-'
To install all available updates for your system type the command:
softwareupdate -i -a
But I don't see one for XCode:
Software Update Tool
Finding available software
No new software available.