xuan25/dsh-imagegen ↗★ 0

dsh-imagegen

Image generation plugin for dsh: a single imagegen tool (generate/providers/models/status verbs) over OpenAI-compatible image backends, configured via IMAGEGEN_* env or the dsh-imagegen: settings section 适合需要在DSH会话中直接调用外部API进行画图的用户。

Package
dsh-imagegen
Compatibility
Unverified
Harness peer range
>=0.1.0-rc.6
Cordis peer range
>=4.0.2
Version
0.1.0
Last updated
Oct 13, 2026

Other repositories with this package name

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:xuan25/dsh-imagegen

Configuration

Providers are configured in any of four layers, lowest to highest priority; the providers verb reports the originating layer of every field, so a shadowed value is never silent:

  1. the built-in default (api: openai-compatible),
  2. the IMAGEGEN_* env contract (static per process boot),
  3. the cordis config layer (a patch entry with id dsh-imagegen and a config object, or profile-level patches),
  4. the dsh-imagegen: section in the user settings document ($DSH_HOME/settings.yaml), which the plugin re-reads on every call, so settings edits apply without a restart.
dsh-imagegen:
  defaultProvider: local
  providers:
    local:
      baseURL: http://:
/v1
    hosted:
      baseURL: https://api.example.com/v1
      apiKeyEnv: IMAGEGEN_HOSTED_KEY
      models: [flux-1]
      displayName: Hosted Images

The env contract mirrors the config fields 1:1: IMAGEGEN_DEFAULT_PROVIDER, and per route the variables `IMAGEGEN_PROVIDER__BASEURL`, `IMAGEGEN_PROVIDER__API`, `IMAGEGEN_PROVIDER__APIKEYENV`, `IMAGEGEN_PROVIDER__HEADERS`, `IMAGEGEN_PROVIDER__MODELS`, `IMAGEGEN_PROVIDER__DISPLAYNAME`. The segment is the route name uppercased with - written as _. The headers value is a JSON object string, and the models value is a comma-separated list of model ids. The baseURL value is the OpenAI-compatible base URL including the /v1 prefix (the same shape as an LLM provider base URL); the plugin appends /images/generations and /models to it verbatim, and the image contract has no server-root endpoints. The apiKeyEnv value is a reference to an environment variable name, never a secret in config; per request the value resolves from the process environment, then from $DSH_HOME/.credentials.yaml.