Skip to main content

tvlabs run

Running project automations with a real device

Use tvlabs run to execute automation workflows on TV Labs devices. This command runs the same automations you can execute from the TV Labs web interface, allowing you to integrate automation runs into your CI/CD pipelines or local development workflows.

cli-run-ui Figure 1: Automation workflow running in Web UI and CLI side by side.

Automation projects

tvlabs run executes complete automation projects that include:

  • Visual workflows created in the TV Labs web interface
  • Target configurations (app and device combinations)
  • Build deployments and version management

Usage Examples

cli-run Figure 2: Example of running a project automation. The command shows real-time progress including test results and device connection status.

Basic automation run

tvlabs run --project 123e4567-e89b-12d3-a456-426614174000 --app 456 --device 789

Run with specific build

tvlabs run --project 123e4567-e89b-12d3-a456-426614174000 \
--app 456 \
--device 789 \
--build abc123-def456-789

Run specific workflow

tvlabs run --project 123e4567-e89b-12d3-a456-426614174000 \
--app 456 \
--device 789 \
--entrypoint workflow-456

Run in specific region

tvlabs run --project 123e4567-e89b-12d3-a456-426614174000 \
--app 456 \
--device 789 \
--region sao_paulo
tvlabs run \
--project 123e4567-e89b-12d3-a456-426614174000 \
--app 5e29ff7b-e5bc-428d-9cd9-136feda81d6c \
--device bd30a97b-3923-4c7a-af94-5a961caea959

Required Parameters

Project Identification

  • --project <project-id> - The unique identifier of your automation project

Target Selection

  • --app <app-id> - The application ID from your project targets
  • --device <device-id> - The device ID from your project targets

Optional Parameters

  • --build <build-id> - Specific build version to deploy and test
  • --entrypoint <workflow-id> - Run a specific workflow instead of the default
  • --region <region> - Teleport region for device selection

Example Output

cli-run-output Figure 3: The output of the project automation.

Discovering Available Targets

Before running a project automation, use the projects targets command to discover available app and device combinations:

tvlabs projects targets --project 123e4567-e89b-12d3-a456-426614174000

This will display:

  • Available apps (with build upload permissions)
  • Available devices (with platform information)
  • Total number of valid target combinations
  • Example usage commands

Example Output

Available targets for project:

Apps:
- ID: 456, Name: My TV App (builds allowed)
- ID: 789, Name: Partner App

Devices:
- ID: 101, Name: LG C2 OLED (2022), Platform: web_os
- ID: 102, Name: Samsung QN90A (2021), Platform: tizen

Example usage:
tvlabs run --project <project-id> --app 456 --device 101

Integration with CI/CD

The tvlabs run command is designed for automation and returns appropriate exit codes:

  • Exit 0: All tests passed successfully
  • Exit 1: One or more tests failed
  • Exit 2: Command usage error (missing parameters, etc.)

GitHub Actions Example

name: TV Automation Tests
on: [push, pull_request]

jobs:
tv-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install TV Labs CLI
run: /bin/bash -c "$(curl -fsSL https://tvlabs.ai/install.sh)"

- name: Run TV automation tests
env:
TVLABS_API_KEY: ${{ secrets.TVLABS_API_KEY }}
run: |
tvlabs run --project ${{ vars.PROJECT_ID }} \
--app ${{ vars.APP_ID }} \
--device ${{ vars.DEVICE_ID }} \
--build ${{ github.sha }}