Package Exports
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 (beervid-app-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
beervid-app-cli
BEERVID 第三方应用 Open API 的 TypeScript CLI 和 Claude Code Skill,提供 TikTok 视频发布、账号授权、数据查询等完整能力。
安装与调用
全局安装
npm install -g beervid-app-cli
beervid --helpnpx 免安装调用
npx beervid-app-cli --help
npx beervid-app-cli config --show
npx beervid-app-cli upload --file ./video.mp4node 直接调用
# 克隆仓库后先构建
npm install && npm run build
# 通过 node 运行入口文件
node dist/cli.mjs --help
node dist/cli.mjs config --show在 Claude Code / Codex / Antigravity 中使用
如果你希望在 Claude Code、Codex 等支持 Skill 的工具中直接调用本项目,除了通过 npm 安装 CLI 之外,还需要把 Skill 相关文件复制到你自己的 skills 目录下。
需要复制的内容:
SKILL.mdreferences/docs/example/
建议在你的 skills 目录中保持如下结构:
beervid-app-cli/
SKILL.md
references/
docs/
example/这样工具在加载 SKILL.md 时,才能继续访问本项目附带的 API 参考、落地文档和示例工程。
配置
# 方式一:通过 config 命令持久化(推荐)
beervid config --app-key "your-api-key"
# 方式二:通过环境变量(优先级高于 config)
export BEERVID_APP_KEY="your-api-key"
export BEERVID_APP_BASE_URL="https://open.beervid.ai" # 可选,有默认值
# 查看当前配置
beervid config --show功能概览
| 命令 | 功能 |
|---|---|
beervid config |
设置/查看全局配置(APP_KEY、BASE_URL) |
beervid get-oauth-url |
获取 TT/TTS OAuth 授权链接 |
beervid get-account-info |
查询账号信息 |
beervid upload |
上传视频(支持本地文件和 URL) |
beervid publish |
发布视频(普通/挂车) |
beervid poll-status |
轮询发布状态 |
beervid query-video |
查询视频统计数据 |
beervid query-products |
查询 TTS 商品列表 |
beervid publish-tt-flow |
TT 完整发布流程:上传、发布、轮询、查数 |
beervid publish-tts-flow |
TTS 完整发布流程:查商品、选商品、上传、发布 |
快速示例
beervid get-oauth-url --type tt
beervid upload --file ./video.mp4
beervid publish --type normal --business-id biz_123 --video-url https://cdn.beervid.ai/uploads/xxx.mp4完整流程示例
# TT:上传 -> 发布 -> 轮询 -> 查询数据
beervid publish-tt-flow --business-id biz_123 --file ./video.mp4 --caption "My video"
# TTS:自动选商品 -> 上传 -> 挂车发布
beervid publish-tts-flow --creator-id open_user_abc --file ./video.mp4
# TTS:交互式选商品
beervid publish-tts-flow --creator-id open_user_abc --file ./video.mp4 --interactive
# TTS:手动指定商品
beervid publish-tts-flow --creator-id open_user_abc --file ./video.mp4 --product-id prod_123 --product-title "Widget"详细用法见 SKILL.md。完整 API 参考见 references/api-reference.md。
落地文档
面向接入方后端工程师的项目落地建议:
| 文档 | 内容 |
|---|---|
| 数据表字段建议 | accounts/videos/products 表结构设计 |
| OAuth 回调存储建议 | State Token 防 CSRF、回调持久化、异步头像同步 |
| TT 轮询任务建议 | 阶梯递增轮询间隔、Cron/队列三层保障 |
| TTS 商品缓存建议 | 全量拉取、缓存过期、图片 URL 解析 |
| 失败重试与幂等建议 | 各 API 幂等性分析、指数退避、幂等键设计 |
示例工程
三种接入场景的可运行示例:
| 示例 | 场景 | 入口 |
|---|---|---|
| Standard | 纯 Node.js 脚本,快速验证 | npx tsx tt-publish-flow.ts |
| Express | Express 后端服务,含 OAuth 回调 | npx tsx server.ts |
| Next.js | Next.js App Router API Route | npm run dev |