@yixiaoermail/cli 3.1.0
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 +25 -0
- package/bin/yxer.js +74 -0
- package/dist/yxer-darwin-amd64 +0 -0
- package/dist/yxer-darwin-arm64 +0 -0
- package/dist/yxer-linux-amd64 +0 -0
- package/dist/yxer-linux-arm64 +0 -0
- package/dist/yxer-windows-amd64.exe +0 -0
- package/dist/yxer-windows-arm64.exe +0 -0
- package/package.json +23 -0
- package/skills/yixiaoer/QUICKSTART.md +265 -0
- package/skills/yixiaoer/SKILL.md +70 -0
- package/skills/yixiaoer/assets/yixiaoer.png +0 -0
- package/skills/yixiaoer/plugin.json +21 -0
- package/skills/yixiaoer/references/cli/command-reference.md +212 -0
- package/skills/yixiaoer/references/cli/skill-install.md +65 -0
- package/skills/yixiaoer/references/cli-install-uninstall.md +196 -0
- package/skills/yixiaoer/references/domains/accounts-and-env.md +37 -0
- package/skills/yixiaoer/references/domains/draft-and-material.md +29 -0
- package/skills/yixiaoer/references/domains/install-and-sync.md +37 -0
- package/skills/yixiaoer/references/domains/publish.md +75 -0
- package/skills/yixiaoer/references/domains/troubleshooting.md +30 -0
- package/skills/yixiaoer/references/execution-standard.md +144 -0
- package/skills/yixiaoer/references/get-account-overviews.md +56 -0
- package/skills/yixiaoer/references/get-challenges.md +14 -0
- package/skills/yixiaoer/references/get-collections.md +34 -0
- package/skills/yixiaoer/references/get-content-overviews.md +59 -0
- package/skills/yixiaoer/references/get-friends.md +9 -0
- package/skills/yixiaoer/references/get-games.md +39 -0
- package/skills/yixiaoer/references/get-goods.md +42 -0
- package/skills/yixiaoer/references/get-groups.md +35 -0
- package/skills/yixiaoer/references/get-hot-events.md +14 -0
- package/skills/yixiaoer/references/get-locations.md +48 -0
- package/skills/yixiaoer/references/get-miniapps.md +38 -0
- package/skills/yixiaoer/references/get-music-categories.md +41 -0
- package/skills/yixiaoer/references/get-music.md +67 -0
- package/skills/yixiaoer/references/get-publish-activities.md +40 -0
- package/skills/yixiaoer/references/get-publish-categories.md +62 -0
- package/skills/yixiaoer/references/get-sync-apps.md +14 -0
- package/skills/yixiaoer/references/get-topics.md +13 -0
- package/skills/yixiaoer/references/go-live-process.md +168 -0
- package/skills/yixiaoer/references/keyword-reference.md +113 -0
- package/skills/yixiaoer/references/material-resource.md +89 -0
- package/skills/yixiaoer/references/platform-doc-maintenance.md +33 -0
- package/skills/yixiaoer/references/platform.md +61 -0
- package/skills/yixiaoer/references/platforms/article/acfun.md +90 -0
- package/skills/yixiaoer/references/platforms/article/aiqiyi.md +56 -0
- package/skills/yixiaoer/references/platforms/article/baijiahao.md +94 -0
- package/skills/yixiaoer/references/platforms/article/bilibili.md +88 -0
- package/skills/yixiaoer/references/platforms/article/chejiahao.md +81 -0
- package/skills/yixiaoer/references/platforms/article/csdn.md +86 -0
- package/skills/yixiaoer/references/platforms/article/dayuhao.md +78 -0
- package/skills/yixiaoer/references/platforms/article/douban.md +62 -0
- package/skills/yixiaoer/references/platforms/article/douyin.md +106 -0
- package/skills/yixiaoer/references/platforms/article/index.md +157 -0
- package/skills/yixiaoer/references/platforms/article/jianshu.md +58 -0
- package/skills/yixiaoer/references/platforms/article/kuaichuanhao.md +78 -0
- package/skills/yixiaoer/references/platforms/article/qiehao.md +78 -0
- package/skills/yixiaoer/references/platforms/article/souhuhao.md +75 -0
- package/skills/yixiaoer/references/platforms/article/toutiaohao.md +78 -0
- package/skills/yixiaoer/references/platforms/article/wangyihao.md +79 -0
- package/skills/yixiaoer/references/platforms/article/weixingongzhonghao.md +135 -0
- package/skills/yixiaoer/references/platforms/article/xinlangweibo.md +75 -0
- package/skills/yixiaoer/references/platforms/article/xueqiuhao.md +73 -0
- package/skills/yixiaoer/references/platforms/article/yichehao.md +92 -0
- package/skills/yixiaoer/references/platforms/article/yidianhao.md +76 -0
- package/skills/yixiaoer/references/platforms/article/zhihu.md +75 -0
- package/skills/yixiaoer/references/platforms/get-locations.md +5 -0
- package/skills/yixiaoer/references/platforms/imageText/baijiahao.md +91 -0
- package/skills/yixiaoer/references/platforms/imageText/douyin.md +111 -0
- package/skills/yixiaoer/references/platforms/imageText/index.md +116 -0
- package/skills/yixiaoer/references/platforms/imageText/kuaishou.md +106 -0
- package/skills/yixiaoer/references/platforms/imageText/shipinhao.md +125 -0
- package/skills/yixiaoer/references/platforms/imageText/toutiaohao.md +76 -0
- package/skills/yixiaoer/references/platforms/imageText/weixinshipinhao.md +7 -0
- package/skills/yixiaoer/references/platforms/imageText/xiaohongshu.md +88 -0
- package/skills/yixiaoer/references/platforms/imageText/xinlangweibo.md +77 -0
- package/skills/yixiaoer/references/platforms/imageText/zhihu.md +92 -0
- package/skills/yixiaoer/references/platforms/index.md +20 -0
- package/skills/yixiaoer/references/platforms/video/acfun.md +82 -0
- package/skills/yixiaoer/references/platforms/video/aiqiyi.md +89 -0
- package/skills/yixiaoer/references/platforms/video/baijiahao.md +89 -0
- package/skills/yixiaoer/references/platforms/video/bilibili-open.md +87 -0
- package/skills/yixiaoer/references/platforms/video/bilibili.md +80 -0
- package/skills/yixiaoer/references/platforms/video/chejiahao.md +63 -0
- package/skills/yixiaoer/references/platforms/video/dayuhao.md +89 -0
- package/skills/yixiaoer/references/platforms/video/dewu.md +80 -0
- package/skills/yixiaoer/references/platforms/video/douyin.md +143 -0
- package/skills/yixiaoer/references/platforms/video/duoduoshipin.md +64 -0
- package/skills/yixiaoer/references/platforms/video/fengwang.md +81 -0
- package/skills/yixiaoer/references/platforms/video/index.md +165 -0
- package/skills/yixiaoer/references/platforms/video/kuaishou-open.md +63 -0
- package/skills/yixiaoer/references/platforms/video/kuaishou.md +77 -0
- package/skills/yixiaoer/references/platforms/video/meipai.md +79 -0
- package/skills/yixiaoer/references/platforms/video/meiyou.md +59 -0
- package/skills/yixiaoer/references/platforms/video/pipixia.md +58 -0
- package/skills/yixiaoer/references/platforms/video/qiehao.md +91 -0
- package/skills/yixiaoer/references/platforms/video/shipinhao.md +95 -0
- package/skills/yixiaoer/references/platforms/video/souhuhao.md +91 -0
- package/skills/yixiaoer/references/platforms/video/souhushipin.md +64 -0
- package/skills/yixiaoer/references/platforms/video/tengxunshipin.md +63 -0
- package/skills/yixiaoer/references/platforms/video/toutiaohao.md +66 -0
- package/skills/yixiaoer/references/platforms/video/wangyihao.md +93 -0
- package/skills/yixiaoer/references/platforms/video/weishi.md +61 -0
- package/skills/yixiaoer/references/platforms/video/xiaohongshu.md +133 -0
- package/skills/yixiaoer/references/platforms/video/xiaohongshushop.md +92 -0
- package/skills/yixiaoer/references/platforms/video/xinlangweibo.md +79 -0
- package/skills/yixiaoer/references/platforms/video/yichehao.md +61 -0
- package/skills/yixiaoer/references/platforms/video/yidianhao.md +85 -0
- package/skills/yixiaoer/references/platforms/video/zhihu.md +85 -0
- package/skills/yixiaoer/references/proxy-management.md +68 -0
- package/skills/yixiaoer/references/query-accounts.md +85 -0
- package/skills/yixiaoer/references/save-draft.md +75 -0
- package/skills/yixiaoer/references/topic-tags.md +139 -0
- package/skills/yixiaoer/references/troubleshooting-guide.md +105 -0
- package/skills/yixiaoer/references/upload-resource.md +59 -0
- package/skills/yixiaoer/references/usage-workflow.md +209 -0
- package/skills/yixiaoer/references/workflows/account-selection.md +38 -0
- package/skills/yixiaoer/references/workflows/common-rules.md +259 -0
- package/skills/yixiaoer/references/workflows/draft-workflow.md +44 -0
- package/skills/yixiaoer/references/workflows/local-vs-cloud.md +50 -0
- package/skills/yixiaoer/references/workflows/material-workflow.md +43 -0
- package/skills/yixiaoer/references/workflows/payload-sourcing.md +70 -0
- package/skills/yixiaoer/references/workflows/publish-article.md +68 -0
- package/skills/yixiaoer/references/workflows/publish-imageText.md +64 -0
- package/skills/yixiaoer/references/workflows/publish-troubleshooting.md +50 -0
- package/skills/yixiaoer/references/workflows/publish-video.md +65 -0
- package/skills/yixiaoer/references/yixiaoer-shared.md +95 -0
package/README.md
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# @yixiaoer/cli
|
|
2
|
+
|
|
3
|
+
Packaged `yxer` CLI for global npm installation.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g @yixiaoer/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Verify
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
yxer --version
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Install skill
|
|
18
|
+
|
|
19
|
+
The npm package includes the `yixiaoer` skill bundle. Sync it into your agent host with:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
yxer skill sync
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Use `yxer skill sync --global` if your host expects a global skill install.
|
package/bin/yxer.js
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const os = require("node:os");
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
|
|
8
|
+
function resolveBinary() {
|
|
9
|
+
const platform = os.platform();
|
|
10
|
+
const arch = os.arch();
|
|
11
|
+
const key = `${platform}/${arch}`;
|
|
12
|
+
|
|
13
|
+
const binaries = {
|
|
14
|
+
"win32/x64": "yxer-windows-amd64.exe",
|
|
15
|
+
"win32/arm64": "yxer-windows-arm64.exe",
|
|
16
|
+
"darwin/x64": "yxer-darwin-amd64",
|
|
17
|
+
"darwin/arm64": "yxer-darwin-arm64",
|
|
18
|
+
"linux/x64": "yxer-linux-amd64",
|
|
19
|
+
"linux/arm64": "yxer-linux-arm64"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const filename = binaries[key];
|
|
23
|
+
if (!filename) {
|
|
24
|
+
console.error(
|
|
25
|
+
JSON.stringify({
|
|
26
|
+
error: {
|
|
27
|
+
code: "unsupported_platform",
|
|
28
|
+
message: `No packaged yxer binary for ${key}`,
|
|
29
|
+
category: "environment",
|
|
30
|
+
retryable: false
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
);
|
|
34
|
+
process.exit(1);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const binaryPath = path.join(__dirname, "..", "dist", filename);
|
|
38
|
+
if (!fs.existsSync(binaryPath)) {
|
|
39
|
+
console.error(
|
|
40
|
+
JSON.stringify({
|
|
41
|
+
error: {
|
|
42
|
+
code: "missing_binary",
|
|
43
|
+
message: `Expected packaged binary not found: ${filename}`,
|
|
44
|
+
category: "environment",
|
|
45
|
+
hint: "Reinstall the npm package or rebuild the release artifact.",
|
|
46
|
+
retryable: false
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return binaryPath;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const binary = resolveBinary();
|
|
57
|
+
const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
58
|
+
|
|
59
|
+
if (result.error) {
|
|
60
|
+
console.error(
|
|
61
|
+
JSON.stringify({
|
|
62
|
+
error: {
|
|
63
|
+
code: "spawn_failed",
|
|
64
|
+
message: result.error.message,
|
|
65
|
+
category: "environment",
|
|
66
|
+
hint: "Check that the packaged binary has execute permission and matches the current platform.",
|
|
67
|
+
retryable: false
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
);
|
|
71
|
+
process.exit(1);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
process.exit(result.status === null ? 1 : result.status);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@yixiaoermail/cli",
|
|
3
|
+
"version": "3.1.0",
|
|
4
|
+
"description": "Yixiaoer CLI packaged for npm global installation",
|
|
5
|
+
"bin": {
|
|
6
|
+
"yxer": "bin/yxer.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"bin",
|
|
10
|
+
"dist",
|
|
11
|
+
"skills",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"keywords": [
|
|
15
|
+
"yixiaoer",
|
|
16
|
+
"yxer",
|
|
17
|
+
"cli"
|
|
18
|
+
],
|
|
19
|
+
"license": "UNLICENSED",
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": "\u003e=18"
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# 蚁小二发布快速开始
|
|
2
|
+
|
|
3
|
+
**5 分钟完成首次发布**
|
|
4
|
+
|
|
5
|
+
本指南帮助 AI Agent 和人类用户快速完成第一次发布,跳过复杂的文档层级。
|
|
6
|
+
|
|
7
|
+
**使用边界:本文只提供最短上手路径,不替代正式规则。若与 [`references/yixiaoer-shared.md`](./references/yixiaoer-shared.md) 或 `references/workflows/` 中的 workflow 有冲突,以共享规则和 workflow 为准。**
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🚀 5 步发布流程
|
|
12
|
+
|
|
13
|
+
### 1️⃣ 环境检查(30秒)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
yxer doctor
|
|
17
|
+
yxer accounts list 抖音 --status 1 --json
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
**检查点:**
|
|
21
|
+
- ✅ `doctor` 返回 `ok: true`
|
|
22
|
+
- ✅ `accounts list` 至少返回一个 `status: 1` 的账号
|
|
23
|
+
- ❌ 如果失败,先执行 `yxer config init --api-key <apiKey>`
|
|
24
|
+
|
|
25
|
+
**保存信息:**
|
|
26
|
+
- `platformAccountId`(从 accounts list 获取)
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
### 2️⃣ 获取字段清单(1分钟)
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# 推荐:先看字段列表(输出简洁)
|
|
34
|
+
yxer schema fields 抖音 video
|
|
35
|
+
|
|
36
|
+
# 备选:需要完整结构骨架时才执行
|
|
37
|
+
yxer schema get 抖音 video
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**关注重点:**
|
|
41
|
+
- `required` 字段:必须填写
|
|
42
|
+
- `complex` 字段:需要查询命令获取(如 location, music, challenge)
|
|
43
|
+
- `queryCommands`:告诉你如何查询复杂字段
|
|
44
|
+
|
|
45
|
+
**保存信息:**
|
|
46
|
+
- 必填字段列表
|
|
47
|
+
- 复杂字段的查询命令
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
### 3️⃣ 准备资源(2分钟)
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# 上传视频
|
|
55
|
+
yxer upload ./video.mp4
|
|
56
|
+
|
|
57
|
+
# 上传封面
|
|
58
|
+
yxer upload ./cover.jpg
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**保存信息:**
|
|
62
|
+
- 视频上传返回的完整对象:`{key, size, width, height, duration, format}`
|
|
63
|
+
- 封面上传返回的完整对象:`{key, size, width, height, format}`
|
|
64
|
+
|
|
65
|
+
**⚠️ 重要:**
|
|
66
|
+
- 必须使用 CLI 返回的**完整对象**,不能只用 `key`
|
|
67
|
+
- 不能手动编造 `size/width/height` 等字段
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
### 4️⃣ 填写 payload(3分钟)
|
|
72
|
+
|
|
73
|
+
创建 `payload.json`:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"action": "publish",
|
|
78
|
+
"publishType": "video",
|
|
79
|
+
"platforms": ["抖音"],
|
|
80
|
+
"publishArgs": {
|
|
81
|
+
"accountForms": [
|
|
82
|
+
{
|
|
83
|
+
"platformAccountId": "<步骤1获取的账号ID>",
|
|
84
|
+
"video": {
|
|
85
|
+
"key": "<步骤3返回>",
|
|
86
|
+
"size": 12345678,
|
|
87
|
+
"width": 1080,
|
|
88
|
+
"height": 1920,
|
|
89
|
+
"duration": 15000,
|
|
90
|
+
"format": "mp4"
|
|
91
|
+
},
|
|
92
|
+
"cover": {
|
|
93
|
+
"key": "<步骤3返回>",
|
|
94
|
+
"size": 234567,
|
|
95
|
+
"width": 1080,
|
|
96
|
+
"height": 1920,
|
|
97
|
+
"format": "jpg"
|
|
98
|
+
},
|
|
99
|
+
"contentPublishForm": {
|
|
100
|
+
"formType": "task",
|
|
101
|
+
"title": "我的第一个视频",
|
|
102
|
+
"description": "这是一个测试视频"
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**结构说明:**
|
|
111
|
+
- 顶层:`action`, `publishType`, `platforms`, `publishArgs`(固定结构)
|
|
112
|
+
- `publishArgs.accountForms[]`:账号级表单数组
|
|
113
|
+
- `contentPublishForm`:平台特定的业务字段
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### 5️⃣ 校验和发布(1分钟)
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# 校验 payload
|
|
121
|
+
yxer validate 抖音 video payload.json
|
|
122
|
+
|
|
123
|
+
# 预览(dry-run)
|
|
124
|
+
yxer publish video 抖音 payload.json --dry-run
|
|
125
|
+
|
|
126
|
+
# 正式发布
|
|
127
|
+
yxer publish video 抖音 payload.json
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**注意:**
|
|
131
|
+
- 必须按顺序执行:validate → dry-run → publish
|
|
132
|
+
- 每次修改 payload 后都要重新 validate
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## 🎯 常见场景
|
|
137
|
+
|
|
138
|
+
### 场景 1:添加地理位置
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
# 1. 查询位置
|
|
142
|
+
yxer locations <account_id> --query 北京
|
|
143
|
+
|
|
144
|
+
# 2. 在 contentPublishForm 中添加
|
|
145
|
+
{
|
|
146
|
+
"location": {
|
|
147
|
+
"yixiaoerId": "<返回的ID>",
|
|
148
|
+
"yixiaoerName": "<返回的名称>",
|
|
149
|
+
"raw": {<返回的完整raw对象>}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### 场景 2:添加背景音乐
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
# 1. 查询音乐
|
|
158
|
+
yxer music <account_id> --query 歌曲名
|
|
159
|
+
|
|
160
|
+
# 2. 在 contentPublishForm 中添加
|
|
161
|
+
{
|
|
162
|
+
"music": {
|
|
163
|
+
"yixiaoerId": "<返回的ID>",
|
|
164
|
+
"yixiaoerName": "<返回的名称>",
|
|
165
|
+
"duration": 180000,
|
|
166
|
+
"playUrl": "<返回的URL>",
|
|
167
|
+
"raw": {<返回的完整raw对象>}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### 场景 3:本机发布(客户端发布)
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
# 1. 配置 clientId(一次性)
|
|
176
|
+
yxer config set-local-client-id <clientId>
|
|
177
|
+
|
|
178
|
+
# 2. 发布时指定通道
|
|
179
|
+
yxer validate 抖音 video payload.json --publish-channel local
|
|
180
|
+
yxer publish video 抖音 payload.json --publish-channel local --dry-run
|
|
181
|
+
yxer publish video 抖音 payload.json --publish-channel local
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
## ⚠️ 常见错误速查
|
|
187
|
+
|
|
188
|
+
| 错误信息 | 原因 | 解决方案 |
|
|
189
|
+
|---------|------|----------|
|
|
190
|
+
| `missing publishArgs` | payload 结构不对 | 确保顶层有 `publishArgs` 字段 |
|
|
191
|
+
| `missing platformAccountId` | 缺少账号 ID | 从 `yxer accounts list` 获取 |
|
|
192
|
+
| `missing required field "title"` | 缺少必填字段 | 查看 `yxer schema fields` 的 `required` 列表 |
|
|
193
|
+
| `invalid resource key` | 资源未上传 | 先执行 `yxer upload <file>` |
|
|
194
|
+
| `unexpected field` | 字段名错误或不存在 | 对照 `yxer schema fields` 检查字段名 |
|
|
195
|
+
| `Schema validation failed` | 字段类型或值不对 | 查看错误信息中的 `suggestions` |
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## 🔍 错误诊断检查清单
|
|
200
|
+
|
|
201
|
+
如果发布失败,按顺序检查:
|
|
202
|
+
|
|
203
|
+
- [ ] 已执行 `yxer doctor` 且返回成功
|
|
204
|
+
- [ ] 已执行 `yxer accounts list` 并确认有在线账号
|
|
205
|
+
- [ ] 已执行 `yxer schema fields` 查看字段定义
|
|
206
|
+
- [ ] payload 顶层包含 `publishArgs`
|
|
207
|
+
- [ ] 业务字段在 `publishArgs.accountForms[].contentPublishForm`
|
|
208
|
+
- [ ] 资源通过 `yxer upload` 上传并使用返回的**完整对象**
|
|
209
|
+
- [ ] 复杂对象(location/music等)通过查询命令获取
|
|
210
|
+
- [ ] 已执行 `yxer validate` 且通过
|
|
211
|
+
- [ ] 已执行 `yxer publish --dry-run` 预览
|
|
212
|
+
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
## 📚 进阶学习
|
|
216
|
+
|
|
217
|
+
完成首次发布后,可以继续学习:
|
|
218
|
+
|
|
219
|
+
### 不同发布类型
|
|
220
|
+
|
|
221
|
+
- **图文发布**:`references/workflows/publish-imageText.md`
|
|
222
|
+
- **文章发布**:`references/workflows/publish-article.md`
|
|
223
|
+
|
|
224
|
+
### 复杂功能
|
|
225
|
+
|
|
226
|
+
- **复杂字段查询**:`references/workflows/payload-sourcing.md`
|
|
227
|
+
- **发布通道选择**:`references/workflows/local-vs-cloud.md`
|
|
228
|
+
- **账号选择策略**:`references/workflows/account-selection.md`
|
|
229
|
+
|
|
230
|
+
### 平台差异
|
|
231
|
+
|
|
232
|
+
- **平台文档索引**:`references/platforms/index.md`
|
|
233
|
+
- **视频平台**:`references/platforms/video/`
|
|
234
|
+
- **图文平台**:`references/platforms/imageText/`
|
|
235
|
+
- **文章平台**:`references/platforms/article/`
|
|
236
|
+
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
## 💡 AI Agent 使用建议
|
|
240
|
+
|
|
241
|
+
如果你是 AI Agent,使用本指南时:
|
|
242
|
+
|
|
243
|
+
1. **优先阅读本文档**,而不是从 `SKILL.md` 开始读 7 个文档
|
|
244
|
+
2. **真正进入写操作前,仍必须回读** `references/yixiaoer-shared.md` 和对应 workflow
|
|
245
|
+
3. **优先使用 `schema fields`**,只在需要完整结构时才用 `schema get`
|
|
246
|
+
4. **关注错误信息中的 `suggestions`**,而不是自己猜测
|
|
247
|
+
5. **使用 CLI 返回的完整对象**,不要手动编造字段值
|
|
248
|
+
6. **遇到复杂字段时查看 `queryCommands`**,使用对应的查询命令
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## 🎓 总结
|
|
253
|
+
|
|
254
|
+
**记住这 3 个核心原则:**
|
|
255
|
+
|
|
256
|
+
1. **结构标准化**:所有平台使用相同的 payload 结构
|
|
257
|
+
2. **字段从 CLI 获取**:资源和复杂对象必须通过 CLI 命令获取
|
|
258
|
+
3. **先 validate 后 publish**:永远不要跳过校验步骤
|
|
259
|
+
|
|
260
|
+
**5 分钟流程回顾:**
|
|
261
|
+
```
|
|
262
|
+
doctor → accounts list → schema fields → upload → fill payload → validate → dry-run → publish
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
祝你发布顺利!🎉
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: yixiaoer
|
|
3
|
+
version: 3.1.0
|
|
4
|
+
description: "通过 yxer CLI 操作蚁小二多平台内容分发:账号查询、资源上传、发布前准备、payload 校验、云发布/本机发布、草稿保存、素材登记、发布记录排查与技能同步。"
|
|
5
|
+
metadata:
|
|
6
|
+
category: "productivity"
|
|
7
|
+
requires:
|
|
8
|
+
bins: ["yxer"]
|
|
9
|
+
cliHelp: "yxer --help; yxer doctor; yxer accounts list --help; yxer publish --help; yxer validate --help"
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# 蚁小二 Skill
|
|
13
|
+
|
|
14
|
+
你是 AI Agent,通过 `yxer` CLI 操作蚁小二资源。真正执行一律走 CLI,不要假设存在旧 Node 脚本入口、隐式 API 或手工脚本。
|
|
15
|
+
|
|
16
|
+
**🚀 首次使用?先读 [`./QUICKSTART.md`](./QUICKSTART.md) - 5 分钟完成首次发布**
|
|
17
|
+
|
|
18
|
+
**CRITICAL - 开始前 MUST 先读取 [`./references/yixiaoer-shared.md`](./references/yixiaoer-shared.md),其中包含环境检查、发布通道、同步和输出协议。**
|
|
19
|
+
**BLOCKING REQUIREMENT - 涉及正式写操作时,禁止凭记忆拼 payload、禁止跳过 workflow、禁止绕过 `yxer` CLI 直接执行旧脚本或隐式 API。**
|
|
20
|
+
|
|
21
|
+
## 能力索引
|
|
22
|
+
|
|
23
|
+
根据用户需求,必须先读取对应业务域文档,再进入具体 workflow 或 reference。不要直接凭记忆拼 payload 或执行正式发布。
|
|
24
|
+
|
|
25
|
+
- 发布与 payload 修订
|
|
26
|
+
- 入口:[`./references/domains/publish.md`](./references/domains/publish.md)
|
|
27
|
+
- 覆盖视频、图文、文章发布,账号选择,云/本机通道判断,payload 来源纪律,动态字段查询,平台差异文档入口。
|
|
28
|
+
- 账号、环境与 skill 同步
|
|
29
|
+
- 入口:[`./references/domains/accounts-and-env.md`](./references/domains/accounts-and-env.md)
|
|
30
|
+
- 覆盖 `doctor`、`config`、账号查询与技能同步。
|
|
31
|
+
- 草稿与素材库
|
|
32
|
+
- 入口:[`./references/domains/draft-and-material.md`](./references/domains/draft-and-material.md)
|
|
33
|
+
- 覆盖蚁小二草稿、平台草稿判断、素材上传、素材登记与“上传后立即发布”的切换路径。
|
|
34
|
+
- 发布记录与失败排查
|
|
35
|
+
- 入口:[`./references/domains/troubleshooting.md`](./references/domains/troubleshooting.md)
|
|
36
|
+
- 覆盖 `query records`、校验失败修复、本机/云发布错误分流与回退策略。
|
|
37
|
+
- 安装、升级与分发
|
|
38
|
+
- 入口:[`./references/domains/install-and-sync.md`](./references/domains/install-and-sync.md)
|
|
39
|
+
- 覆盖 skill 安装、同步、升级和宿主侧接入说明。
|
|
40
|
+
|
|
41
|
+
## 意图分流
|
|
42
|
+
|
|
43
|
+
| 用户意图 / 说法 | 先读入口 | 后续动作 |
|
|
44
|
+
| --- | --- | --- |
|
|
45
|
+
| “帮我发一下”“发个抖音/小红书”“发布视频/图文/文章” | [`./references/domains/publish.md`](./references/domains/publish.md) | 再按类型进入对应 workflow;正式发布前必须走 `doctor -> accounts list -> prepare -> schema fields -> validate -> publish --dry-run -> publish` |
|
|
46
|
+
| “先别发,只生成/修一下 payload” | [`./references/domains/publish.md`](./references/domains/publish.md) | 强制读取 payload 来源和类型 workflow,只做字段修订,不擅自正式发布 |
|
|
47
|
+
| “查下账号/环境”“怎么配置 clientId”“看看 skill 要不要同步” | [`./references/domains/accounts-and-env.md`](./references/domains/accounts-and-env.md) | 先做环境检查,再决定是否继续业务流程 |
|
|
48
|
+
| “存草稿”“传素材”“放到素材库里” | [`./references/domains/draft-and-material.md`](./references/domains/draft-and-material.md) | 先区分草稿和素材,再判断是否需要回切发布域 |
|
|
49
|
+
| “为什么失败了”“查发布记录”“解释 validate / publish 报错” | [`./references/domains/troubleshooting.md`](./references/domains/troubleshooting.md) | 先定位失败阶段,再回退到对应 workflow 修复 |
|
|
50
|
+
| “安装 skill”“升级后怎么同步”“怎么接入这个技能” | [`./references/domains/install-and-sync.md`](./references/domains/install-and-sync.md) | 优先走 skill 展示、同步和安装说明 |
|
|
51
|
+
|
|
52
|
+
## 命令探索
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
yxer --help
|
|
56
|
+
yxer doctor
|
|
57
|
+
yxer <command> --help
|
|
58
|
+
yxer prepare <platform> <type>
|
|
59
|
+
yxer schema fields <platform> <type>
|
|
60
|
+
yxer schema get <platform> <type>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 全局规则
|
|
64
|
+
|
|
65
|
+
- 发布、草稿、素材、排查都只允许通过 `yxer` CLI 执行。
|
|
66
|
+
- BLOCKING REQUIREMENT: 正式发布前固定顺序是 `doctor -> accounts list -> prepare -> schema fields -> validate -> publish --dry-run -> publish`;只有需要 payload 骨架时再补 `schema get`。
|
|
67
|
+
- `prepare`、`schema fields` / `schema get`、workflow、平台文档和 CLI 实际输出,是组装 payload 的唯一依据。
|
|
68
|
+
- 图片、视频、封面等资源必须先上传,且只能复用 `yxer upload` 返回的真实字段。
|
|
69
|
+
- `category`、`location`、`music`、`collection`、`challenge`、`goods` 等动态字段必须先通过 `yxer query ...` 查询,不能手写对象。
|
|
70
|
+
- CRITICAL: `validate`、`publish --dry-run`、正式 `publish` 必须使用同一套发布通道参数。
|
|
Binary file
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "yixiaoer",
|
|
3
|
+
"name": "yixiaoer",
|
|
4
|
+
"displayName": "蚁小二",
|
|
5
|
+
"version": "3.1.0",
|
|
6
|
+
"description": "蚁小二多平台内容分发链接应用",
|
|
7
|
+
"skills": "./",
|
|
8
|
+
"interface": {
|
|
9
|
+
"displayName": "蚁小二",
|
|
10
|
+
"shortDescription": "蚁小二多平台内容分发链接应用",
|
|
11
|
+
"developerName": "yixiaoer",
|
|
12
|
+
"category": "Productivity",
|
|
13
|
+
"capabilities": [
|
|
14
|
+
"Interactive",
|
|
15
|
+
"Write"
|
|
16
|
+
],
|
|
17
|
+
"composerIcon": "./assets/yixiaoer.png",
|
|
18
|
+
"logo": "./assets/yixiaoer.png",
|
|
19
|
+
"screenshots": []
|
|
20
|
+
}
|
|
21
|
+
}
|