Skip to content

update plugin cli guide for homebrew installation #38

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added en/SUMMARY.md
Empty file.
Empty file added en/link-check-report.md
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ After completing plugin development, you can package your plugin project as a lo

You'll need the Dify plugin development scaffolding tool for packaging plugins. Download the tool from the [official GitHub releases page](https://github.com/langgenius/dify-plugin-daemon/releases).

See the [Initialize Development Tools](../quick-start/develop-plugins/initialize-development-tools.mdx) tutorial for dependency installation and configuration steps.
See the [Install Development Tools](../quick-start/develop-plugins/initialize-development-tools.mdx) tutorial for dependency installation and configuration steps.

Select and download the version appropriate for your operating system from the release assets.

Expand Down
2 changes: 1 addition & 1 deletion en/plugins/quick-start/develop-plugins/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ title: Develop Plugins

You can quickly understand how to develop different types of plugins and master the functional components involved in plugin development through these development examples:

<Card title="Initialize Development Tools" icon="link" href="/en/plugins/quick-start/develop-plugins/initialize-development-tools">
<Card title="Install Development Tools" icon="link" href="/en/plugins/quick-start/develop-plugins/initialize-development-tools">
</Card>

Using the **Google Search** tool as an example to demonstrate how to develop tool-type plugins. For more details, please take refer to the following:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,52 +1,67 @@
---
title: Initialize Development Tools
title: Install Development Tools
---

