Skip to main content

VS Code Agent

Overview

VS Code includes an agent mode (powered by GitHub Copilot) that automatically performs code changes and executes Prisma CLI commands based on your prompts.

Capabilities

The Prisma VS Code extension enables support for VS Code agent mode.

VS Code agent mode can perform the following tasks:

  • Check migration status (e.g. Flag unapplied migrations)
  • Create and apply schema migrations automatically
  • Sign in to the Prisma Data Platform
  • Provision Prisma Postgres instances, letting you start coding right away

How to enable and use the VS Code agent

The latest version of the Prisma VS Code extension fully supports agent mode. Since extensions update automatically, no manual action is required to enable it.

note

We recommend you to use the latest version of Prisma ORM.

To use the agent mode:

  1. Open GitHub Copilot Chat in VS Code and switch to Agent mode.
  2. With GitHub Copilot Chat open and the Prisma extension updated, you can simply type a request such as: "Create a new database for me and add the connection string to the .env file".
  3. The agent will request permission to make changes in your workspace.
  4. It automatically handles login to your Prisma Data Platform account before proceeding.
  5. Upon approval, the agent creates the new database and adds the connection string to your .env file.
  6. You can also use agent mode to run migrations, generate the Prisma Client, and perform other tasks.
note

Currently, the agent mode uses your default workspace in the Prisma Data Platform.

Querying Prisma docs from VS Code using GitHub Copilot

Complementing the agent, the Prisma Copilot extension allows you to query Prisma documentation directly within VS Code.

You need to install the Prisma for Copilot extension from the GitHub marketplace.

Then, switch to Ask mode in GitHub Copilot Chat and type your question using the @prisma-for-github-copilot namespace.

For more details, refer to our GitHub Copilot documentation.