> ## 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`）

配置说明详见 [初始化开发工具](/zh/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 指南](/zh/develop-plugin/dev-guides-and-walkthroughs/tool-plugin)。

### 2. 以开发模式运行

配置 `.env` 文件，然后在插件目录中运行以下命令：

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

调试细节详见 [远程调试插件](/zh/develop-plugin/features-and-specs/plugin-types/remote-debug-a-plugin)。

### 3. 打包和部署

打包插件：

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

发布细节详见 [发布概览](/zh/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 指南](/zh/develop-plugin/dev-guides-and-walkthroughs/tool-plugin)。
* **模型插件**：集成 AI 模型。详见 [模型插件](/zh/develop-plugin/features-and-specs/plugin-types/model-designing-rules) 和 [快速集成新模型](/zh/develop-plugin/dev-guides-and-walkthroughs/creating-new-model-provider)。
* **Agent 策略插件**：自定义 Agent 思考和决策策略。详见 [Agent 策略插件](/zh/develop-plugin/features-and-specs/advanced-development/reverse-invocation)。
* **扩展插件**：扩展 Dify 平台功能，如 Endpoints 和 WebApp。详见 [扩展插件](/zh/develop-plugin/dev-guides-and-walkthroughs/endpoint)。
* **数据源插件**：作为知识流水线的文档数据源和起点。详见 [数据源插件](/zh/develop-plugin/dev-guides-and-walkthroughs/datasource-plugin)。
* **触发器插件**：在第三方事件发生时自动触发工作流执行。详见 [触发器插件](/zh/develop-plugin/dev-guides-and-walkthroughs/trigger-plugin)。
