Skip to main content

On-demand Grids using CLI

Automate TurboScale provides a powerful CLI that helps you create and destroy grids on demand. You can truly automate your pipeline and spawn a browser automation Grid as per your needs to optimize utilization.

The BrowserStack CLI is a free tool that enables you to interact with Automate TurboScale services using commands in your command-line shell. Initialize your CLI with BrowserStack’s access credentials using either your account or service account and start using the CLI for automating the entire Grid lifecycle.

  • Linux shells – Use common shell programs such as bash, zsh, and tcsh to run commands in Linux or macOS.
  • Windows command line – On Windows, run commands at the Windows command prompt or in PowerShell.

Installation and CLI Version

The BrowserStack CLI can be installed using npm installer. Use the below command to install the CLI.

Important: If you plan to create Automation Grid on Azure, please ensure that you have BrowserStack CLI version 1.26.6 installed.
Installation
npm install browserstack-node-sdk

The CLI comes with rich help messages. Run CLI with -h or --help arguments to get the help message for specific CLI command or specific command group. The latest version supported on CLI is 1.x. To check the currently installed version, use the following command.

Command Line
npx browserstack-cli ats -version

The sample output for the version command looks like below.

Command Output
➜  ~ npx browserstack-cli ats -version
1.17.0

Initialize CLI and Grid Lifecycle Management

Initialization

Initialize the CLI with BrowserStack account credentials using either your account or service account for your Group.

Command Line
npx browserstack-cli ats init --bstack-username YOUR_USERNAME --bstack-accesskey YOUR_ACCESS_KEY 

Create a new Grid

Use the CLI to create a new browser automation grid in an automated way. There are multiple options to create a new grid. You can either let CLI manage the end-to-end process of grid creation or create a new Grid in your existing Kubernetes cluster.

We recommend the former approach because it supports the end-to-end needs of a scalable automation grid, that involves managing all the services with a cloud provider. If you are re-using your Kubernetes cluster, cloud platform configuration about auto-scaling or other dependencies like tests storage need to be managed separately using the cloud provider console/utilities.

Important: As a pre-requisite, you will need access and a secret key for the IAM user generated during the setup guide using the AWS CloudFormation link. This is not required if you are re-using your existing Kubernetes cluster. For more information on how to set up your AWS account, refer to this documentation

Command Help

Command Line
npx browserstack-cli ats create grid -h

Command Options

The create command supports the following options.

  • --grid-name - Pass the name to set up the browser automation grid with the specific name. Name this grid using either team’s name, pipeline specific or any other generic identifier.
  • --grid-profile - Use an existing grid profile to set up the browser automation grid. By default, the configured grid profile is used. For more details, see the helper section below.

If you are creating a new Grid in your existing Kubernetes cluster, use create grid command with the following additional options instead of using --grid-profile option.

  • --cluster-name - Pass the name of the existing Kubernetes Cluster from your AWS/Azure/GCP setup.
  • --cloud-provider - Pass the name of the cloud provider for the existing Kubernetes Cluster setup.
  • --region - Pass the region for existing Kubernetes Cluster setup.

Delete any Grid

Use the CLI to delete a browser automation grid in an automated way. Running this command deletes the browser automation grid and corresponding metadata stored on BrowserStack. If all the grids have been deleted, the delete command cleans up all the dependent services on the cloud platform as well.

Command Help

Command Line
npx browserstack-cli ats delete grid -h

Command Options

The delete command supports the following options.

  • --grid-id - Pass the Grid ID available via other CLI commands or Automation console to trigger the grid deletion.

Helper commands

List all Grids

You can create and manage multiple browser automation grids with Automate TurboScale. Use the CLI to list down all grids created on your BrowserStack account.

Command Help

Command Line
npx browserstack-cli ats list grids -h

Command Options

The list grid command supports the following options.

  • --all-grids - Boolean parameter. Pass the argument as true to list the grids created by everyone in the group. By default, it will list down the grids created from your account.

Set grid profile on your CLI

You can create multiple grids on-demand with Automate TurboScale CLI. To simplify the steps required for creating multiple Grids, you can store the configurations like concurrency, cloud provider, region or other cloud provider-related infrastructure details as a grid profile. Teams can create multiple grid profiles as per their requirements based on components or team setup or geographical locations. CLI helps to configure a default profile in the pipeline or workspace to use the same configuration for creating new Grids every time.

Command Help

Command Line
npx browserstack-cli ats configure -h

List all Grid Profiles

You can create and manage grid profiles with Automate TurboScale with different customizations. Use the CLI to list down all grid profiles created on your BrowserStack account.

Command Help

Command Line
npx browserstack-cli ats list grid-profiles -h

Command Options

The list grid command supports the following options.

  • --all-grid-profiles - Boolean parameter. Pass the argument as true to list the grid profiles created by everyone in the group. By default, it will list down the grid profile created from your account.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked






Thank you for your valuable feedback!

Talk to an Expert
Download Copy