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

# Get started with Astro for VS Code

> Install Astro for VS Code in VS Code or Cursor, sign in to Astro, and ask Otto your first question.

<Info>
  **Labs**

  This feature is in [Labs](/docs/astro/feature-previews).
</Info>

This quickstart shows you how to install Astro for VS Code, sign in to Astro, and ask Otto your first question. When you finish, the Deployments in your Workspace appear in the editor's sidebar and Otto runs in your project.

## Prerequisites

* An Astro account. To create one, [start a trial](/docs/astro/trial).
* The [Astro CLI](/docs/cli/v1.46/install-cli).
* VS Code 1.95 or later, or Cursor.
* (Optional) An [Astro project](/docs/cli/v1.46/develop-project) open in your editor. The Deployments and Docs views work without one, but Otto and the Local view need a project to work with.

## Install and start using the extension

<Steps>
  <Step title="Install the extension">
    <Tabs>
      <Tab title="VS Code">
        1. Open the **Extensions** view.
        2. Search for **Astro for VS Code**, published by **Astronomer**.
        3. Click **Install**.

        You can also install the extension from the [Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=astronomer.astronomer-vscode).
      </Tab>

      <Tab title="Cursor">
        Cursor installs extensions from the Open VSX registry.

        1. Open the **Extensions** view.
        2. Search for **Astro for VS Code**, published by **Astronomer**.
        3. Click **Install**.

        You can also download the extension from [Open VSX](https://open-vsx.org/extension/Astronomer/astronomer-vscode).
      </Tab>
    </Tabs>

    An **Astro** icon appears in the activity bar. Click it to open the **Profile**, **Deployments**, **Local**, and **Docs** views.
  </Step>

  <Step title="Sign in to Astro">
    If you already ran `astro login` in a terminal, the extension uses that session, and the **Profile** view shows your account. Continue to the next step.

    Otherwise:

    1. In the **Profile** view, click **Log in to Astro**. You can also run **Log In to Astro** from the Command Palette.
    2. Sign in to Astro in the browser window that opens.
    3. Return to the editor. The **Profile** view shows your account, environment, Organization, and Workspace.

    <Tip>
      If the extension reports that it can't find `astro`, your editor didn't inherit your shell's `PATH`. This happens when you start the editor from the Dock, Finder, or Start menu. Run `which astro` in a terminal, then set the `astroOtto.astroPath` setting to the path it prints. See [Troubleshoot Astro for VS Code](/docs/astro/vscode/vscode-troubleshooting#the-extension-cant-find-the-astro-cli).
    </Tip>
  </Step>

  <Step title="Choose your Organization and Workspace">
    The **Deployments** view lists the Deployments in the Workspace that the **Profile** view shows.

    To switch, click the **Organization** or **Workspace** row in the **Profile** view, then choose from the list. The extension switches with the Astro CLI, so the change also applies to `astro` commands that you run in a terminal.
  </Step>

  <Step title="Ask Otto your first question">
    1. Open the chat. Click the Otto icon in the **Deployments** view's title bar or in the editor toolbar, or run **Open Otto Chat** from the Command Palette.

       The chat opens as an editor tab next to your files. The first time you open it, the extension installs Otto with the Astro CLI, which can take a minute.

    2. Enter a question in the message box and press **Enter**. For example:

       ```text theme={null}
       Look at my Dags and summarize each one.
       ```

       Otto reads your Dag files and answers in the chat.
  </Step>
</Steps>

## Other prompts to try

* `Why did my last Dag run fail?` Otto reads the Dag run history and task logs of your local Airflow environment to find the cause.
* `Add retries to every task in this Dag.` Otto shows each file edit as a diff and asks for your approval before it applies the edit.

## Next steps

* [Chat with Otto in VS Code](/docs/astro/vscode/vscode-otto-chat)
* [Triage Deployments in VS Code](/docs/astro/vscode/vscode-deployments)
* [Run Airflow locally in VS Code](/docs/astro/vscode/vscode-local-airflow)
