---
updatedAt: 2026-03-05T13:26:45.000Z
agentTools:
  projectIndex: https://help.rainforestqa.com/llms.txt
---

# Running Tests from the CLI

Learn how to use the CLI to execute individual tests, run groups, and features.

## Installing the CLI

With Rainforest’s Command Line Interface (CLI) tool, you can start a test without the need to log into Rainforest directly. Follow these steps to enable the CLI:

1. Install the CLI. For more information, see <Anchor label="How to Install the CLI" target="_blank" href="how-to-install-the-cli">How to Install the CLI</Anchor> .
2. In your Rainforest account, navigate to the <a href="https://app.rainforestqa.com/settings/integrations" target="_blank">Integrations</a>  page under Settings to retrieve your API token. Note that the token is unique for each user in your team’s account.

## CLI Authentication

For local usage, authentication to the CLI can be done using the `--token` command line flag, or the `RAINFOREST_API_TOKEN` environment variable.  For example, the following two invocations are equivalent:

```
# Explicitly pass in the api token:
rainforest run <test_id> --token <token>

# Use the api token specified in the environment variable
export RAINFOREST_API_TOKEN=<token>
rainforest run <test_id>
```

Note: For use in your CI tool you’ll want to use your service’s dedicated environment variables functionality (e.g. [CircleCI users](https://circleci.com/docs/env-vars/), and for [GH Actions users](https://docs.github.com/en/actions/learn-github-actions/environment-variables), etc)

## How to Start an Individual Test from the CLI

The CLI uses default configuration when running a single test. To update these parameters you can do so via the [API](https://help.rainforestqa.com/reference/put-clients).
**Note:** The default execution method for certain accounts is the human Tester Community. If you want to run your test via automation, ensure you specify execution method as <code>--execution-method automation</code>.

1. Determine your desired execution method, either <code>automation</code>, <code>crowd</code>, <code>automation\_and\_crowd</code>, or <code>on\_premise</code>.
2. Open a command or terminal window.
3. Use the following command, replacing the API token and test ID with the ones from your own account:

```
rainforest run <test_id> --token <token> --execution-method automation
```

## How to Start Run Groups from the CLI

The CLI uses the configuration defined in the [Run Group settings](how-to-create-and-manage-a-run-group)  (environment, browsers, execution method, location) unless different parameters are passed. Verify your Run Groups execution method setting is set to how you would like the tests to run, either <code>automation</code>  or <code>crowd</code>.

1. Open a command or terminal window.
2. To get a list of your run groups and their IDs, use the following command:

```
rainforest run-groups --token <token>
```

3. Once you have noted the IDs of the run group you want to start, use the following command to execute the run group:

```
rainforest run --run-group <run_group_id> --token <token>
```

4. Optionally, set the parameters <code>--environment-id</code>, <code>--browsers</code>, and <code>--execution-method</code> if you want to use different settings for the run.

## How to Run a Feature from the CLI

1. Open a command or terminal window.
2. Get a list of your features and their IDs using the following command:

```
rainforest features --token <token>
```

3. Once you have the ID of the feature which you want to run, use the following command to start all tests included in the feature:

```
rainforest run --feature <feature_id> --token <token>
```

## How to Run All Tests from the CLI

**Note:** The default execution method may be <code>--execution-method crowd</code>. If you want to run your test via automation, ensure you specify execution method as <code>--execution-method automation</code>.

1. Open a command or terminal window.
2. Use the following command to start all tests in your Rainforest account:

```
rainforest run all --token <token> --execution-method automation
```

> 👍 CLI Reference
>
> For more information on CLI commands and their usage, see our <a href="https://github.com/rainforestapp/rainforest-cli" target="_blank">GitHub</a> page.

<hr />

*If you have any questions, reach out to us at <support@rainforestqa.com>.*