DeepSeek Harness plugin

dsh-image-gen-haimuhai

DeepSeek Harness plugin: generate images via Aliyun Bailian Qwen-Image (bl CLI). Saves a conversation attachment, writes the file to ~/.dsh/image-gen/ and auto-opens it in the system viewer.

Jump to install

Source facts

Repository
haimuhaimu/dsh-image-gen
Latest update
Aug 20, 2026
Category
Models & Providers
GitHub stars
1
Format
plugin
Catalog evidence
Upstream dsh.bundle evidence
Evidence path
package.json#dsh.bundle
Checked against
0.1.0-rc.8
Upstream check date
2026-08-20

This evidence comes from the upstream catalog. This site has not installed, run, or security-reviewed the plugin.

Install

Start with a prompt that asks an agent to review the GitHub repository and source. Switch to the command if you want to install it yourself.

Copy this prompt into DSH, Codex, or another agent and ask it to review the GitHub repository and source first.

Do not install or run any commands yet. Read this plugin's GitHub repository, README, and relevant source code. Then answer the questions below clearly and directly so I can decide whether it fits my needs:

1. What is this plugin, and what problem does it solve?
2. Who is it for, and what are its typical use cases?
3. How is it used after installation? Include one minimal example.
4. What known limitations or privacy, security, compatibility, or maintenance risks does it have?
5. Give a clear recommendation: recommend, conditionally recommend, or do not recommend, with reasons.

Distinguish statements documented by the repository, inferences from source code, and unknowns. If evidence is insufficient, say so explicitly. Do not guess or simply repeat the README.

GitHub: https://github.com/haimuhaimu/dsh-image-gen
Plugin: dsh-image-gen-haimuhai
Author: haimuhaimu

Check the source files

Read the README and other files from this plugin directory before installing.

File explorer2 files
README.mdSource · read only

dsh-image-gen

DeepSeek Harness 图片生成插件:通过阿里云百炼(Qwen-Image)为 DSH agent 提供图片生成能力。

为 agent 注册一个 generate_image 工具:给定文字描述,调用百炼文生图服务生成图片, 并把图片作为对话附件返回(模型可在后续步骤查看)。同时把图片写入 ~/.dsh/image-gen/自动用系统看图器弹出,保证"生成即看到"。

> 关于"对话流内联缩略图":DSH Web UI 目前只把人手上传的图片渲染成可点击缩略图, > 工具/插件返回的图片只显示为工具行文本(产品限制,非本插件问题)。 > 因此本插件用"自动弹出看图器"作为最可靠的即时预览方式;配置 autoOpen: false 可关闭。

> 起因:DSH 官方目前没有内置图片生成工具("完全没办法生成图片"是现状)。 > 本插件用百炼 CLI(bl)作为后端,是官方推荐的生态贡献方式(dsh-plugin topic)。

前置条件

1. 安装 阿里云百炼 CLInpm install -g bailian-cli)并登录: ``sh bl auth login --config token-plan --api-key <your-api-key> bl auth status # 确认已登录 ` 2. 确认能出图: `sh bl image generate --prompt "a cat" --out-dir ./out ``

安装

dsh plugin --profile <name> add github:haimuhaimu/dsh-image-gen

GitHub 安装时 pnpm 会拦截 prepare 脚本(本插件无构建,脚本仅打印提示); 如被拦截,按报错提示把包键加入 profile 的 pnpm-workspace.yamlallowBuilds,再重新 add。

也可以本地安装:

dsh plugin --profile <name> add ./image-gen

使用

装好后 agent 会自动获得 generate_image 工具,直接对 DSH 说"生成一张……的图片"即可。 工具参数:

参数必填说明
prompt图片描述(越详细越好:主体、风格、构图、光线)
size尺寸:比例 3:4 / 16:9 / 1:1 或像素 1024*10242048*2048;默认 1024*1024
model模型:默认 qwen-image-3.0;可选 wan2.6-t2iz-image-turbo
n生成数量(1-6),默认 1
negative_prompt排除的元素
seed随机种子,可复现结果
watermark是否保留水印,默认 false

配置

cordis.patch.ymlconfig 块:

- id: image-gen
  name: dsh-image-gen
  config:
    blPath: ""      # bl CLI 路径;留空自动查找 PATH 与常见安装位置
    autoOpen: true  # 生成后自动用系统看图器弹出(默认 true)

生成的图片持久保存在 ~/.dsh/image-gen/,可随时手动查看。

实现说明

  • 工具注册:ctx.tools.register(defineTool({...}))@deepseek-ai/dsh-tools
  • 图片保存:ctx.attachments.saveImage()@deepseek-ai/dsh-attachment),返回 ImageAttachmentRef
  • 输出:output.render 返回 [{ type: 'image', attachment: ref }, { type: 'text', ... }]
  • 执行:spawn bl image generate --output json,解析 saved 路径,读回字节存为附件
  • 取消/超时:监听 exec.signal 与 10 分钟超时

参考