Getting started

2 minute read

Creating and setting your API key

First, create an API key in the Settings area (click the cog ⚙️ icon in the sidebar) . This authentication token lets the CLI talk to your CloudBees Smart Tests workspace.

Then, make your API key available as the SMART_TESTS_TOKEN environment variable in your CI process. How you do this depends on your CI system: (If you’re using a different CI system, check its documentation for a section about setting environment variables. CloudBees Smart Tests works with any CI system.)

CI system Docs

Azure DevOps Pipelines

Link

Bitbucket Pipelines

Link

CircleCI

Link

GitHub Actions

Link

GitLab CI

Link

GoCD

Link

Jenkins

Link Note: Create a global "secret text" to use in your job

Travis CI

Link

Installing the CloudBees Smart Tests CLI in your CI pipeline

The CloudBees Smart Tests CLI is a Python3 package that you can install from PyPI. The CLI connects your build tool/test runner to CloudBees Smart Tests.

We recommend using uv, a fast Python package installer, for the best installation experience.

First, install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh export PATH="$HOME/.local/bin:$PATH"

For other installation methods (including Windows, Github Actions, etc.), see the uv installation guide.

Then install CloudBees Smart Tests CLI:

uv tool install smart-tests

Alternative: Using pip

You can also install the CLI using pip by adding the following command to the part of your CI script where you install dependencies. (If your build and test process is split into different pipelines or machines, you must do this in both places.)

pip3 install --user --upgrade smart-tests

Verifying connectivity

After setting your API key and installing the CLI, you can add smart-tests verify || true to your CI script to verify that everything is set up correctly. If successful, you should receive an output such as:

# We recommend including `|| true` after smart-tests verify so that the exit status from the command is always 0 $ smart-tests verify || true Organization: <organization name> Workspace: <workspace name> Platform: <platform> Python version: <version> Java command: <command> smart-tests version: <version> Your CLI configuration is successfully verified 🎉

If you get an error, see Troubleshooting.