Skip to content

Cookie preferences

We use cookies for our own analytics, to see how our campaigns perform and, if you allow it, to load content from other services such as the Google site search. We never sell your data. Necessary cookies keep the site working and cannot be switched off. See our Cookie Policy for details and our Privacy Policy for how we handle personal data.

Security, load balancing and remembering your cookie choice.

Show us which pages people read, how they find the site and where they get stuck, so we can improve it (Google Analytics, Microsoft Clarity).

Show us which of our ad campaigns bring visitors to the site and remember the campaign or partner link you arrived from (Google Ads, LinkedIn, Meta, partner program). We do not use these cookies to build advertising profiles.

Load the site search from Google when you use it. Google sets its own cookies and shows ads in the search results.

© 2026 The ThingsBoard Authors
22.5k Try for free

ThingsBoard Cloud

Choose your data region

Your data stays in the region you choose, for residency and compliance. No credit card required.

Rather run it yourself? Install on your own servers

ThingsBoard CLI configuration

ThingsBoard CLI connects to ThingsBoard with a profile. A profile contains a ThingsBoard URL and the credentials of a user. You can create several profiles, like one for each environment, and select the profile that the CLI uses.

Run the wizard:

Terminal window
tb config

The wizard asks four questions. Then it tests the connection.

  • ThingsBoard URL: Press Enter for ThingsBoard Cloud (https://thingsboard.cloud). For Cloud EU, enter https://eu.thingsboard.cloud. For your own server, enter its URL.
  • Auth method: Press Enter to use api_key. The jwt method saves your username and password in plain text.
  • API Key: Paste your API key. The wizard shows the page where you create a key. For details, see API keys.
  • Profile name: Press Enter to use dev, or enter a name like cloud or prod.

If the connection fails, the wizard shows the reason and asks if you want to try again.

An AI agent runs commands without a terminal, so it cannot type into the wizard. Use the browser option:

Terminal window
tb config --browser

The CLI opens the page Connect ThingsBoard CLI on your computer. Select ThingsBoard Cloud (North America), ThingsBoard Cloud (Europe), or Your own server. On the next step, paste the API key and click Connect. The key does not appear in the terminal or in the chat. The page closes after 15 minutes.

tb init --browser does the same when a new project has no working profile.

Terminal window
tb config add <name> --url <url> --api-key <key> # create a named profile
tb config set --url <url> --api-key <key> # set the default profile
Terminal window
tb config list # show all profiles
tb config show # show the default profile
tb config use <name> # make a profile the default
tb config edit <name> # change the URL or the credentials
tb config remove <name> # remove a profile

To use another profile for one command, add --profile <name> to the command.

Variable Purpose
TB_URL ThingsBoard URL. Replaces the URL of the active profile.
TB_API_KEY API key. Replaces the credentials of the active profile.
TB_PROFILE Name of the profile to use, the same as --profile.
TB_CONFIG_HOME Folder for profiles and settings. Default: ~/.thingsboard.
TB_DEBUG Set to 1 to show every HTTP request and response, the same as --debug.

In CI, set TB_URL and TB_API_KEY as secrets:

Terminal window
TB_URL=https://thingsboard.cloud TB_API_KEY=$TB_API_KEY tb push my-solution

Each project has a thingsboard.json file in its root folder. tb init creates it. The file contains:

  • Mode: local (default) saves changes to project files; remote sends them to ThingsBoard at once. For details, see Local and remote mode.
  • Agent format: The agent kit that the project uses: claude, antigravity, or both.
  • Kit version: The version of the agent kit. The CLI updates the kit when you install a new CLI version.