4.8 KiB
4.8 KiB
Tinybird CLI Commands
⚠️ Never invent commands or flags. If you are unsure whether a command or flag exists, run tb <command> --help to verify before using it. Only use commands and flags documented here or confirmed via --help.
Global Options
tb --cloud <command>: Run command against Cloud (production)tb --local <command>: Run command against Local (default)tb --branch <branch_name> <command>: Run command against a specific branchtb --debug <command>: Print debug information
Project & Development
tb create: Initialize a new projecttb create --prompt "description": Create project from AI prompttb info: Show project information and CLI contexttb build: Validate and build the projecttb build --watch: Build and watch for changestb dev: Build and watch for changes with live reloadtb dev --ui: Connect local project to Tinybird UItb open: Open workspace in the browsertb fmt <file>: Format a .datasource, .pipe, or .connection filetb fmt <file> --diff: Show diff without modifying file
Deploy & Deployments
tb deploy: Deploy the projecttb deploy --wait: Wait for deployment to finishtb deploy --check: Validate deployment without actually creatingtb deployment ls: List all deploymentstb deployment create: Create a staging deployment and validate before promotingtb deployment promote: Promote a staging deployment to productiontb deployment discard: Discard a pending deployment
Data Sources
tb datasource ls: List all data sourcestb datasource append <name> --file <path>: Append data from local filetb datasource append <name> --url <url>: Append data from URLtb datasource append <name> --events '<json>': Append JSON eventstb datasource replace <name> <file_or_url>: Full replace of data sourcetb datasource replace <name> <file_or_url> --sql-condition "<condition>": Selective replacetb datasource delete <name> --sql-condition "<condition>": Delete matching rowstb datasource delete <name> --sql-condition "<condition>" --wait: Delete and wait for completiontb datasource truncate <name> --yes: Delete all rowstb datasource truncate <name> --cascade --yes: Truncate including dependent MVstb datasource sync <name> --yes: Sync from S3/GCS connectiontb datasource export <name> --format csv: Export data to file
Pipes & Endpoints
tb pipe ls: List all pipestb endpoint ls: List all endpointstb endpoint data <pipe_name>: Get data from endpointtb endpoint data <pipe_name> --param_name value: Get data with parameterstb endpoint stats <pipe_name>: Show endpoint stats for last 7 daystb endpoint url <pipe_name>: Print endpoint URLtb endpoint token <pipe_name>: Get token to read endpoint
SQL Queries
tb sql "<query>": Run SQL querytb sql "<query>" --stats: Run query and show statstb sql --pipe <path> --node <node_name>: Run SQL from a specific pipe node
Materializations & Copy Pipes
tb materialization ls: List all materializationstb copy ls: List all copy pipestb copy run <pipe_name>: Run a copy pipe manuallytb copy run <pipe_name> --param key=value: Run with parameters
Testing
tb test run: Run the full test suitetb test run <file_or_test>: Run specific test file or testtb test create <pipe_name>: Create a test for a pipetb test update <file_or_test>: Update test expectations
Mock Data
tb mock <datasource>: Generate sample data for a data sourcetb mock <datasource> --rows 100: Generate specific number of rowstb mock <datasource> --prompt "extra context": Add context for generation
Tokens & Secrets
tb token ls: List all tokenstb secret ls: List all secretstb secret set <name> <value>: Create or update a secrettb secret rm <name>: Delete a secret
Connections & Sinks
tb connection ls: List all connectionstb sink ls: List all sinks
Jobs
tb job ls: List all jobstb job cancel <job_id>: Cancel a running job
Branches (Beta)
tb branch ls: List all branchestb branch create <name>: Create a new branchtb branch rm <name>: Remove a branch
Tinybird Local
tb local start: Start Tinybird Local containertb local stop: Stop Tinybird Localtb local restart --yes: Restart Tinybird Localtb local status: Check Tinybird Local statustb local remove: Remove Tinybird Local completelytb local version: Show Tinybird Local version
Workspace
tb workspace ls: List all workspacestb workspace current: Show current workspacetb workspace clear --yes: Delete all resources (Local only)
Authentication
tb login: Authenticate via browsertb logout: Remove authenticationtb update: Update CLI to latest version