Skip to Content
qobuz-cli

πŸ” Authentication

Connect your Qobuz account with a browser session token, stored in the macOS Keychain

Qobuz defends password login with captchas and IP-flagging, so qobuz-cli never asks for your password. Instead it borrows the user_auth_token that your logged-in browser already holds, validates it, and stores it in the macOS Keychain. Every other command reuses that stored session.

qobuz login

Connects your account. The flow:

  1. Prints instructions and opens play.qobuz.com/login after a short countdown.
  2. Pre-fills X-App-Id by scraping the current app id from the web-player bundle β€” press Enter to accept the suggestion in brackets.
  3. Prompts for X-User-Auth-Token (input is hidden as you paste).
  4. Validates the pair against the live API, then saves { appId, token } to the Keychain.
$ qobuz login
Connect your Qobuz account.
In the page that opens: log in, then DevTools β†’ Network, click any
request to www.qobuz.com/api.json and copy these from its headers:

  X-App-Id [123456789]:
  X-User-Auth-Token: Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·Β·

  Validating… βœ“ connected. Session saved to the Keychain (service "qobuz").

Finding the token in your browser

  1. Open play.qobuz.com and log in.
  2. Open DevTools β†’ Network, and click any request to www.qobuz.com/api.json.
  3. From its Request Headers, copy X-User-Auth-Token (and X-App-Id if you'd rather not use the scraped default).

If validation fails (βœ— …), the token was rejected β€” grab a fresh one from a currently logged-in session and retry. Nothing is saved unless validation passes.

qobuz login --browser

An opt-in, assisted variant of the same flow. It opens a real, headed Chromium window on play.qobuz.com/login; you sign in there as usual, captcha included. The CLI watches the requests the web player makes and takes the first X-User-Auth-Token header it sees (and X-App-Id alongside it, otherwise the scraped default), falling back to a user_auth_token held in the page's localStorage. The token then goes through the same validation and Keychain save as the paste flow, and the window is closed. The password is entered only into Qobuz's page and never passes through the CLI.

Playwright is an optional peer dependency, so a plain install does not pull it in. Install it once to use this flag:

$ npm install -g playwright && npx playwright install chromium

If Playwright is missing, --browser prints that command and exits non-zero. If no token is seen within five minutes, or the window is closed first, it stops and points back to plain qobuz login.

qobuz logout

Clears the stored session from the Keychain. The next command will require qobuz login again.

$ qobuz logout
βœ“ logged out. Keychain session cleared.

Where credentials live

Credentials are kept in the macOS Keychain under service qobuz, account credentials β€” never in a plaintext dotfile, and no password is ever stored. You can inspect the entry in Keychain Access (search for "qobuz") or with the security CLI.

Under the hood the CLI uses the core's createKeychainStore(); the same token works from any @kud/qobuz consumer pointed at the same store. See the core Authentication docs for the credential-store model.