JSPM

cut_cli

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 48
  • Score
    100M100P100Q58034F
  • License MIT

CapCut 草稿 API + CLI 工具 — 用代码创建剪映标准草稿,支持字幕/图片/视频/音频/特效/贴纸/关键帧/遮罩

Package Exports

  • cut_cli
  • cut_cli/dist/index.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 (cut_cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

cut_cli

CapCut / 剪映草稿 SDK + CLI 工具。用代码创建剪映标准草稿,可直接被剪映桌面端打开。

  • Node.js SDK + CLI 双模式
  • 支持字幕、图片、视频、音频、特效、贴纸、关键帧、遮罩
  • 媒体 URL 自动下载到草稿目录
  • 出入场动画、转场效果、关键词高亮
  • 一键集成 OpenClaw / Cursor / Claude Code

安装

npm install -g cut_cli

或直接通过 npx 运行(无需安装):

npx cut_cli draft create

快速上手

CLI

# 创建草稿
cut draft create --width 1080 --height 1920

# 添加字幕
cut captions add <draftId> --captions '[
  {"text":"你好世界","start":0,"end":3000000}
]' --font-size 8 --bold

# 添加图片
cut images add <draftId> --image-infos '[
  {"imageUrl":"https://example.com/bg.jpg","width":1920,"height":1080,"start":0,"end":5000000}
]'

# 添加背景音乐
cut audios add <draftId> --audio-infos '[
  {"audioUrl":"https://example.com/bgm.mp3","duration":5000000,"start":0,"end":5000000}
]'

Node.js SDK

import { createDraft, addCaptions, addImages, addAudios } from 'cut_cli';

const draft = await createDraft({ width: 1080, height: 1920 });

await addCaptions({
  draftId: draft.draftId,
  captions: [{ text: '第一句话', start: 0, end: 3000000 }],
  fontSize: 8,
  bold: true,
});

AI 工具集成

一键将 cut_cli 集成到你常用的 AI 编程工具:

# OpenClaw(龙虾)
cut setup openclaw

# Cursor
cut setup cursor

# Claude Code
cut setup claude

# 全部安装
cut setup all

安装后,AI 助手即可在对话中直接使用剪映草稿能力。

文档

文档 说明
CLI 命令参考 所有命令行命令的完整用法
API 参考 Node.js SDK 所有方法的接口文档
完整文档 草稿存储、时间单位、JSON 参数等详细说明

时间单位

所有时间参数使用 微秒(μs)1秒 = 1,000,000

License

MIT