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

# Windows サポート

> ブループリントとセッションで Windows 上で Devin を利用します。

Devin は、ビルドおよびセッションのプラットフォームとして Windows をサポートしています。Windows 環境では Linux と同じ bash シェル (Git Bash) を利用するため、ほとんどのブループリントのコマンドは両方のプラットフォームでそのまま動作します。

<Warning>
  Windows サポートは現在、限定提供です。Devin で Windows を試してみたい場合は、詳細の確認とアクセス権の取得について、[お問い合わせ](https://cognition.com/contact)ください。
</Warning>

<div id="how-it-works">
  ## 仕組み
</div>

Windows サポートは、Linux と同じ[宣言的構成](/ja/onboard-devin/environment/blueprints)システムに基づいています。主な違いはブループリントの `runs-on` フィールドで、ここで Devin がどのプラットフォームでビルドと実行を行うかを指定します。

どちらのプラットフォームでも bash を利用するため、Linux と Windows で同じシェルコマンドを記述できます。主な違いは、ファイルシステムの構成と利用可能なパッケージマネージャーです。

| 項目          | Linux (デフォルト)         | Windows                                    |
| ----------- | --------------------- | ------------------------------------------ |
| ホームディレクトリ   | `/home/ubuntu`        | `/c/Users/Administrator`                   |
| リポジトリディレクトリ | `~/repos/<repo-name>` | `/c/Users/Administrator/repos/<repo-name>` |
| パッケージマネージャー | `apt-get`             | `choco`、または直接インストーラーの利用                    |

<div id="writing-windows-blueprints">
  ## Windows 用ブループリントの作成
</div>

<div id="single-platform-blueprint">
  ### 単一プラットフォーム用ブループリント
</div>

リポジトリが Windows のみを対象とする場合は、トップレベルで `runs-on: windows` を利用します。

```yaml theme={null}
runs-on: windows

initialize:
  - name: "Install Node.js"
    uses: github.com/actions/setup-node@v4
    with:
      node-version: "20"

  - name: "Install build tools"
    run: |
      choco install visualstudio2022buildtools -y
      choco install python --version=3.12 -y

maintenance: |
  npm install

knowledge:
  - name: lint
    contents: npm run lint
  - name: test
    contents: npm test
  - name: build
    contents: npm run build
```

<div id="multi-platform-blueprint">
  ### マルチプラットフォームのブループリント
</div>

同じリポジトリを Linux と Windows の両方でビルドするには、各プラットフォームを `---` で区切られた個別の YAML ドキュメントとして記述します。各ドキュメントで、それぞれ独自の `runs-on` ラベルを指定します。この形式の背景については、ブループリントガイドの [Multi-document YAML](/ja/onboard-devin/environment/blueprints#blueprint-sections) のコールアウトを参照してください。

```yaml theme={null}
runs-on: default
initialize: |
  curl -LsSf https://astral.sh/uv/install.sh | sh
  apt-get update && apt-get install -y build-essential

maintenance: |
  uv sync

knowledge:
  - name: test
    contents: uv run pytest

---
runs-on: windows
initialize: |
  choco install python --version=3.12 -y

maintenance: |
  uv sync

knowledge:
  - name: test
    contents: uv run pytest
```

各ドキュメントごとに、そのプラットフォーム用の個別のスナップショットのビルドが生成されます。セッションはプラットフォーム固有のスナップショットから起動します。

<Warning>
  最上位の YAML は、シーケンスではなくマッピングである必要があります。上記の例を単一のリスト (`- runs-on: default` / `- runs-on: windows`) として記述すると、バックエンドで `Invalid YAML: each YAML document must be a mapping, not a sequence; use '---' to separate multiple blocks` として拒否されます。上記の `---` 区切りを利用してください。
</Warning>

<div id="the-runs-on-field">
  ## `runs-on` フィールド
</div>

`runs-on` フィールドは、アカウントに登録されているマシン構成に対応します。

| Value                | Platform               |
| -------------------- | ---------------------- |
| `default` or `linux` | Linux (デフォルトのプラットフォーム) |
| `windows`            | Windows                |

`runs-on` は、文字列またはリストで指定できます。

```yaml theme={null}
# 単一プラットフォーム
runs-on: windows

# 1つのブロックに複数のプラットフォームを指定（同じコマンドが各プラットフォームで実行される）
runs-on: [default, windows]
```

ブロックに複数のプラットフォームが列挙されている場合、ビルドシステムは同じコマンドを使って、各プラットフォームごとに1つのスナップショットを作成します。

<Warning>
  リスト構文では、リスト内のすべてのプラットフォームで同一のコマンドが実行されます。コマンドが真にクロスプラットフォーム対応である場合にのみ利用してください (例: `npm install`、`uv sync`) 。プラットフォーム固有のコマンド (Linux の `apt-get` や Windows の `choco` など) には、代わりに [マルチドキュメント形式](#multi-platform-blueprint) を利用してください。プラットフォームごとに1つのドキュメントを使用し、`---` で区切ります。
</Warning>

<div id="usage-and-cost">
  ## 使用量とコスト
</div>

Windows セッションでは、同等の Linux セッションと比べて、使用量 (ACU または利用枠) を約 **9%多く** 消費します。使用量の計測方法について詳しくは、[使用量](/ja/admin/billing/usage#windows-sessions)を参照してください。

<div id="windows-session-behavior">
  ## Windows セッションの動作
</div>

<div id="shell">
  ### Shell
</div>

Windowsセッションでは、デフォルトのシェルとして **Git Bash** を使用します。これは Linux で使われているものと同じ bash シェルです。標準的な bash 構文は、どちらのプラットフォームでもそのまま使えます。

```yaml theme={null}
- run: |
    export MY_VAR="hello"
    echo $MY_VAR
```

<div id="paths">
  ### パス
</div>

Windows では Git Bash のパス形式 (`C:\...` ではなく `/c/...`) を使用します:

```yaml theme={null}
# Linuxのパス
- run: cp config.json ~/.config/myapp/config.json

# Windowsのパス（Git Bash形式）
- run: cp config.json /c/Users/Administrator/.config/myapp/config.json
```

<div id="secrets">
  ### シークレット
</div>

セッション中は、標準的な bash 構文 (`$SECRET_NAME`) でシークレットを環境変数として利用できます。

```yaml theme={null}
maintenance:
  - name: "Configure registry"
    run: |
      npm config set //registry.npmjs.org/:_authToken $NPM_TOKEN
```

<div id="file-attachments">
  ### 添付ファイル
</div>

Windows では、アップロードされたファイルは `/home/ubuntu/.files/` ではなく、`/c/Users/Administrator/.files/` に書き込まれます。

<div id="computer-use">
  ### Computer Use
</div>

[Computer Use](/ja/work-with-devin/computer-use) は、Windows セッションで完全にサポートされています。Devin は、Chrome、マウス、キーボードを利用できる Windows デスクトップ環境を備えているため、Web アプリに加え、Windows ネイティブのデスクトップアプリケーション (例: WPF や WinForms アプリ) もテストし、そのテスト セッションを記録できます。

<div id="blueprint-tips-for-windows">
  ## Windows 用ブループリントのヒント
</div>

<div id="installing-tools">
  ### ツールのインストール
</div>

`choco` (Chocolatey) または直接ダウンロード用のスクリプトを利用します:

```yaml theme={null}
initialize:
  - name: "Install Chocolatey packages"
    run: |
      choco install git -y
      choco install nodejs-lts -y
      choco install python --version=3.12 -y
      choco install dotnet-sdk -y
```

<div id="common-patterns">
  ### よくあるパターン
</div>

**.NET プロジェクト:**

```yaml theme={null}
runs-on: windows

initialize:
  - name: "Install .NET SDK"
    run: |
      choco install dotnet-sdk -y

maintenance: |
  dotnet restore

knowledge:
  - name: build
    contents: dotnet build
  - name: test
    contents: dotnet test
  - name: lint
    contents: dotnet format --verify-no-changes
```

**Visual Studio / C++ プロジェクト:**

```yaml theme={null}
runs-on: windows

initialize:
  - name: "Install Visual Studio Build Tools"
    run: |
      choco install visualstudio2022buildtools -y
      choco install visualstudio2022-workload-vctools -y

maintenance: |
  msbuild /t:Restore MySolution.sln

knowledge:
  - name: build
    contents: msbuild MySolution.sln /p:Configuration=Release
  - name: test
    contents: vstest.console.exe bin/Release/Tests.dll
```
