Workspaces

When belonging to different workspaces, it’s possible you need to switch between workspaces when working on a project.

Imagine the following scenario: You have your personal Tinybird account and you belong to two workspaces: production and staging. You want to be able switch from staging to production when necessary in order to push the current status of your project.

Authenticate

Let’s authenticate using the admin token of the staging account:

Authenticate
$> tb auth
Copy the admin token from https://ui.tinybird.co/tokens and paste it here: <pasted token>
** Auth successful!
** Configuration written to .tinyb file, consider adding it to .gitignore

List workspaces

Then, you can list the workspaces you have access to, and the one that you’re currently authenticated to

List workspaces
$> tb workspace ls

-------------------------------------------------------------------------------------------
| name                | id                                   | role  | plan     | current |
-------------------------------------------------------------------------------------------
| Staging             | 3a798a68-38b1-4947-a0eb-399b7adbfa25 | admin | personal | True    |
| Production          | 841717b1-2472-44f9-9a81-42f1263cabe7 | guest | personal | False   |
-------------------------------------------------------------------------------------------

Switch to a workspace

Now, you can switch to another workspace as follows:

Switch to the Production workspace using the workspace id or the workspace name
$> tb workspace use 841717b1-2472-44f9-9a81-42f1263cabe7
$> tb workspace use Production

** Now using Production workspace (841717b1-2472-44f9-9a81-42f1263cabe7)

$> tb workspace ls

-------------------------------------------------------------------------------------------
| name                | id                                   | role  | plan     | current |
-------------------------------------------------------------------------------------------
| Staging             | 3a798a68-38b1-4947-a0eb-399b7adbfa25 | admin | personal | False   |
| Production          | 841717b1-2472-44f9-9a81-42f1263cabe7 | guest | personal | True    |
-------------------------------------------------------------------------------------------

You can also quickly check which workspace you’re currently into:

Show current workspace
$> tb workspace current

-------------------------------------------------------------------------------------------
| name                | id                                   | role  | plan     | current |
-------------------------------------------------------------------------------------------
| Production          | 841717b1-2472-44f9-9a81-42f1263cabe7 | admin | personal | True    |
-------------------------------------------------------------------------------------------