DeepSeek Harness 插件

dsh-imagegen-songlair

Codex-style image_gen and grok-build /imagine for DeepSeek Harness. OpenAI-compatible images/generations.(英文原文)

跳到安装方式

来源信息

GitHub 仓库
songlairui/dsh-imagegen
最近更新
2026年8月15日
分类
工具与能力
GitHub stars
0
载体类型
plugin
目录证据
上游声明已找到 dsh.bundle
证据路径
package.json#dsh.bundle
核对版本
0.1.0-rc.8
上游核对日期
2026-08-20

该证据由上游目录提供。本站没有安装、运行或安全审核这个插件。

安装

默认先复制一段 Prompt,让 Agent 读 GitHub 仓库和源码;需要自己装时再切到命令。

复制这段 Prompt,发给 DSH、Codex 或其他 Agent,让它先读 GitHub 仓库和源码。

请先不要安装或执行任何命令。阅读这个插件的 GitHub 仓库、README 和关键源码,然后用清楚、直接的方式回答以下问题,帮助我判断它是否适合我的需求:

1. 这个插件是什么,解决什么问题;
2. 适合哪些用户和典型使用场景;
3. 安装后如何使用,并给出一个最小使用示例;
4. 有哪些已知限制,以及隐私、安全、兼容性或维护风险;
5. 给出“推荐 / 有条件推荐 / 不推荐”的明确建议和理由。

请区分仓库明确说明、根据源码推断和未知信息。证据不足时请明确说明,不要猜测或照抄 README。

GitHub:https://github.com/songlairui/dsh-imagegen
插件名:dsh-imagegen-songlair
作者:songlairui

检查来源文件

安装前先看这个插件目录里的 README 和其他文件。

文件资源管理器3 个文件
README.md来源说明 · 只读预览

dsh-imagegen

Codex-style image_gen and grok-build /imagine for DeepSeek Harness.

DeepSeek chat-completions is text-only, and DSH does not ship a native text-to-image API. This bundle registers:

SurfaceMirrorsBehavior
Model tool image_genCodex built-in image_genThe agent draws on request; files land in the workspace
Slash command /imagine <prompt>grok-build /imagineGenerates immediately, no model turn

The backend is OpenAI-compatible POST {baseURL}/images/generations. Shipped defaults target xAI:

  • https://api.x.ai/v1
  • credential name XAI_API_KEY
  • model grok-imagine-image-quality

Any compatible gateway works (OpenAI, OpenRouter, a local proxy). Override baseURL, apiKeyEnv, and model in the profile patch. Never put the API key in the patch file.

Install

dsh plugin --profile web add https://github.com/songlairui/dsh-imagegen/archive/refs/tags/v0.1.0.tar.gz

Restart the running dsh web process. dsh --profile web --dump-config should include a # == dsh-imagegen layer.

Store the key in DSH credentials (Settings → Models) under XAI_API_KEY, or export XAI_API_KEY / OPENAI_API_KEY.

Use

> Use image_gen to draw a shiba in sunglasses as a 35mm film still, save as shiba.png

or:

/imagine a shiba in sunglasses, film still, 35mm

Outputs:

  • workspace generated_images/<name>.png
  • $DSH_HOME/generated_images/<name>.png

If the current route declares image input (for example a grok-4 vision model), the tool result also carries a durable DSH image block so the picture can render inline.

Configuration

A profile patch replaces the whole config object. Restate every field you care about in $DSH_HOME/profiles/web/cordis.patch.yml:

- id: imagegen
  name: dsh-imagegen
  config:
    baseURL: https://api.x.ai/v1
    apiKeyEnv: XAI_API_KEY
    model: grok-imagine-image-quality
    timeoutMs: 180000
    outputDir: generated_images

OpenAI Images:

    baseURL: https://api.openai.com/v1
    apiKeyEnv: OPENAI_API_KEY
    model: gpt-image-2

Any other OpenAI-compatible images/generations endpoint: set baseURL to that origin plus /v1, and apiKeyEnv to the credential name you stored in DSH.

Tool parameters

image_gen(prompt, file_name?, model?, size?, quality?, reference_image?)

  • prompt required
  • file_name e.g. hero.png
  • model overrides the default
  • size 1024x1024 / 1536x1024 / 2K / auto
  • quality gpt-image only: low / medium / high / auto
  • reference_image local path, data URL, or https URL

Key resolution

1. ctx.credentials.resolve(apiKeyEnv) 2. Environment variables XAI_API_KEY / OPENAI_API_KEY / OPENROUTER_API_KEY 3. A non-expired xAI key in ~/.grok/auth.json (grok CLI cache), if present