JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26
  • Score
    100M100P100Q82494F

达笔 AI 命令行工具 - 文生图/图生图/视频生成

Package Exports

  • dabi-cli
  • dabi-cli/dist/src/main.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (dabi-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

dabi-cli

达笔 AI 命令行工具 - 文生图 / 图生图 / 视频生成

安装

npm install -g dabi-cli

配置

# 设置 API Key(必需)
dabi-cli apiKey <你的密钥>

# 设置默认输出目录(可选,默认 ./dabi-ai-output)
dabi-cli config set outputDir D:/output

# 查看配置
dabi-cli config list

快速开始

# 文生图
dabi-cli text2imgBanana -p "一只猫"

# 图生图
dabi-cli img2imgBanana -f photo.png -p "油画风格"

# 文生视频(可灵3)
dabi-cli kling3 -p "日落延时" -u 5

# 文生视频(Seedance)
dabi-cli seedance -p "跳舞" -u 4

# 新建设计会话
dabi-cli newDs

# 上传文件
dabi-cli upload -f photo.png -d <dsCode>

# 查询任务结果
dabi-cli poll -T <taskId>

全局选项

选项 短参 说明 默认值
--format -F 输出格式: text, json json
--query -q jq 表达式,提取 JSON 结果字段 -
--version -V 显示版本号 -
--help -h 显示帮助信息 -

输出格式

默认输出结构化 JSON,加 -F text 切换为带颜色的终端文本。

使用 -q 提取 JSON 中的字段(支持 .key[0][]| 管道):

# 提取单个字段
dabi-cli newDs -q .dsCode
dabi-cli text2imgBanana -p "一只猫" -q ".medias[0].code"

# 遍历数组
dabi-cli getSelectedNodes -d <dsCode> -q ".nodes[].code"

# 管道组合
dabi-cli text2imgBanana -p "一只猫" -q ".medias | .[0].url"

命令一览

命令 说明
text2imgBanana Banana 文生图(模型: bananapro/banana2/banana)
img2imgBanana Banana 图生图(-f/-c 合计最多4个输入)
text2imgGpt GPT 文生图(模型: gpt_2_0)
img2imgGpt GPT 图生图(-f/-c 合计最多4个输入)
kling3 可灵3视频生成(-f/-c 合计最多2张输入)
seedance Seedance 视频生成(参考图最多9张,参考视频最多3个)
newDs 新建设计会话
poll 查询/轮询任务结果
upload 上传文件
getSelectedNodes 获取选中节点
useDs 切换设计会话
config 配置管理
apiKey 快捷设置 API Key

每个命令支持 -h 查看完整参数列表和说明。

异步模式

生成命令(text2imgBanana / img2imgBanana / kling3 / seedance)支持 --async 参数,创建任务后立即返回,不等待结果:

dabi-cli text2imgBanana -p "一只猫" --async

异步模式 JSON 输出:

{
  "command": "text2imgBanana",
  "dsCode": "61598",
  "taskId": "abc123",
  "medias": [],
  "savedTo": null,
  "async": true,
  "message": "任务已异步提交,可登录达笔查看结果"
}

使用 poll 命令查询异步任务结果:

dabi-cli poll -T <taskId>

要求

  • Node.js >= 18.0.0

License

MIT