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

# OpenCode

> このガイドでは、Harogoを使ったOpenCodeを数分で使い始める方法を説明します。

インストールの前に、お使いのシステムが次の要件を満たしていることを確認してください。

* **Node.js ≥ 18.0.0**
* お使いのプラットフォーム向けのパッケージマネージャー（任意）：
  * macOS / Linux: `brew`
  * Arch Linux: `paru`
  * Windows: `choco`、`winget`、または`scoop`

## 1. OpenCodeをインストールする

お使いのシステムとツールに合ったインストール方法を選んでください。

### 1. Node.jsでインストールする

```text theme={null}
# curlスクリプトでクイックインストール
curl -fsSL https://opencode.ai/install | bash

# NPMを使う場合
npm install -g opencode-ai

# Bunを使う場合
bun install -g opencode-ai

# PNPMを使う場合
pnpm install -g opencode-ai

# Yarnを使う場合
yarn global add opencode-ai
```

***

### 2. Homebrewを使う（macOS / Linux）

```text theme={null}
brew install sst/tap/opencode
```

***

### 3. Paruを使う（Arch Linux）

```text theme={null}
paru -S opencode-bin
```

***

### 4. Windowsでのインストール

Windowsでは、次のいずれかの方法でOpenCodeをインストールできます。

```text theme={null}
# Chocolatey
choco install opencode

# WinGet
winget install opencode

# Scoop
scoop bucket add extras
scoop install extras/opencode

# またはNPM経由（Node.jsが必要）— 注意：管理者権限が必要です
npm install -g opencode-ai
```

***

## 2. CC SwitchでOpenCodeを設定する

1. CC Switchを起動し、左側でOpenCodeを選択してから「プロバイダーを追加」（Add Provider）をクリックします。

![I Shot 2026 08 07 18 06 55](https://mintcdn.com/harogo-7197ea09/rMeOx--1khpclmo0/images/iShot_2026-08-07_18.06.55.png?fit=max\&auto=format\&n=rMeOx--1khpclmo0\&q=85\&s=880954efc6e217eab4b1904f5498fabb)

2. プリセット一覧から、プロバイダーとして「カスタム設定」（Custom Configuration）を選択します。

![I Shot 2026 08 07 18 07 24](https://mintcdn.com/harogo-7197ea09/rMeOx--1khpclmo0/images/iShot_2026-08-07_18.07.24.png?fit=max\&auto=format\&n=rMeOx--1khpclmo0\&q=85\&s=5501bd2b23e7ec701c72265786e0e8d5)

3. プロバイダーキー、名前、APIキー、エンドポイント（`https://api.harogo.ai/v1`）などを入力します。

![プロバイダー設定フォームの入力画面](https://mintcdn.com/harogo-7197ea09/rMeOx--1khpclmo0/images/iShot_2026-08-07_18.16.46.png?fit=max\&auto=format\&n=rMeOx--1khpclmo0\&q=85\&s=77331925513541de6e85b767c5648124)

4. モデル情報を入力して保存します。

![モデル設定の入力画面](https://mintcdn.com/harogo-7197ea09/rMeOx--1khpclmo0/images/iShot_2026-08-07_18.18.44.png?fit=max\&auto=format\&n=rMeOx--1khpclmo0\&q=85\&s=11e799c6d82a3b52ec8ff82b20574c71)

5. ホーム画面に戻り、プロバイダー一覧から「harogo」を選択して「使用」（Use）をクリックします。

![11](https://mintcdn.com/harogo-7197ea09/rMeOx--1khpclmo0/images/11.png?fit=max\&auto=format\&n=rMeOx--1khpclmo0\&q=85\&s=3803b5b5382d04730ab8aedb549c2fbf)

***

## 3. モデルを使う

### 1. インストールを確認する

次のコマンドで、OpenCodeが正しくインストール・設定されているかを確認できます。

```text theme={null}
opencode
```

![Opencode 3](https://mintcdn.com/harogo-7197ea09/rMeOx--1khpclmo0/images/iShot_2026-08-07_18.21.30.png?fit=max\&auto=format\&n=rMeOx--1khpclmo0\&q=85\&s=b4aeb0326bda3970e3fe16f3cfc807f3)

### 2. モデルを選択する

`/models`と入力して`harogo`を検索し、使いたいモデルを選択します。

![Opencode 4](https://mintcdn.com/harogo-7197ea09/rMeOx--1khpclmo0/images/iShot_2026-08-07_18.22.23.png?fit=max\&auto=format\&n=rMeOx--1khpclmo0\&q=85\&s=72ede75376d54c65f9756960cb0ef0c1)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.