Skip to main content

Step 1: Install the Testpilot Binary

Install Testpilot by running the following command in your terminal:
curl -fsSL https://get.jetify.com/testpilot | bash
This command downloads and installs the Testpilot binary on your system. After installation completes, you’ll be able to use the testpilot command.

Step 2: Set Your OpenAI API Key

Testpilot uses OpenAI’s API to generate and run tests. You’ll need to set your OpenAI API key as an environment variable:
export OPENAI_API_KEY=your-api-key-here
If you are using a proxy or a different provider for your OpenAI API, you can set the OPENAI_BASE_URL environment variable to point to your API endpoint:
export OPENAI_BASE_URL=https://your-openai-api-endpoint.com
You can add this line to your shell profile (.bashrc, .zshrc, etc.) to make it persistent across terminal sessions. If you don’t have an OpenAI API key yet, you can get one by:
  1. Going to OpenAI’s platform
  2. Creating an account or signing in
  3. Navigating to the API keys section
  4. Creating a new API key
That’s it! With these two steps completed, you’re ready to start using Testpilot to generate and run tests for your projects.
I