lsjspl/dsh-plugin-grok2api-media-tool

使dsh通过grok2api的API获得图片与视频生成能力(generate_image / generate_video)。

Project Overview项目介绍

This is a native plugin built exclusively for DeepSeek Harness (DSH), that enables DSH agents to leverage grok2api services for three core media-related capabilities: text-to-image generation, text-to-video generation, and image recognition. It also adds a dedicated image upload button to the DSH chat input bar, making it easier to upload local images for recognition by the plugin. The plugin supports two different grok2api backends: the Go-based chenyme/grok2api (default) and the older Python-based aurora-develop/grok2api, and users can select their preferred backend via plugin configuration. To install the plugin, users can run either dsh plugin --profile web add dsh-plugin-grok2api-media-tool to install from npm, or the GitHub variant if preferred, then restart dsh web for the changes to take effect.

This plugin is designed for all DSH users who need to access Grok's multi-modal capabilities to generate media or analyze images directly within DSH conversations. Users do not need to do anything extra to trigger the plugin after installation; simply state your request in a DSH conversation, such as “generate a cyberpunk city night scene” or “what is in this image”, and the plugin will be called automatically. Generated images are displayed as embedded cards in the conversation, videos can be played directly within the chat window, and image recognition results are returned as plain text. Even for plain-text main models like DeepSeek that do not natively support image attachments, users can use the upload button to insert an image path for Grok recognition.

The plugin requires users to self-host a grok2api service, and supports multiple configuration methods to connect to the service. Users can directly configure the plugin via conversation prompts, reuse an existing configured Grok provider from DSH's settings, or manually edit the ~/.dsh/settings.yaml file. For DSH rc.7 and newer, there is also a graphical configuration form that lets users select providers and models for each capability, and changes take effect immediately without restart. There are a few limitations to note: the plugin does not support streaming images or partial previews, video generation requires waiting for completion, and saved media files do not appear in DSH's Produced list. By default, generated media is saved to the generated subdirectory of the session workspace.

这是一个专门为 DeepSeek Harness(DSH)开发的原生插件,作用是让 DSH 智能体通过 grok2api 服务实现文生图、文生视频以及图片识别功能。它还为聊天输入框添加了图片上传按钮,方便上传图片供识别。插件支持两种 grok2api 后端,分别是 Go 版 chenyme/grok2api 和旧 Python 版 aurora-develop/grok2api,用户可配置选择。可通过 DSH 命令行从 npm 或 GitHub 直接安装,安装后重启 dsh web 即可生效。

面向使用 DSH 的开发者和普通用户,满足需要调用 Grok 多模态能力生成媒体、识别图片的需求。用户在 DSH 对话中直接提出生成图片、视频或识别图片的需求即可触发插件调用,比如输入“帮我生成一张赛博朋克城市夜景图”或“分析这张图片里有什么”。生成的图片会以内嵌卡片展示,视频可直接在对话中播放,识别结果以普通文本返回。针对不支持原生图片附件的纯文本主模型,也可通过上传按钮插入图片路径调用 Grok 识图。

本插件依赖用户自行部署 grok2api 服务,可复用 DSH 中已配置的 Grok 提供商信息,也可手动填写服务地址和密钥。配置方式有三种:对话直接配置、复用已有提供商、手工编辑配置文件,dsh rc.7+ 还支持图形化配置表单。使用存在部分限制:不支持流式图片和部分预览,视频生成需等待完成,保存到工作区的文件不会进入 DSH 产物列表。默认将生成的媒体保存到工作区的 generated 子目录。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 2 warnings2 项注意
  • No license declared - all rights reserved by default; ask the author before commercial use or redistribution未声明开源许可证 —— 默认「保留所有权利」,商用或再分发前先问作者
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add dsh-plugin-grok2api-media-tool

把 lsjspl/dsh-plugin-grok2api-media-tool 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-plugin-grok2api-media-tool

一个 dsh(DeepSeek Harness) 插件,让智能体通过 grok2api 生成图片/视频,并用 Grok 最新语言模型识别图片。当用户提出「画一张图」「做一个视频」「分析这张图片」等需求时,模型会调用插件提供的工具并返回可查看的结果。

功能

工具 说明
generate_image 文生图:返回图片 URL,并可将图片保存到当前会话工作区
generate_video 文生视频:创建异步任务并等待完成,返回视频 URL,并可保存到工作区
recognize_image 识图:把本地图片、data URL 或图片 URL 发给 Grok 最新语言模型(默认自动选最新,可配置如 grok-4.6),返回模型对图片的描述/回答
图片路径上传入口 聊天输入框左侧的 🖼️ 按钮:选择图片后上传到 dsh 本地,并把返回的本地路径插入输入框,供模型调用 recognize_image。纯文本主模型(如 DeepSeek)也能用——它收到的是文本路径,再由插件调 Grok 识图,不依赖主模型支持图片附件
路径识图 模型拿到图片路径后调用 recognize_image,由 Grok 最新语言模型进行多模态识别

支持两种 grok2api 后端(通过 apiFlavor 选择):

安装

dsh plugin --profile web add dsh-plugin-grok2api-media-tool              # 从 npm(推荐)
dsh plugin --profile web add github:lsjspl/dsh-plugin-grok2api-media-tool   # 或从 GitHub

安装后重启 dsh web 生效。本地 tarball 等其他安装方式见 DISTRIBUTE.md。

配置

插件配置保存在 ~/.dsh/settings.yaml 的 grok2api-media-tool: 节,以下三种方式任选其一,效果相同,保存后即时生效(无需重启)。

方式 1:直接对话配置

在对话里直接提出即可,模型会调用 configure_grok2api 工具写入并生效:

  • 「grok2api 复用 llm-pi-ai 里配好的 grok 提供商」
  • 「把 grok2api 地址配成 http://192.168.1.100:8000,密钥 sk-xxx」
  • 「生成的图片不要保存到工作区」

方式 2:复用已配置的 LLM 提供商

如果已在 dsh 的「模型」设置里配好 grok 提供商,插件可以直接复用它(地址、密钥、模型均取自该提供商),无需重复填写:

grok2api-media-tool:
  apiSource: llm-provider
  llmProvider: grok   # llm-pi-ai.providers 下的键名(全局默认 provider)

三个用途(image / video / vision)还可以各自指定不同的 provider,例如识图用另一个 provider 的模型:

grok2api-media-tool:
  apiSource: llm-provider
  llmProvider: grok          # 全局默认
  vision:
    provider: grok-chat      # 识图改用 grok-chat 的模型,留空则回退到 grok

方式 3:手工编辑配置文件

编辑 ~/.dsh/settings.yaml(Windows 为 %USERPROFILE%\.dsh\settings.yaml):

grok2api-media-tool:
  baseUrl: http://192.168.1.100:8000
  apiKey: sk-xxx
  apiFlavor: chenyme

说明:dsh rc.7+ 在设置页开放了插件命名空间,本插件提供图形化配置表单(设置 → Plugins → 配置 → Grok2API Media Tool):可选 provider、各用途模型从 provider 的模型目录下拉选择(每用途可单独覆盖 provider),各超时也可调。表单改动保存后即时写入 settings.yaml。也可继续使用以上三种方式配置。

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-plugin-muapi 下一个 Next dsh-tool-browser →