DeepSeek Harness plugin

dsh-tool-image-gen

DSH tool plugin: generate images through ToAPIs async GPT-Image-2 API (submit task, poll, download).

Jump to install

Source facts

Repository
zhangjunjesse/dsh-tool-image-gen
Latest update
Aug 17, 2026
Category
Tools & Capabilities
GitHub stars
0
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/zhangjunjesse/dsh-tool-image-gen
Plugin: dsh-tool-image-gen
Author: zhangjunjesse

Check the source files

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

File explorer3 files
README.mdSource · read only

dsh-tool-image-gen

一个 DeepSeek Harness 图像生成工具插件:对接 ToAPIs 异步图像 API(GPT-Image-2 等),提供两个模型可调用工具:

  • image_gen:文生图 / 图生图。提交任务 → 轮询 → 下载到工作区 generated/,返回本地路径 + 公开 URL。
  • image_upload:把本地图片上传到 ToAPIs,换取公开 URL(可作 image_gen 的参考图)。

特性

  • 异步任务管理POST /v1/images/generations 建任务,轮询 GET /v1/images/generations/{id} 取结果。
  • 本地参考图自动上传image_genreferenceImages 直接接受本地文件路径(自动走上传接口换 URL),也接受公开 URL。
  • 内联预览:结果注册进 DSH 附件系统(超 5MB 自动用 sips 压缩 JPEG),并在文本里附带 Markdown 图片链接。
  • 凭据:key 从环境变量或 ~/.dsh/.credentials.yaml 读取(TOAPIS_API_KEY),永不进对话。
  • 尺寸 1:1/3:2/2:3/4:3/3:4/5:4/4:5/16:9/9:16/2:1/1:2/21:9/9:21,分辨率 1k/2k/4kn 张数。

安装

# 1. 装进 profile
cd ~/.dsh/profiles
npm install dsh-tool-image-gen
# 或者本地开发:npm link dsh-tool-image-gen

# 2. 接线(cordis.patch.yml,本包自带 bundle manifest,dsh plugin add 可自动接线)
# - insert:
#     - id: image-gen
#       name: 'dsh-tool-image-gen'

# 3. 配 key:~/.dsh/.credentials.yaml 里加
# TOAPIS_API_KEY: 你的key
# chmod 600 ~/.dsh/.credentials.yaml

# 4. 重启 dsh

配置

字段默认说明
apiKeyEnvTOAPIS_API_KEY凭据引用名
baseURLhttps://toapis.com/v1API 基址
modelgpt-image-2模型 id(也可用 gpt-image-2-vip、gemini 系列等)
size1:1默认比例
resolution1k默认分辨率
pollIntervalMs / maxAttempts3000 / 60轮询策略
timeoutMs600000协作超时
outputDir<cwd>/generated图片落盘目录

用法

// 文生图
{ "prompt": "赛博朋克城市夜景海报", "size": "16:9", "resolution": "2k" }

// 图生图(本地路径自动上传)
{ "prompt": "把这张图改成水彩画风格", "referenceImages": ["/path/to/photo.png"] }

// 上传换 URL
{ "filePath": "/path/to/photo.png" }

注意

  • ToAPIs 为第三方 API 平台(按量计费),获取 key:https://toapis.com/console/token
  • 上传上限 10MB,支持 jpg/png/webp/gif