Did not resolve it for me I got
xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools'
tlwilkinsonyyc@Thomass-MacBook-Pro ~ % xcode-select --install
xcode-select: note: install requested for command line developer tools
tlwilkinsonyyc@Thomass-MacBook-Pro ~ % /usr/bin/cc --version
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
tlwilkinsonyyc@Thomass-MacBook-Pro ~ % sudo xcode-select --switch /Library/Developer/CommandLineTools
Tried all of what the people had mentioned but got nowhere. Running Ventura 13.0.1 Any other suggestions. Just was using Brew to install ffmpeg and ran into needing the command tools.