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

# Dify プラグイン開発チートシート

> 環境要件、インストール方法、開発プロセス、プラグインのカテゴリとタイプ、一般的なコードスニペット、よくある問題の解決策を含む、Dify プラグイン開発の包括的なリファレンスガイドです。開発者が素早く参照できるように設計されています。

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

### 環境要件

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

> 詳細: [開発ツールの初期化](/ja/develop-plugin/getting-started/cli)

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

[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)

### プラグインカテゴリ

#### ツールラベル

カテゴリ `tag` [class ToolLabelEnum(Enum)](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)

* **エージェント戦略プラグイン**: エージェントの思考と意思決定戦略をカスタマイズ
  > 詳細: [エージェント戦略プラグイン](/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)

***

[このページを編集](https://github.com/langgenius/dify-docs/edit/main/en/develop-plugin/dev-guides-and-walkthroughs/cheatsheet.mdx) | [問題を報告](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
