tb dev¶
Use tb dev to build your project and watch for changes. When in watch mode you can run SQL queries against the project and also run commands, as --local becomes the default target.
For example:
tb dev » Building project... ✓ datasources/user_actions.datasource created ✓ endpoints/user_actions_line_chart.pipe created ✓ endpoints/user_actions_total_widget.pipe created ✓ Rebuild completed in 0.2s Watching for changes... tb >
You can run commands and queries from the tb dev prompt. For example:
tb » select * from reservoir_levels » Running QUERY day station abslevel percentagevolume volume Date String Nullable(Float32) Float32 Float32 ────────────────────────────────────────────────────────────────────────────────── 2025-02-07 station_4 108667680000 108667680000 1086676860000 ────────────────────────────────────────────────────────────────────────────────── 2025-01-13 station_9 325980750000 325980750000 3259807600000 ────────────────────────────────────────────────────────────────────────────────── 2025-01-30 station_2 406434020000 406434020000 4064340300000 ────────────────────────────────────────────────────────────────────────────────── 2025-02-09 station_2 60706034000 60706034000 607060300000 ────────────────────────────────────────────────────────────────────────────────── 2025-01-25 station_7 403222040000 403222040000 4032220400000 ────────────────────────────────────────────────────────────────────────────────── » 331 bytes (5 rows x 5 cols) in 6.85ms » Showing all rows
UI development¶
By default, your project is exposed as API when tb dev is running. You can open the Tinybird UI to edit your project directly in the browser.
tb dev » Exposing project to Tinybird UI... * Access your project at https://cloud.tinybird.co/local/7181/your_workspace/project
You can skip enabling this API by passing --skip-ui flag.
Developing with production data¶
You can develop with production data by pointing to a branch created with the --last-partition flag.
tb branch create my_feature_branch --last-partition ** Branch 'my_feature_branch' from 'web_analytics' has been created
Then you can point your dev session to the branch by passing the --branch flag.
tb --branch=my_feature_branch dev