CLI tool that converts a gamertag to Xbox User ID (XUID).
🎥 Watch video - explains how the tool was built and how it works.
Install Python (minimum 3.11). The CLI should work equally well on Linux, macOS, and Windows.
I highly recommend creating a virtual envirnment first. Once done, make sure to install the packages in requirements.txt:
pip install -r requirements.txtYou will also need to provide a client ID registration with Microsoft Entra ID. You can register an application for free in the Azure Portal.
If you already have a registered application, take note of the client ID and set it in your environent as OPSP_XR_CLIENT_ID.
macOS/Linux:
export OPSP_XR_CLIENT_ID=your_client_idWindows:
$env:OPSP_XR_CLIENT_ID = "your_client_id"Depending on the platform, you can also make the changes permanent (you don't need to set the client ID on every terminal launch):
macOS/Linux
echo 'export OPSP_XR_CLIENT_ID=your_client_id' >> ~/.bashrcChange the file if you use a different shell, like zsh.
Windows
[Environment]::SetEnvironmentVariable("OPSP_XR_CLIENT_ID", "your_client_id", "User")Once completed, you can call the tool from your terminal application:
python -m xr "GAMERTAG_TO_RESOLVE"