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

# VS Code with GRID Containers

> Develop inside GRID containers with VS Code

VS Code provides a polished editing experience for GRID development. Once containers are running, you can attach directly to `grid_core`, browse notebooks, and develop Python code against the same environment that Jupyter uses.

***

## Quick Start

The fastest way to attach VS Code to your GRID container:

```bash theme={null}
open code @local
```

This command launches VS Code and attaches it to the `grid_core` container automatically.

<Note>
  Requires VS Code with the **Dev Containers** extension installed and the `code` CLI available in your PATH.
</Note>

***

## Manual Attachment

If the `open code` command isn't available or you prefer manual control:

<Steps>
  <Step title="Ensure Containers Are Running">
    Start your containers if not already running:

    ```bash theme={null}
    init airgen @local
    ```
  </Step>

  <Step title="Open Command Palette">
    In VS Code, press `F1` (or `⌘⇧P` / `Ctrl+Shift+P`).
  </Step>

  <Step title="Attach to Container">
    Run **Dev Containers: Attach to Running Container…** and select `grid_core`.
  </Step>

  <Step title="Open Workspace">
    VS Code opens a new window attached to the container. The default folder is `/workspace`, containing:

    * `sample_notebooks/` — Sample Jupyter notebooks
    * Mounted volumes (e.g., `/workspace/datasets`)
    * Session logs and artifacts
  </Step>
</Steps>

<Note>
  The first attachment installs the VS Code server inside the container, which takes a few seconds.
</Note>

***

## Working in the Container

Once attached:

* **Browse files** using the Explorer sidebar
* **Open notebooks** (`.ipynb`) or Python scripts
* **Run terminals** (`Terminal > New Terminal`) for CLI commands, Git, or Python
* **Debug code** using the Python extension's breakpoint support

VS Code inherits all dependencies from `grid_core`, so packages, CUDA binaries, and environment variables match your GRID sessions.

***

## Remote SSH + Container

When working on a remote VM (e.g., [Managed GRID](./managed)):

1. Connect to the VM via **Remote-SSH**
2. From the remote VS Code window, run `open code @local` in the terminal
3. Or use **Dev Containers: Attach to Running Container…** to manually attach

The workflow is identical—VS Code handles the nested remote connection automatically.

***

## Detaching

When finished:

* Close the VS Code window attached to `grid_core`
* The container keeps running until you terminate it via the CLI

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Hello GRID Tutorial" icon="rocket" href="../hello-grid">
    Complete hands-on tutorial combining CLI and development workflows.
  </Card>

  <Card title="CLI Reference" icon="terminal" href="./cli">
    Full command reference for the GRID CLI.
  </Card>
</CardGroup>
