.agents/skills/tinybird-cli-guidelines/rules/cli-commands.md
⚠️ 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.
dev_mode once, then run plain tb build and tb deploy.--cloud, --local, and --branch only as explicit manual overrides.tb --cloud <command>: Run command against Cloudtb --local <command>: Run command against Localtb --branch <branch_name> <command>: Run command against a specific branchtb --debug <command>: Print debug informationtb init: Initialize a new projecttb create: Deprecated alias for tb inittb 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 changestb dev --ui: Connect local project to Tinybird UItb preview: Create/update preview environment for the current branchtb open: Open workspace in the browsertb fmt <file>: Format a .datasource, .pipe, or .connection filetb fmt <file> --diff: Show diff without modifying filetb deploy: Deploy the projecttb deploy --check: Validate deployment without actually creatingtb deploy --wait: Wait for deployment to finishtb deploy --allow-destructive-operations: Allow destructive changes (requires explicit confirmation)tb 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 deploymenttb logs: Show recent logs from common service datasourcestb logs --start -30m --source '*': Query all sources for a custom time rangetb logs --output json: Emit logs as JSON for scriptingtb 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 filetb pipe ls: List all pipestb endpoint ls: List all endpointstb endpoint data <pipe_name>: Get data from endpoint (use this to test endpoints)tb 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 endpointNote: use tb endpoint data to test endpoints, not tb pipe data. The endpoint data command calls the endpoint as a consumer would, with parameter validation and output formatting.
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 nodetb 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 parameterstb test run: Run the full test suitetb test run <file_or_test>: Run specific test file or testtb test update <file_or_test>: Update test expectationstb mock was removed in CLI 4.0fixtures/ folder and agent skills to generate sample data, then append with tb datasource appendtb token ls: List all tokenstb secret ls: List all secretstb secret set <name> <value>: Create or update a secrettb secret rm <name>: Delete a secrettb connection ls: List all connectionstb sink ls: List all sinkstb job ls: List all jobstb job cancel <job_id>: Cancel a running jobtb branch ls: List all branchestb branch create <name>: Create a new branch (starts empty)tb branch create <name> --last-partition: Create a branch with latest production data partitiontb branch rm <name>: Remove a branchtb branch clear: Clear branch statetb --branch <name> token ls: List tokens for a specific branchtb --branch <name> endpoint data <pipe>: Test endpoint on a specific branchtb 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 versiontb local clear: Clear local workspace statetb workspace ls: List all workspacestb workspace current: Show current workspacetb workspace clear --yes: Clear workspace statetb login: Authenticate via browsertb logout: Remove authenticationtb update: Update CLI to latest version