Before start to develop Dify plugins, please prepare the following prerequisites:
* [Dify Plugin CLI tool](https://github.com/langgenius/dify-plugin-daemon?tab=readme-ov-file#cli)
* Python 3.12+

Before start to develop Dify plugins please prepare the following prerequisites:
### **1. Install Dify Plugin CLI Tool**

* Dify plugin scaffolding tool
* Python environment, version ≥ 3.12
The Dify Plugin CLI Tool can be installed either with from Homebrew (on Linux and macOS) or with the standalone binary executable file (on Windows, Linux and macOS).

> The Dify plugin development scaffolding tool, also known as `dify-plugin-daemon`, can be regarded as a plugin development SDK.
#### Install with Homebrew

### **1. Installing the Dify Plugin Development Scaffolding Tool**
For the macOS and Linux users, installing Dify Plugin CLI with [Homebrew](https://brew.sh/) is recommended.

Visit the [Dify plugin GitHub page](https://github.com/langgenius/dify-plugin-daemon/releases) and select and download the version suitable for your operating system.
Tap the [Homebrew formula for Dify Plugin CLI tool](https://github.com/langgenius/homebrew-dify), and then install it with `brew install`.

Using **macOS with M-series chips** as an example: Download the `dify-plugin-darwin-arm64` file from the project address mentioned above. Then, in the terminal, navigate to the file's location and grant it execution permissions:
```bash
brew tap langgenius/dify
brew install dify
```

To check the installation, run `dify version` and a version code should be displayed.
```bash
dify version
```
chmod +x dify-plugin-darwin-arm64

To upgrade the Dify Plugin CLI tool, run the following command:

```bash
brew upgrade dify
```

Run the following command to verify successful installation.
#### Install with binary executable

1. Download the binary executable

On the asset list of the release page of [Dify Plugin CLI Tool](https://github.com/langgenius/dify-plugin-daemon/releases), choose and download the binary executable for the OS system (Linux / macOS / Windows) and the chip architecture (`amd64` for x86 chips / `arm64` for ARM or Apple's M chips).

Using **macOS with M chips** as an example. Download the `dify-plugin-darwin-arm64` file and grant it execution permissions by running the command:
```bash
chmod +x ./dify-plugin-darwin-arm64
mv ./dify-plugin-darwin-arm64 ./dify
```
./dify-plugin-darwin-arm64 version

To check the installation, run `./dify version` and a version code should be displayed.
```bash
./dify version
```

> If the system shows an "Apple cannot verify" error, go to **Settings → Privacy & Security → Security**, and click the "Open Anyway" button.

After running the command, the installation is successful, if the terminal returns version information like `v0.0.1-beta.15`.

<Info>
**Tips:**

If you want to use the `dify` command globally in your system to run the scaffolding tool, it's recommended to rename the binary file to `dify` and copy it to the `/usr/local/bin` system path.

After configuration, entering the `dify version` command in the terminal will output the version number.

<img
src="https://assets-docs.dify.ai/2025/01/74e57a57c1ae1cc70f4a45084cbbb37e.png"
className="mx-auto"
alt=""
/>
**Tips:**
To use `dify` command globally system-wide, it's recommended to rename the binary file to `dify` and copy it to the
`/usr/local/bin` system path.
</Info>

### **2. Initialize Python Environment**
### **2. Install Python**

Python version 3.12 or higher is required. For detailed instructions, please refer to the official [Python installation](https://docs.python.org/3.12/using/index.html) guide.

For detailed instructions, please refer to the [Python installation](https://pythontest.com/python/installing-python-3-11/) tutorial. Python version 3.12 or higher is required.

### 3. **Develop plugins**

Expand Down
20 changes: 10 additions & 10 deletions invalid_links_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,11 +373,11 @@
| 163 | extension-plugin.md | extension-plugin |
| 163 | 扩展 Agent 策略 | ../../schema-definition/agent |
| 163 | 扩展 Agent 策略 | ../../schema-definition/agent |
| 164 | 初始化开发工具 | plugins/quick-start/develop-plugins/initialize-development-tools |
| 164 | 安装插件开发工具 | plugins/quick-start/develop-plugins/initialize-development-tools |
| 164 | agent-strategy-plugin.md | agent-strategy-plugin |
| 164 | bundle.md | bundle |
| 165 | Tool 插件 | plugins/quick-start/develop-plugins/tool-plugin |
| 165 | 初始化开发工具 | initialize-development-tools |
| 165 | 安装插件开发工具 | initialize-development-tools |
| 165 | 接口文档 | ../../schema-definition/ |
| 165 | ProviderConfig | ../../schema-definition/general-specifications.md#providerconfig |
| 165 | 工具接口文档 | ../../schema-definition/tool |
Expand All @@ -390,28 +390,28 @@
| 165 | 反向调用 Dify 能力 | ../../schema-definition/reverse-invocation-of-the-dify-service/ |
| 165 | 工具 | ../../schema-definition/tool |
| 165 | 模型 | ../../schema-definition/model/ |
| 165 | 初始化开发工具 | initialize-development-tools |
| 165 | 初始化开发工具 | initialize-development-tools |
| 165 | 安装插件开发工具 | initialize-development-tools |
| 165 | 安装插件开发工具 | initialize-development-tools |
| 165 | 接口文档 | ../../schema-definition/ |
| 165 | Bundle 插件:将多个插件打包 | bundle |
| 165 | Manifest | ../../schema-definition/manifest |
| 165 | Endpoint | ../../schema-definition/endpoint |
| 165 | 反向调用 Dify 能力 | ../../schema-definition/reverse-invocation-of-the-dify-service/ |
| 165 | 工具 | ../../schema-definition/tool |
| 165 | 模型 | ../../schema-definition/model/ |
| 165 | 初始化开发工具 | initialize-development-tools |
| 165 | 安装插件开发工具 | initialize-development-tools |
| 165 | Manifest | ../../schema-definition/manifest |
| 166 | Model 插件 | plugins/quick-start/develop-plugins/model-plugin/README |
| 166 | 创建模型供应商 | create-model-providers |
| 166 | 预定义 | ../../../../guides/model-configuration/predefined-model |
| 166 | 自定义 | customizable-model |
| 166 | 调试插件 | ../../debug-plugins |
| 167 | 创建模型供应商 | plugins/quick-start/develop-plugins/model-plugin/create-model-providers |
| 167 | 初始化开发工具 | ../initialize-development-tools |
| 167 | 安装插件开发工具 | ../initialize-development-tools |
| 167 | 模型接口文档 | ../../../schema-definition/model/model-schema |
| 167 | 接入预定义模型 | ../../../../guides/model-configuration/predefined-model |
| 167 | 接入自定义模型 | ../../../../guides/model-configuration/customizable-model |
| 167 | 初始化开发工具 | ../initialize-development-tools |
| 167 | 安装插件开发工具 | ../initialize-development-tools |
| 168 | 接入预定义模型 | plugins/quick-start/develop-plugins/model-plugin/integrate-the-predefined-model |
| 168 | 模型供应商 | create-model-providers |
| 168 | AIModelEntity | ../../../schema-definition/model/model-designing-rules.md#aimodelentity |
Expand Down Expand Up @@ -546,7 +546,7 @@
| 196 | 发布至个人 GitHub 仓库 | plugins/publish-plugins/publish-plugin-on-personal-github-repo |
| 196 | 打包插件 | broken-reference |
| 197 | 本地发布与分享 | plugins/publish-plugins/package-plugin-file-and-publish |
| 197 | 初始化开发工具 | ../quick-start/develop-plugins/initialize-development-tools |
| 197 | 安装插件开发工具 | ../quick-start/develop-plugins/initialize-development-tools |
| 197 | 远程连接测试 | ../quick-start/develop-plugins/extension-plugin.md#tiao-shi-cha-jian |
| 198 | 常见问题 | plugins/faq |
| 202 | 后端 | development/backend/README |
Expand Down Expand Up @@ -700,7 +700,7 @@
| 122 | 使用全套开源工具构建 LLM 应用实战:在 Dify 调用 Baichuan 开源模型能力 | learn-more/use-cases/practical-implementation-of-building-llm-applications-using-a-full-set-of-open-source-tools |
| 126 | 开发 Slack Bot 插件 | plugins/best-practice/develop-a-slack-bot-plugin |
| 126 | 开发 Slack Bot 插件 | plugins/best-practice/develop-a-slack-bot-plugin |
| 128 | 初始化开发工具 | ../initialize-development-tools |
| 128 | 安装插件开发工具 | ../initialize-development-tools |
| 128 | 快速开始:开发 Extension 插件 | ../extension-plugin |
| 128 | 反向调用:App | ../../../schema-definition/reverse-invocation-of-the-dify-service/app |
| 128 | 开发 Extension 插件 | ../extension-plugin |
Expand Down Expand Up @@ -747,7 +747,7 @@

| 行号 | 链接文本 | 链接 URL |
|------|----------|----------|
| 42 | 初始化开发工具 | ../initialize-development-tools |
| 42 | 安装插件开发工具 | ../initialize-development-tools |
| 64 | 快速开始:开发 Extension 插件 | ../extension-plugin |
| 76 | 反向调用:App | ../../../schema-definition/reverse-invocation-of-the-dify-service/app |
| 316 | 开发 Extension 插件 | ../extension-plugin |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,67 @@
title: 開発環境のセットアップ
---

Difyプラグインの開発を始める前に、以下の前提条件を準備してください:
* [DifyプラグインCLIツール](https://github.com/langgenius/dify-plugin-daemon?tab=readme-ov-file#cli)
* Python 3.12+

Difyプラグインを開発する前に、次の準備を整えましょう。
### **1. DifyプラグインCLIツールのインストール**

* Difyプラグイン用のスキャフォールディングツール
* バージョン3.12以上のPython環境
DifyプラグインCLIツールは、Homebrew(LinuxおよびmacOS用)またはスタンドアロンのバイナリ実行ファイル(Windows、Linux、macOS用)でインストールできます。

### **1. Difyプラグインスキャフォールディングツールのインストール方法**
#### Homebrewでのインストール

> Dify プラグイン開発スキャフォールディングツール、別名 `dify-plugin-daemon` は、プラグイン開発 SDK として見なすことができます
macOSおよびLinuxユーザーには、[Homebrew](https://brew.sh/)を使用してDifyプラグインCLIをインストールすることをお勧めします

[DifyプラグインのGitHubページ](https://github.com/langgenius/dify-plugin-daemon/releases) へアクセスし、ご利用のオペレーティングシステムに適したバージョンをダウンロードしてください。

**Mシリーズチップ搭載のmacOS**向けのダウンロード例:プロジェクトページから`dify-plugin-darwin-arm64`をダウンロードし、ターミナルを開いてファイルのあるディレクトリに移動した後、以下のコマンドで実行権限を付与します:
[DifyプラグインCLIツールのHomebrewフォーミュラ](https://github.com/langgenius/homebrew-dify)をタップし、次に`brew install`でインストールします。

```bash
brew tap langgenius/dify
brew install dify
```
chmod +x dify-plugin-darwin-arm64

インストールを確認するには、`dify version`を実行し、バージョンコードが表示されるはずです。
```bash
dify version
```

インストールが成功したかどうかを確認するには、次のコマンドを実行します
DifyプラグインCLIツールをアップグレードするには、次のコマンドを実行します

```
./dify-plugin-darwin-arm64 version
```bash
brew upgrade dify
```

> システムが「Appleによって検証されていません」と警告を出す場合は、**設定 → セキュリティとプライバシー → セキュリティ**ボタンを開き、「とにかく開く」を選択してください。
#### バイナリ実行ファイルでのインストール

コマンドを実行し、`v0.0.1-beta.15`などのバージョン情報が表示されれば、インストール完了です。

<Info>
**Tips:**
1. バイナリ実行ファイルをダウンロード

`dify`コマンドをシステム全体で利用したい場合は、ダウンロードしたバイナリファイルの名前を`dify`に変更し、`/usr/local/bin`にコピーすることをお勧めします
[DifyプラグインCLIツールのリリースページ](https://github.com/langgenius/dify-plugin-daemon/releases)のアセットリストから、OSシステム(Linux / macOS / Windows)とチップアーキテクチャ(`amd64`はx86チップ用、`arm64`はARMまたはAppleのMチップ用)に適したバイナリ実行ファイルを選択してダウンロードします

この設定を行うと、ターミナルから`dify version`と入力するだけで、インストールされたバージョンを確認できます。
**macOSのMチップ**を例にとると、`dify-plugin-darwin-arm64`ファイルをダウンロードし、次のコマンドを実行して実行権限を付与します:
```bash
chmod +x ./dify-plugin-darwin-arm64
mv ./dify-plugin-darwin-arm64 ./dify
```

<img
src="https://assets-docs.dify.ai/2025/01/74e57a57c1ae1cc70f4a45084cbbb37e.png"
alt=""
/>
</Info>
インストールを確認するには、`./dify version`を実行し、バージョンコードが表示されるはずです。
```bash
./dify version
```

### **2. Initialize Python Environment**
> システムが「Appleは確認できません」と表示する場合は、**設定 → プライバシーとセキュリティ → セキュリティ**に移動し、「今すぐ開く」ボタンをクリックします。

For detailed instructions, please refer to the [Python installation](https://pythontest.com/python/installing-python-3-11/) tutorial, or ask the LLM for complete installation instructions.
<Info>
**ヒント:**
`dify`コマンドをグローバルにシステム全体で使用するには、バイナリファイルの名前を`dify`に変更し、`/usr/local/bin`システムパスにコピーすることを推奨します。
</Info>

### **2. Python環境の設定**
### **2. Pythonのインストール**

Pythonのインストール方法については、[Pythonインストール](https://pythontest.com/python/installing-python-3-11/)チュートリアルを参照するか、LLMに詳細な手順を尋ねてみてください
Python 3.12以上のバージョンが必要です。詳細な手順については、公式の[Pythonインストールガイド](https://docs.python.org/3.12/using/index.html)を参照してください

### **3. プラグインの開発について**
### **3. プラグインの開発**

さまざまなタイプのプラグイン開発の具体例については、以下のリンクをご参照ください
さまざまな種類のプラグイン開発の例については、以下のコンテンツを参照してください

<Card title="tool-plugin.md" icon="link" href="tool-plugin.md">
tool-plugin.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Slack 是一个自由开放的实时办公通信平台,拥有丰富的 API。

### 前置准备

* Dify 插件脚手架工具,详细说明请参考[初始化开发工具](../initialize-development-tools)。
* Dify 插件脚手架工具,详细说明请参考[安装插件开发工具](../initialize-development-tools)。
* Python 环境,版本号 ≥ 3.12,详细说明请参考 [Python 安装教程](https://pythontest.com/python/installing-python-3-11/),或询问 LLM 获取完整的安装教程。
* 创建 Slack App 并获取 OAuth Token

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ title: 打包为本地文件与分享

### 前置准备

* **Dify 插件开发工具**,详细说明请参考[初始化开发工具](../quick-start/develop-plugins/initialize-development-tools)。
* **Dify 插件开发工具**,详细说明请参考[安装插件开发工具](../quick-start/develop-plugins/initialize-development-tools)。

配置完成后,在终端输入 `dify version` 命令,检查是否输出版本号信息以确认已安装必要的开发工具。

Expand Down
2 changes: 1 addition & 1 deletion zh-hans/plugins/quick-start/develop-plugins/README.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: 'Author: Yeuoly, Allen'

你可以通过以下**插件开发示例**,了解如何开发不同类型的插件,快速上手并掌握插件开发过程中可能涉及的功能组件。正式开始插件开发前,需要在本地环境中安装并初始化开发脚手架。请参考以下内容:

<Card title="初始化开发工具" icon="link" href="./initialize-development-tools">
<Card title="安装插件开发工具" icon="link" href="./initialize-development-tools">
initialize-development-tools.md
</Card>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Agent 策略插件能够帮助 LLM 执行推理或决策逻辑,包括工具选
* Dify 插件脚手架工具
* Python 环境,版本号 ≥ 3.12

关于如何准备插件开发的脚手架工具,详细说明请参考[初始化开发工具](initialize-development-tools)。
关于如何准备插件开发的脚手架工具,详细说明请参考[安装插件开发工具](initialize-development-tools)。

<Info>**Tips**:在终端运行 `dify version` 命令,检查是否出现版本号以确认成功安装脚手架工具。</Info>

Expand Down
2 changes: 1 addition & 1 deletion zh-hans/plugins/quick-start/develop-plugins/bundle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Bundle 插件包是多个插件的集合。它可以将多个插件打包在一
* Dify 插件脚手架工具
* Python 环境,版本号 ≥ 3.10

关于如何准备插件开发的脚手架工具,详细说明请参考[初始化开发工具](initialize-development-tools)。
关于如何准备插件开发的脚手架工具,详细说明请参考[安装插件开发工具](initialize-development-tools)。

### 创建 Bundle 项目

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ title: Extension 插件
* Dify 插件脚手架工具
* Python 环境,版本号 ≥ 3.12

关于如何准备插件开发的脚手架工具,详细说明请参考[初始化开发工具](initialize-development-tools)。
关于如何准备插件开发的脚手架工具,详细说明请参考[安装插件开发工具](initialize-development-tools)。

### 创建新项目 <a href="#chuang-jian-xin-xiang-mu" id="chuang-jian-xin-xiang-mu"></a>

Expand Down
Loading