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

drama-cli

v0.1.3

Published

Drama Studio AIGC CLI for login and image/video generation

Readme

drama CLI

Drama Studio 官方 AIGC 命令行工具:登录、文生图/参考图生图、Seedance 全能参考生视频。

独立于主项目的小包(非 pnpm workspace),依赖单独安装,对主项目零侵入。

安装与构建

cd cli
pnpm install
pnpm build          # 产出 dist/index.js(可执行)
pnpm link --global  # 可选:全局注册 `drama` 命令

开发期直接跑源码:pnpm dev -- <command>(等价于 tsx src/index.ts <command>)。

快速开始

# 1. 登录(Device Flow:自动打开浏览器,在已登录的页面里点 Approve)
drama login                                    # 默认连线上 https://www.kvread.com
drama login --base_url http://localhost:3000   # 本地联调

# 2. 文生图 / 参考图生图(提交后打印 task_id 即退出)
drama generate_image --prompt "a cat portrait" --ratio 1:1
drama generate_image --prompt "same cat, cyberpunk style" --ref ./cat.png

# 3. Seedance 全能参考生视频(文生视频 / 图片视频音频参考)
drama generate_video --prompt "the cat walks in the rain" --duration 8
drama generate_video --prompt "animate this" --ref ./cat.png --ref ./bgm.mp3 --ratio 9:16

# 4. 查询结果 / 下载产物(唯一取结果入口)
drama query_result --task_id <id>
drama query_result --task_id <id> --wait --download_path ./out

# 5. 退出登录
drama logout

命令

| 命令 | 说明 | | --- | --- | | login [--base_url <url>] [--headless] | OAuth Device Flow 登录,凭证存 ~/.drama-cli/credentials.json | | logout | 清除本地登录态 | | generate_image | 提交后打印 task_id 即退出;--prompt(必填)--ref <file_or_url...> --model(默认 seedream-5-lite)--ratio --resolution | | generate_video | 提交后打印 task_id 即退出;--prompt(必填)--ref <file_or_url...> --model seedance\|seedance-fast --ratio --resolution --duration 4\|8\|12(强制生成音频) | | query_result | 查结果的唯一入口;--task_id <id>(必填)--wait 轮询到终态 --download_path <dir> 完成时下载产物到该目录 |

服务地址优先级:--base_url > 环境变量 DRAMA_BASE_URL > 登录时保存的地址 > 线上 https://www.kvread.com

登录原理

  1. CLI 调 POST /api/cli/device-codedevice_code / user_code,打印并自动打开 verification_uri
  2. 用户在已登录的浏览器打开 /cli-auth?user_code=... 页面点击 Approve,服务端把该用户 token 绑定到设备码(不依赖 Java 后端可达)。
  3. CLI 轮询 POST /api/cli/token 兑换 token,落盘本地后所有请求带 Authorization 头。

生成链路

与 web 生成页完全同一条链路,任务会进入 /generate/image/generate/video 的历史列表:

  1. 参考素材(本地文件或 URL)经 Java GET /server/oss/getSignatureByUser 签名后 PostObject 直传用户 OSS 空间,content 里传 ossPath 对象键。
  2. POST /server/ai-gen/submit 提交任务(taskType 1=视频 2=图片),拿 taskId
  3. POST /server/ai-gen/status 轮询到终态(1=pending 2=running 3=completed 4=failed 5=timeout),从 result.imageList / result.videoList 取产物 URL 下载。