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

# difyctl のインストール

> ワンライナースクリプトまたは手動でのバイナリダウンロードによる difyctl のインストール

> このドキュメントは AI によって自動翻訳されています。不正確な部分がある場合は、[英語版](/en/cloud/cli/install.md) を参照してください。

`difyctl` はランタイム依存のない単体のバイナリです。インストールスクリプトがお使いのプラットフォームを検出し、Dify の GitHub Releases から対応するビルドをダウンロードして、チェックサムを検証し、バイナリを配置します。

> [!NOTE]
>
> `difyctl` は Dify 1.15.0 で導入されました。各ビルドは特定の Dify バージョンに対応しているため、お使いのサーバーに合うものをインストールしてください（下記の `DIFY_VERSION` を参照）。

## インストール

**1. インストーラーの実行**

**macOS / Linux**

サポートするプラットフォーム：macOS と Linux、x64 と arm64。

```bash theme={null}
curl -fsSL https://raw.githubusercontent.com/langgenius/dify/main/cli/scripts/install-cli.sh | DIFY_VERSION=1.17.1 sh
```

スクリプトは `~/.local/bin/difyctl` にインストールし、そのディレクトリが `PATH` に含まれていない場合は通知します。

**Windows**

サポートするプラットフォーム：x64。

```powershell theme={null}
$env:DIFY_VERSION = "1.17.1"
irm https://raw.githubusercontent.com/langgenius/dify/main/cli/scripts/install.ps1 | iex
```

スクリプトは `%LOCALAPPDATA%\difyctl\bin\difyctl.exe` にインストールし、そのディレクトリがまだ `PATH` にない場合は、`PATH` に追加するコマンドを表示します。

**手動ダウンロード**

1. [Dify の GitHub Releases](https://github.com/langgenius/dify/releases) から、サーバーの Dify バージョンに合うリリースを選び、2 つのアセットをダウンロードします：

   * お使いのプラットフォーム向けのバイナリ（`difyctl-v<version>-<os>-<arch>`）
   * チェックサムマニフェスト（`difyctl-v<version>-checksums.txt`）

2. バイナリの SHA-256 ハッシュを計算し、checksums ファイル内の対応するエントリと比較します。

   値が一致しない場合、ダウンロードは破損しているか改ざんされています。削除して再度ダウンロードしてください。

   ```bash macOS / Linux theme={null}
   shasum -a 256 difyctl-v<version>-<os>-<arch>
   ```

   ```powershell Windows theme={null}
   Get-FileHash difyctl-v<version>-windows-x64.exe
   ```

3. バイナリを `PATH` に配置します：

   ```bash macOS / Linux theme={null}
   chmod +x difyctl-v<version>-<os>-<arch>
   mv difyctl-v<version>-<os>-<arch> ~/.local/bin/difyctl
   ```

   ```powershell Windows theme={null}
   New-Item -ItemType Directory -Force "$env:LOCALAPPDATA\difyctl\bin" | Out-Null
   Move-Item difyctl-v<version>-windows-x64.exe "$env:LOCALAPPDATA\difyctl\bin\difyctl.exe"
   ```

> [!TIP]
>
> インストールをカスタマイズするには、インストールコマンドに次の環境変数を設定します。
>
> | 変数 | 説明 | 例 |
> | - | - | - |
> | `DIFY_VERSION` | `difyctl` を取得する Dify リリースタグ。[Dify Releases](https://github.com/langgenius/dify/releases) のタグと一致させる。 既定は最新リリース。サーバーが最新でない場合は、そのリリースタグを指定する。 | `1.16.1` |
> | `DIFYCTL_VERSION` | 特定の `difyctl` ビルドに固定する。`DIFY_VERSION` が未設定のときのみ使用される。 | `0.2.0-alpha` |
> | `DIFYCTL_PREFIX` | インストール先ディレクトリ（既定は `~/.local`）。バイナリは `<prefix>/bin` に配置される。 | `/usr/local` |
>
> 例：
>
> ```bash macOS / Linux theme={null}
> curl -fsSL https://raw.githubusercontent.com/langgenius/dify/main/cli/scripts/install-cli.sh | DIFY_VERSION=1.16.1 sh
> ```
>
> ```powershell Windows theme={null}
> # PowerShell にインライン形式はなく、設定はそのセッションの間ずっと有効です
> $env:DIFY_VERSION = "1.16.1"
> irm https://raw.githubusercontent.com/langgenius/dify/main/cli/scripts/install.ps1 | iex
> ```

**2. インストールの確認**

```bash theme={null}
difyctl version
```

バージョンとプラットフォームを含む `Client:` ブロックが表示されるはずです。

代わりに `command not found` が表示される場合、インストールディレクトリが `PATH` に含まれていません。次のように追加します：

```bash macOS / Linux theme={null}
# add to ~/.zshrc or ~/.bashrc; running it inline only lasts until the session ends
export PATH="$HOME/.local/bin:$PATH"
```

```powershell Windows theme={null}
[Environment]::SetEnvironmentVariable('PATH', "$env:LOCALAPPDATA\difyctl\bin;$env:PATH", 'User')
```

## アップデート

`difyctl` をアップデートするには、上記のインストールコマンドを再実行します。既存のバイナリがそのまま置き換わります。

## アンインストール

```bash macOS / Linux theme={null}
rm ~/.local/bin/difyctl
```

```powershell Windows theme={null}
Remove-Item -Recurse "$env:LOCALAPPDATA\difyctl"
```

アンインストール前にサインアウトするには、[`difyctl auth logout`](/ja/cloud/cli/reference/auth-and-contexts#サインアウト) を実行します。

## 次のステップ

`difyctl` をインストールしたら、[クイックスタート](/ja/cloud/cli/quick-start.md) に進んでサインインし、最初のアプリを実行します。


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