qBraid uses configuration files to store your account credentials and settings. The main configuration file is called qbraidrc.

The qbraidrc File

The qbraidrc file is an INI-format configuration file that stores your qBraid account credentials and settings. It is located in your home directory at:

  • Linux/macOS: ~/.qbraid/qbraidrc
  • Windows: C:\Users\<username>\.qbraid\qbraidrc

This configuration file is used by various qBraid tools including:

  • qBraid-SDK
  • qBraid-CLI
  • qBraid Jupyter Lab extensions
  • qBraid VS Code extension

File Structure

A typical qbraidrc file contains the following:

[default]
url = https://api.qbraid.com/api
api-key = <your-api-key>

Creating New Configuration File

To create a new qbraidrc file:

qbraid configure

This interactive command will:

  1. Prompt you to enter your API key
  2. Automatically set the qBraid API URL
  3. Create the configuration file in the correct location

Updating Configuration Values

To update a specific configuration value:

qbraid configure set <field> <value>

For example, to update your API key:

qbraid configure set api-key your-new-api-key

Viewing Configuration Values

To view a specific configuration value:

qbraid configure get <field>

For example:

qbraid configure get api-key

To view all configuration values in your default profile:

qbraid configure list

Finding Your Configuration File

To locate your qbraidrc file programmatically:

from pathlib import Path

config_path = Path.home() / ".qbraid" / "qbraidrc"

print(config_path)

Security Note

Your API key provides access to your qBraid account. Keep it secure and never share it with others. If you believe your API key has been compromised, you can generate a new one from your qBraid account settings and update it using the CLI commands above.

See API key security for more information.