> ## Documentation Index
> Fetch the complete documentation index at: https://docs.testdriver.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Install the TestDriver VS Code Extension

> Comprehensive guide to installing and setting up TestDriver for VS Code

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/dell_2tI6nc" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

The TestDriver VS Code extension is a powerful tool that integrates TestDriver's AI-driven test generation capabilities directly into your development environment:

* Get started with example scripts for different platforms
* Get syntax highlighting and autocompletion for [TestDriver YAML](/getting-started/editing)
* Chat with the TestDriver agent to generate tests based on your requirements
* Save and manage your tests directly within your project
* Run and debug tests directly from the IDE
* View test results and logs within the IDE

<Tip>
  The TestDriver VS Code Extension is currently in beta. If you encounter any
  issues or have feedback, please let us know [in
  Discord](https://discord.com/invite/cWDFW8DzPm)
</Tip>

<Steps>
  <Step title="Install the VS Code Extension">
    Click the button below to install the TestDriver extension for your preferred IDE. Then, follow the setup guide and chat with TestDriver to create your first test.

    <Card horizontal title="VS Code" arrow href="vscode:extension/testdriver.testdriver" icon="https://mintcdn.com/testdriver/XQpwml52qitCoxm7/images/content/extension/vscode.svg?fit=max&auto=format&n=XQpwml52qitCoxm7&q=85&s=26e6b26485e2ac68553c6a680ef1833e" width="100" height="100" data-path="images/content/extension/vscode.svg" />

    <Card horizontal title="Cursor" arrow href="cursor:extension/testdriver.testdriver" icon="https://mintcdn.com/testdriver/XQpwml52qitCoxm7/images/content/extension/cursor.svg?fit=max&auto=format&n=XQpwml52qitCoxm7&q=85&s=744e97c0a46199abff18be9ab0e77225" width="36" height="36" data-path="images/content/extension/cursor.svg" />

    <Card horizontal title="Windsurf" arrow href="windsurf:extension/testdriver.testdriver" icon="https://mintcdn.com/testdriver/XQpwml52qitCoxm7/images/content/extension/windsurf.svg?fit=max&auto=format&n=XQpwml52qitCoxm7&q=85&s=7e5a987d38320cbe35cc7a3dd860274c" width="1024" height="1024" data-path="images/content/extension/windsurf.svg" />
  </Step>

  <Step title="Set Your TestDriver API Key">
    After installing the extension, you'll need to set your TestDriver API key in the extension settings.

    1. Open the command palette (Cmd+Shift+P or Ctrl+Shift+P).
    2. Search for "Preferences: Open Settings (UI)" and select it.
    3. In the search bar, type "TestDriver" to filter the settings.
    4. Find the "TestDriver: Set API Key" field and enter your API key from [the TestDriver dashboard](https://app.testdriver.ai/team).

    <Tip>You can also set the `TD_API_KEY` environment variable in your system if you prefer not to enter it directly in the extension settings.</Tip>
  </Step>

  <Step title="Choose a Platform">
    Click on the TestDriver icon in the sidebar to open the extension panel and choose a platform to get started (Web, Desktop, or Mobile).
  </Step>

  <Step title="Create Your First Test">
    Now chat with the TestDriver agent to create your first test! Describe what you want to test, and the agent will generate the test steps for you.
  </Step>

  <Step title="Run your test">
    Run your test by clicking the "Run" button in the extension panel. You can view the test results and logs directly within VS Code's Test Explorer. [Learn more about running tests in VS Code](https://code.visualstudio.com/docs/debugtest/testing).
  </Step>
</Steps>

***

**Pro Tip:** Always start with interactive mode (`testdriverai`) to explore and refine your tests before saving them. It's faster and more intuitive!
