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:
$> 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
$> 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:
$> 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:
$> tb workspace current
-------------------------------------------------------------------------------------------
| name | id | role | plan | current |
-------------------------------------------------------------------------------------------
| Production | 841717b1-2472-44f9-9a81-42f1263cabe7 | admin | personal | True |
-------------------------------------------------------------------------------------------
Members management¶
You can manage workspace members using the Web UI or the CLI. For the latter, just use the workspace members
commands.
You can add members:
$ tb workspace members add "user1@example.com,user2@example.com,user3@example.com"
Remove members:
$ tb workspace members rm user3@example.com
And list them:
$ tb workspace members ls
---------------------
| email |
---------------------
| user1@example.com |
| user2@example.com |
---------------------