-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/langgenius/dify-plugin-daemon/cmd/commandline/cmd" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var ( | ||
pluginInitCommand = &cobra.Command{ | ||
Use: "init", | ||
Short: "Init", | ||
Long: "Init", | ||
Run: func(c *cobra.Command, args []string) { | ||
cmd.InitPlugin() | ||
}, | ||
} | ||
|
||
pluginPermissionCommand = &cobra.Command{ | ||
Use: "permission", | ||
Short: "Permission", | ||
Long: `Permission, available values: | ||
tools - allow plugin to call tools | ||
models - allow plugin to call models | ||
models.llm - allow plugin to call llm | ||
models.text_embedding - allow plugin to call text_embedding model | ||
models.rerank - allow plugin to call rerank model | ||
models.tts - allow plugin to call tts | ||
models.speech2text - allow plugin to call speech2text | ||
models.moderation - allow plugin to call moderation | ||
apps - allow plugin to call apps | ||
storage - allow plugin to use storage | ||
endpoint - allow plugin to register endpoint`, | ||
} | ||
|
||
pluginPermissionAddCommand = &cobra.Command{ | ||
Use: "add", | ||
Short: "Add permission to plugin", | ||
Long: "Add permission to plugin, you can find the available permission by running `dify plugin permission`", | ||
} | ||
|
||
pluginPermissionDropCommand = &cobra.Command{ | ||
Use: "drop", | ||
Short: "Drop permission from plugin", | ||
Long: "Drop permission from plugin, you can find the available permission by running `dify plugin permission`", | ||
} | ||
) | ||
|
||
func init() { | ||
pluginCommand.AddCommand(pluginInitCommand) | ||
pluginCommand.AddCommand(pluginPermissionCommand) | ||
pluginPermissionCommand.AddCommand(pluginPermissionAddCommand) | ||
pluginPermissionCommand.AddCommand(pluginPermissionDropCommand) | ||
} |