> ## Documentation Index
> Fetch the complete documentation index at: https://dify-6c0370d8-docs-new-agent-experience.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# チートシート

> 環境設定、インストール、開発プロセス、プラグインタイプを扱う、Dify プラグイン開発のクイックリファレンスです

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

## 環境要件

* Python バージョン 3.12
* Dify プラグインスキャフォールドツール（`dify-plugin-daemon`）

セットアップ手順については、[開発ツールの初期化](/ja/develop-plugin/getting-started/cli) を参照してください。

## Dify プラグイン開発パッケージの取得

GitHub releases ページから [Dify Plugin CLI](https://github.com/langgenius/dify-plugin-daemon/releases) をダウンロードします。

### 各プラットフォームのインストール方法

**macOS [Brew](https://github.com/langgenius/homebrew-dify)（グローバルインストール）**：

```bash theme={null}
brew tap langgenius/dify
brew install dify
```

インストール後、新しいターミナルウィンドウを開き、`dify version` コマンドを入力してください。バージョン情報が出力されれば、インストールは成功です。

**macOS ARM（M シリーズチップ）**：

```bash theme={null}
# Download dify-plugin-darwin-arm64
chmod +x dify-plugin-darwin-arm64
./dify-plugin-darwin-arm64 version
```

**macOS Intel**：

```bash theme={null}
# Download dify-plugin-darwin-amd64
chmod +x dify-plugin-darwin-amd64
./dify-plugin-darwin-amd64 version
```

**Linux**：

```bash theme={null}
# Download dify-plugin-linux-amd64
chmod +x dify-plugin-linux-amd64
./dify-plugin-linux-amd64 version
```

**グローバルインストール（推奨）**：

```bash theme={null}
# Rename and move to system path
# Example (macOS ARM)
mv dify-plugin-darwin-arm64 dify
sudo mv dify /usr/local/bin/
dify version
```

## 開発パッケージの実行

以下の例ではコマンドとして `dify` を使用します。ローカルインストールの場合は、コマンドを適宜置き換えてください。例：`./dify-plugin-darwin-arm64 plugin init`。

## プラグイン開発プロセス

### 1. 新しいプラグインの作成

```bash theme={null}
./dify plugin init
```

プロンプトに従って、基本的なプラグイン情報を設定してください。

詳しい手順については、[Dify プラグイン開発：Hello World ガイド](/ja/develop-plugin/dev-guides-and-walkthroughs/tool-plugin) を参照してください。

### 2. 開発モードで実行

`.env` ファイルを設定し、プラグインディレクトリで以下のコマンドを実行します：

```bash theme={null}
python -m main
```

デバッグの詳細については、[プラグインのリモートデバッグ](/ja/develop-plugin/features-and-specs/plugin-types/remote-debug-a-plugin) を参照してください。

### 3. パッケージングとデプロイ

プラグインをパッケージ化します：

```bash theme={null}
cd ..
dify plugin package ./yourapp
```

公開の詳細については、[公開の概要](/ja/develop-plugin/publishing/marketplace-listing/release-overview) を参照してください。

## プラグインカテゴリ

### ツールラベル

カテゴリタグは [`ToolLabelEnum`](https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/entities/tool.py) で定義されています：

```python theme={null}
class ToolLabelEnum(Enum):
    SEARCH = "search"
    IMAGE = "image"
    VIDEOS = "videos"
    WEATHER = "weather"
    FINANCE = "finance"
    DESIGN = "design"
    TRAVEL = "travel"
    SOCIAL = "social"
    NEWS = "news"
    MEDICAL = "medical"
    PRODUCTIVITY = "productivity"
    EDUCATION = "education"
    BUSINESS = "business"
    ENTERTAINMENT = "entertainment"
    UTILITIES = "utilities"
    OTHER = "other"
```

## プラグインタイプリファレンス

Dify は複数のプラグインタイプをサポートしています：

* **ツールプラグイン**：サードパーティの API とサービスを統合します。[Dify プラグイン開発：Hello World ガイド](/ja/develop-plugin/dev-guides-and-walkthroughs/tool-plugin) を参照してください。
* **モデルプラグイン**：AI モデルを統合します。[モデルプラグイン](/ja/develop-plugin/features-and-specs/plugin-types/model-designing-rules) および [新しいモデルのクイック統合](/ja/develop-plugin/dev-guides-and-walkthroughs/creating-new-model-provider) を参照してください。
* **エージェント戦略プラグイン**：Agent の思考と意思決定戦略をカスタマイズします。[エージェント戦略プラグイン](/ja/develop-plugin/features-and-specs/advanced-development/reverse-invocation) を参照してください。
* **拡張プラグイン**：Endpoints や WebApp など、Dify プラットフォームの機能を拡張します。[拡張プラグイン](/ja/develop-plugin/dev-guides-and-walkthroughs/endpoint) を参照してください。
* **データソースプラグイン**：ナレッジパイプラインのドキュメントデータソースおよび開始点として機能します。[データソースプラグイン](/ja/develop-plugin/dev-guides-and-walkthroughs/datasource-plugin) を参照してください。
* **トリガープラグイン**：サードパーティのイベントに基づいてワークフローの実行を自動的にトリガーします。[トリガープラグイン](/ja/develop-plugin/dev-guides-and-walkthroughs/trigger-plugin) を参照してください。
