npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-dashscope-imagegen

v0.1.3

Published

OpenCode plugin that adds an image_generate tool for text-to-image generation with Alibaba DashScope models (qwen-image-2.0, qwen-image-3.0, wan2.7-image)

Readme

opencode-dashscope-imagegen

Text-to-image generation for OpenCode via Alibaba DashScopeqwen-image-2.0, qwen-image-3.0 and wan2.7-image exposed as an image_generate tool your coding agent can call.

npm version npm downloads license OpenCode plugin

Example output: generated with qwen-image-2.0

Highlights

  • Adds a single image_generate tool to any OpenCode agent — no extra server, no MCP setup.
  • Uses the native DashScope multimodal-generation endpoint (the OpenAI-compatible /v1/images/generations route is not served by DashScope).
  • Saves the PNG to disk and returns the absolute path, so vision models (qwen3-vl-plus, kimi-k3, …) can inspect the result via normal image attachments.
  • Works with any DashScope text-to-image model, including the Wan series (wan2.7-image).

Supported models

| Model | Notes | | -------------------------- | ---------------------------------- | | qwen-image-2.0 (default) | fast general-purpose text-to-image | | qwen-image-3.0 | newer Qwen-Image generation | | wan2.7-image | Wan (Tongyi Wanxiang) image models |

Prerequisites

  • OpenCode installed.
  • A DashScope API key from Alibaba Cloud Model Studio (Bailian console). Key resolution order:
    1. DASHSCOPE_IMAGEGEN_API_KEY env
    2. DASHSCOPE_API_KEY env
    3. apiKey of any dashscope* provider in your opencode.json

Installation

Add the npm package name to your opencode.json — OpenCode installs it on next launch:

{
  "plugin": ["opencode-dashscope-imagegen"]
}

Developing locally

To run from a checkout instead of npm, reference the plugin directory and install its dependencies once (@opencode-ai/plugin must resolve from the plugin's own directory):

{
  "plugin": ["file:///path/to/opencode-dashscope-imagegen"]
}
npm install
npm run build   # tsc → dist/ (js + d.ts)

Usage

Just ask your agent: "generate an image of a lighthouse at dusk" — it will call the tool:

| Arg | Default | Description | | ------------- | ---------------- | --------------------------------------------------------- | | prompt | required | image description | | model | qwen-image-2.0 | any DashScope text-to-image model | | size | 1024*1024 | W*H with a star, e.g. 1280*720 | | output_path | auto | absolute path; default <config>/gen-images/gen-<ts>.png |

Output directory override: DASHSCOPE_IMAGEGEN_DIR env.

Troubleshooting

  • InvalidApiKey / 401 — no key found; check the resolution order above.
  • Tool not appearing — restart OpenCode after editing opencode.json; plugins load at startup.
  • size rejected — use W*H with * (star), not x: 1024*1024.
  • Model not supported — the key's account must have the model enabled in Model Studio.

Related

License

MIT