How to install command line tools offline? I tried to find a solution but all of them are about trying to install cli-tools without Xcode. All of them eventually require the internet connection. My case is that I want to install cli-tools on a completely offline machine which was never connected to the Internet. Thus the only option is to install from files brought using USB flash.
You have to obtain the tools somehow. Officially you need to have access to the developer download pages at Apple. For the lowest point of entry a valid AppleID seems to suffice for that.

Then you go to the relevant download section on Apple's developer site and choose the appropriate version and download the DMG you need. That file can then be copied to your liking and for example transferred via flash drive.