Introduction¶
When building agents in DeepSeek Harness (DSH), a common requirement is: generating an image based on a description while managing the external image generation gateway’s baseUrl, model name, and API Key. dsh-image-gen is a DSH plugin that converges such calls into commands, conversation triggers, or tool calls. Below is an introduction to its positioning, installation, configuration, and usage boundaries.
What is this¶
dsh-image-gen is hoyyang/dsh-image-gen, positioned as a general-purpose AI image generation plugin for DeepSeek Harness. It interfaces with an OpenAI-compatible image generation gateway (OpenAI Images API shape) and supports generating images from a single sentence.
License: MIT, attribution MIT © 2026 Hoy Yang.
It is suitable for scenarios where DSH agents need to call an external image generation gateway based on a description, while also wishing to have a unified configuration entry point and default security behaviors.
Core Features¶
- Provides the
/dsh-image-gencommand for generating images from a single sentence. - Supports triggering image generation directly via conversation.
- Provides the tool
dsh_image_gen, which can be called manually or via scripting. - Provides
dsh_image_gen_configfor checking configuration. - Interfaces with an OpenAI-compatible image generation gateway; the gateway must conform to the OpenAI Images API shape; gateways returning URLs instead of
b64_jsonare not currently supported. - Supports visual configuration of
baseUrl, model, and API Key via the settings page, taking effect immediately after saving. - Supports configuration methods such as environment variables, profile configuration, and local files.
- Supports
--sizeand--qualityparameters. - Default behavior: keys are stored locally only, output directory permission is 0700, errors are automatically redacted, and logs are not written.
- Generates only one image per call; does not automatically retry on failure.
Installation¶
Execute in an available dsh environment:
dsh plugin --profile web add github:hoyyang/dsh-image-gen
GitHub repository address:
https://github.com/hoyyang/dsh-image-gen
The plugin runs with the permissions of the current dsh process. Before installation, it is recommended to check the source code, license, as well as whether the gateway address, key source, and output directory to be filled in comply with local policies.
Configuration¶
The core fields requiring configuration are: baseUrl, model, and API Key.
Settings Page¶
Find dsh-image-gen in the settings page, fill in the gateway baseUrl, model name, and API Key, and save; it takes effect immediately.
Environment Variables¶
export DSH_IMAGE_BASE_URL="<baseUrl>"
export DSH_IMAGE_MODEL="<model>"
export DSH_IMAGE_API_KEY="<apiKey>"
After changing environment variables, dsh needs to be restarted.
Profile Configuration¶
Supports providing plugin configuration through profile configuration, suitable for scenarios where profile management already exists.
Local Files¶
Suitable for profiles without a UI. The local configuration file permission must be 0600:
cat > ~/.dsh/dsh-image-gen.json <<'EOF'
{
"baseUrl": "<baseUrl>",
"model": "<model>",
"apiKey": "<apiKey>"
}
EOF
chmod 600 ~/.dsh/dsh-image-gen.json
Usage¶
Commands¶
/dsh-image-gen 一只趴在窗台上的橘猫
/dsh-image-gen 一只趴在窗台上的橘猫,午后阳光,油画风格
/dsh-image-gen <描述> [--size=1024x1536] [--quality=high]
Conversation¶
Say directly in the conversation:
帮我生成一张 xx 的图
Tools¶
- Use
dsh_image_gento call manually or via scripting. - Use
dsh_image_gen_configto check configuration.
Behavior Boundaries¶
- The image generation gateway is configured independently and does not affect the DeepSeek Harness chat model routing.
- Generates only one image per call.
- Calls are paid and non-idempotent: after timeout or ambiguous network failures, automatic retry is not performed; manual initiation is required.
- Keys are stored locally only; output directory permission is 0700; errors are automatically redacted, and logs are not written.
- Gateways returning URLs instead of
b64_jsonare not currently supported.
Conclusion¶
The value of dsh-image-gen lies in breaking down the integration of DSH agents with OpenAI-compatible image generation gateways into several entry points: commands, conversations, tools, and configuration checks, while embedding key management, directory permissions, and logging boundaries into default behaviors. GitHub repository: https://github.com/hoyyang/dsh-image-gen.