Skip to content
Open
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

Large diffs are not rendered by default.

53 changes: 19 additions & 34 deletions en/develop-plugin/dev-guides-and-walkthroughs/cheatsheet.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,19 @@ dimensions:
standard_title: Cheatsheet
language: en
title: Cheatsheet
description: A comprehensive reference guide for Dify plugin development, including
environment requirements, installation methods, development process, plugin categories
and types, common code snippets, and solutions to common issues. Suitable for developers
to quickly consult and reference.
description: A quick reference for Dify plugin development, covering environment setup, installation, the development process, and plugin types
---

## Environment Requirements

- Python version 3.12
- Dify plugin scaffold tool (dify-plugin-daemon)
- Python version 3.12
- Dify plugin scaffold tool (`dify-plugin-daemon`)

> Learn more: [Initializing Development Tools](/en/develop-plugin/getting-started/cli)
For setup instructions, see [Initializing Development Tools](/en/develop-plugin/getting-started/cli).

## Obtain the Dify Plugin Development Package

[Dify Plugin CLI](https://github.com/langgenius/dify-plugin-daemon/releases)
Download the [Dify Plugin CLI](https://github.com/langgenius/dify-plugin-daemon/releases) from the GitHub releases page.

### Installation Methods for Different Platforms

Expand Down Expand Up @@ -71,7 +68,7 @@ dify version

## Run the Development Package

Here we use `dify` as an example. If you are using a local installation method, please replace the command accordingly, for example `./dify-plugin-darwin-arm64 plugin init`.
The following examples use `dify` as the command. If you installed locally, replace the command accordinglyfor example, `./dify-plugin-darwin-arm64 plugin init`.

## Plugin Development Process

Expand All @@ -81,9 +78,9 @@ Here we use `dify` as an example. If you are using a local installation method,
./dify plugin init
```

Follow the prompts to complete the basic plugin information configuration
Follow the prompts to configure the basic plugin information.

> Learn more: [Dify Plugin Development: Hello World Guide](/en/develop-plugin/dev-guides-and-walkthroughs/tool-plugin)
For a full walkthrough, see [Dify Plugin Development: Hello World Guide](/en/develop-plugin/dev-guides-and-walkthroughs/tool-plugin).

### 2. Run in Development Mode

Expand All @@ -93,9 +90,9 @@ Configure the `.env` file, then run the following command in the plugin director
python -m main
```

> Learn more: [Remote Debugging Plugins](/en/develop-plugin/features-and-specs/plugin-types/remote-debug-a-plugin)
For debugging details, see [Remote Debugging Plugins](/en/develop-plugin/features-and-specs/plugin-types/remote-debug-a-plugin).

### 3. Packaging and Deployment
### 3. Package and Deploy

Package the plugin:

Expand All @@ -104,13 +101,13 @@ cd ..
dify plugin package ./yourapp
```

> Learn more: [Publishing Overview](/en/develop-plugin/publishing/marketplace-listing/release-overview)
For publishing details, see the [Publishing Overview](/en/develop-plugin/publishing/marketplace-listing/release-overview).

## Plugin Categories

### Tool Labels

Category `tag` [class ToolLabelEnum(Enum)](https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/entities/tool.py)
Category tags are defined in [`ToolLabelEnum`](https://github.com/langgenius/dify-plugin-sdks/blob/main/python/dify_plugin/entities/tool.py):

```python
class ToolLabelEnum(Enum):
Expand All @@ -134,25 +131,14 @@ class ToolLabelEnum(Enum):

## Plugin Type Reference

Dify supports the development of various types of plugins:
Dify supports several plugin types:

- **Tool plugin**: Integrate third-party APIs and services
> Learn more: [Dify Plugin Development: Hello World Guide](/en/develop-plugin/dev-guides-and-walkthroughs/tool-plugin)

- **Model plugin**: Integrate AI models
> Learn more: [Model Plugin](/en/develop-plugin/features-and-specs/plugin-types/model-designing-rules), [Quick Integration of a New Model](/en/develop-plugin/dev-guides-and-walkthroughs/creating-new-model-provider)

- **Agent strategy plugin**: Customize Agent thinking and decision-making strategies
> Learn more: [Agent Strategy Plugin](/en/develop-plugin/features-and-specs/advanced-development/reverse-invocation)

- **Extension plugin**: Extend Dify platform functionality, such as Endpoints and WebAPP
> Learn more: [Extension Plugin](/en/develop-plugin/dev-guides-and-walkthroughs/endpoint)

- **Data source plugin**: Serve as the document data source and starting point for knowledge pipelines
> Learn more: [Data Source Plugin](/en/develop-plugin/dev-guides-and-walkthroughs/datasource-plugin)

- **Trigger plugin**: Automatically trigger Workflow execution upon third-party events
> Learn more: [Trigger Plugin](/en/develop-plugin/dev-guides-and-walkthroughs/trigger-plugin)
- **Tool plugin**: Integrate third-party APIs and services. See [Dify Plugin Development: Hello World Guide](/en/develop-plugin/dev-guides-and-walkthroughs/tool-plugin).
- **Model plugin**: Integrate AI models. See [Model Plugin](/en/develop-plugin/features-and-specs/plugin-types/model-designing-rules) and [Quick Integration of a New Model](/en/develop-plugin/dev-guides-and-walkthroughs/creating-new-model-provider).
- **Agent strategy plugin**: Customize Agent thinking and decision-making strategies. See [Agent Strategy Plugin](/en/develop-plugin/features-and-specs/advanced-development/reverse-invocation).
- **Extension plugin**: Extend Dify platform functionality, such as Endpoints and WebApp. See [Extension Plugin](/en/develop-plugin/dev-guides-and-walkthroughs/endpoint).
- **Data source plugin**: Serve as the document data source and starting point for knowledge pipelines. See [Data Source Plugin](/en/develop-plugin/dev-guides-and-walkthroughs/datasource-plugin).
- **Trigger plugin**: Automatically trigger workflow execution on third-party events. See [Trigger Plugin](/en/develop-plugin/dev-guides-and-walkthroughs/trigger-plugin).

{/*
Contributing Section
Expand All @@ -163,4 +149,3 @@ It will be automatically generated by the script.
---

[Edit this page](https://github.com/langgenius/dify-docs/edit/main/en/develop-plugin/dev-guides-and-walkthroughs/cheatsheet.mdx) | [Report an issue](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)

Loading
Loading