beervid-app-cli 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -0
- package/SKILL.md +204 -376
- package/dist/cli.mjs +117 -151
- package/docs/database-schema.md +231 -0
- package/docs/oauth-callback.md +282 -0
- package/docs/retry-and-idempotency.md +295 -0
- package/docs/tt-poll-task.md +239 -0
- package/docs/tts-product-cache.md +256 -0
- package/example/express/README.md +58 -0
- package/example/express/package.json +20 -0
- package/example/express/server.ts +431 -0
- package/example/express/tsconfig.json +12 -0
- package/example/nextjs/.env.example +3 -0
- package/example/nextjs/README.md +54 -0
- package/example/nextjs/app/api/oauth/callback/route.ts +34 -0
- package/example/nextjs/app/api/oauth/url/route.ts +30 -0
- package/example/nextjs/app/api/products/route.ts +43 -0
- package/example/nextjs/app/api/publish/tt/route.ts +116 -0
- package/example/nextjs/app/api/publish/tts/route.ts +58 -0
- package/example/nextjs/app/api/status/[shareId]/route.ts +41 -0
- package/example/nextjs/app/layout.tsx +9 -0
- package/example/nextjs/app/page.tsx +80 -0
- package/example/nextjs/lib/beervid-client.ts +107 -0
- package/example/nextjs/next.config.ts +4 -0
- package/example/nextjs/package.json +19 -0
- package/example/nextjs/tsconfig.json +23 -0
- package/example/standard/README.md +51 -0
- package/example/standard/api-client.ts +181 -0
- package/example/standard/get-oauth-url.ts +44 -0
- package/example/standard/package.json +18 -0
- package/example/standard/query-products.ts +141 -0
- package/example/standard/tsconfig.json +12 -0
- package/example/standard/tt-publish-flow.ts +194 -0
- package/example/standard/tts-publish-flow.ts +246 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -30,6 +30,29 @@ node dist/cli.mjs --help
|
|
|
30
30
|
node dist/cli.mjs config --show
|
|
31
31
|
```
|
|
32
32
|
|
|
33
|
+
### 在 Claude Code / Codex / Antigravity 中使用
|
|
34
|
+
|
|
35
|
+
如果你希望在 Claude Code、Codex 等支持 Skill 的工具中直接调用本项目,除了通过 npm 安装 CLI 之外,还需要把 Skill 相关文件复制到你自己的 skills 目录下。
|
|
36
|
+
|
|
37
|
+
需要复制的内容:
|
|
38
|
+
|
|
39
|
+
- `SKILL.md`
|
|
40
|
+
- `references/`
|
|
41
|
+
- `docs/`
|
|
42
|
+
- `example/`
|
|
43
|
+
|
|
44
|
+
建议在你的 skills 目录中保持如下结构:
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
beervid-app-cli/
|
|
48
|
+
SKILL.md
|
|
49
|
+
references/
|
|
50
|
+
docs/
|
|
51
|
+
example/
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
这样工具在加载 `SKILL.md` 时,才能继续访问本项目附带的 API 参考、落地文档和示例工程。
|
|
55
|
+
|
|
33
56
|
## 配置
|
|
34
57
|
|
|
35
58
|
```bash
|
|
@@ -84,3 +107,25 @@ beervid publish-tts-flow --creator-id open_user_abc --file ./video.mp4 --product
|
|
|
84
107
|
```
|
|
85
108
|
|
|
86
109
|
详细用法见 [SKILL.md](./SKILL.md)。完整 API 参考见 [references/api-reference.md](./references/api-reference.md)。
|
|
110
|
+
|
|
111
|
+
## 落地文档
|
|
112
|
+
|
|
113
|
+
面向接入方后端工程师的项目落地建议:
|
|
114
|
+
|
|
115
|
+
| 文档 | 内容 |
|
|
116
|
+
|------|------|
|
|
117
|
+
| [数据表字段建议](./docs/database-schema.md) | accounts/videos/products 表结构设计 |
|
|
118
|
+
| [OAuth 回调存储建议](./docs/oauth-callback.md) | State Token 防 CSRF、回调持久化、异步头像同步 |
|
|
119
|
+
| [TT 轮询任务建议](./docs/tt-poll-task.md) | 阶梯递增轮询间隔、Cron/队列三层保障 |
|
|
120
|
+
| [TTS 商品缓存建议](./docs/tts-product-cache.md) | 全量拉取、缓存过期、图片 URL 解析 |
|
|
121
|
+
| [失败重试与幂等建议](./docs/retry-and-idempotency.md) | 各 API 幂等性分析、指数退避、幂等键设计 |
|
|
122
|
+
|
|
123
|
+
## 示例工程
|
|
124
|
+
|
|
125
|
+
三种接入场景的可运行示例:
|
|
126
|
+
|
|
127
|
+
| 示例 | 场景 | 入口 |
|
|
128
|
+
|------|------|------|
|
|
129
|
+
| [Standard](./example/standard/) | 纯 Node.js 脚本,快速验证 | `npx tsx tt-publish-flow.ts` |
|
|
130
|
+
| [Express](./example/express/) | Express 后端服务,含 OAuth 回调 | `npx tsx server.ts` |
|
|
131
|
+
| [Next.js](./example/nextjs/) | Next.js App Router API Route | `npm run dev` |
|