@9000ai/cli 0.6.2 → 0.6.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/dist/commands/init.js
CHANGED
|
@@ -2,7 +2,7 @@ import { existsSync, mkdirSync, copyFileSync, readFileSync, readdirSync, statSyn
|
|
|
2
2
|
import { join, relative } from "path";
|
|
3
3
|
import { resolveSkillsPath } from "../config.js";
|
|
4
4
|
/** User data directories — never overwrite even with --force */
|
|
5
|
-
const USER_DATA_DIRS = ["profile", "claims", "inbox", "projects"];
|
|
5
|
+
const USER_DATA_DIRS = ["profile", "claims", "inbox", "projects", "benchmarks"];
|
|
6
6
|
function filesEqual(a, b) {
|
|
7
7
|
try {
|
|
8
8
|
return readFileSync(a).equals(readFileSync(b));
|
|
@@ -76,11 +76,13 @@ export function registerTranscribeCommands(parent) {
|
|
|
76
76
|
.command("text")
|
|
77
77
|
.description("Extract transcription text and save to local file")
|
|
78
78
|
.requiredOption("--task-id <id>", "Task ID")
|
|
79
|
+
.option("--name <name>", "Custom filename (without .txt), e.g. '一鸣财经_中国教育的三大魔幻现象'")
|
|
80
|
+
.option("--dir <dir>", "Sub-directory under output/transcripts/, e.g. 'AI+就业'")
|
|
79
81
|
.option("--no-save", "Print text to stdout instead of saving to file")
|
|
80
82
|
.action(async (opts) => {
|
|
81
83
|
const taskData = await request({ method: "GET", path: `/api/v1/tasks/${opts.taskId}` });
|
|
82
84
|
const inner = taskData.data;
|
|
83
|
-
if (!inner || inner.status !== "SUCCESS") {
|
|
85
|
+
if (!inner || String(inner.status).toUpperCase() !== "SUCCESS") {
|
|
84
86
|
console.error(`Task status: ${inner?.status ?? "unknown"}`);
|
|
85
87
|
process.exit(1);
|
|
86
88
|
}
|
|
@@ -100,17 +102,20 @@ export function registerTranscribeCommands(parent) {
|
|
|
100
102
|
console.error("Transcript text is empty");
|
|
101
103
|
process.exit(1);
|
|
102
104
|
}
|
|
103
|
-
// 用 third_party_task_id (video_id) 或 task_id 做文件名
|
|
104
|
-
const videoId = (inner.third_party_task_id ?? opts.taskId);
|
|
105
105
|
if (!opts.save) {
|
|
106
|
-
// --no-save: 直接输出
|
|
107
106
|
console.log(text);
|
|
108
107
|
return;
|
|
109
108
|
}
|
|
110
|
-
//
|
|
111
|
-
const
|
|
109
|
+
// 文件名: --name > third_party_task_id (video_id) > task_id
|
|
110
|
+
const videoId = (inner.third_party_task_id ?? opts.taskId);
|
|
111
|
+
const filename = (opts.name ?? videoId).replace(/[<>:"/\\|?*]/g, "_");
|
|
112
|
+
// 目录: output/transcripts/[--dir]/
|
|
113
|
+
const dirParts = ["output", "transcripts"];
|
|
114
|
+
if (opts.dir)
|
|
115
|
+
dirParts.push(opts.dir);
|
|
116
|
+
const dir = resolve(...dirParts);
|
|
112
117
|
mkdirSync(dir, { recursive: true });
|
|
113
|
-
const filepath = join(dir, `${
|
|
118
|
+
const filepath = join(dir, `${filename}.txt`);
|
|
114
119
|
writeFileSync(filepath, text, "utf-8");
|
|
115
120
|
// 只返回摘要给 AI
|
|
116
121
|
const preview = text.length > 100 ? text.slice(0, 100) + "..." : text;
|
|
@@ -148,7 +153,7 @@ export function registerTranscribeCommands(parent) {
|
|
|
148
153
|
if (opts.taskId) {
|
|
149
154
|
const taskResp = await request({ method: "GET", path: `/api/v1/tasks/${opts.taskId}` });
|
|
150
155
|
const taskData = (taskResp.data ?? taskResp);
|
|
151
|
-
if (taskData.status !== "SUCCESS") {
|
|
156
|
+
if (String(taskData.status).toUpperCase() !== "SUCCESS") {
|
|
152
157
|
console.error(`Task status: ${taskData.status ?? "unknown"} (need SUCCESS)`);
|
|
153
158
|
process.exit(1);
|
|
154
159
|
}
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const program = new Command();
|
|
|
14
14
|
program
|
|
15
15
|
.name("9000ai")
|
|
16
16
|
.description("9000AI Toolbox CLI — unified interface for 9000AI platform")
|
|
17
|
-
.version("0.6.
|
|
17
|
+
.version("0.6.4");
|
|
18
18
|
registerConfigCommands(program);
|
|
19
19
|
registerAuthCommands(program);
|
|
20
20
|
registerSearchCommands(program);
|
package/package.json
CHANGED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# 对标文案库
|
|
2
|
+
|
|
3
|
+
这个目录存放从对标账号转写的文案。
|
|
4
|
+
|
|
5
|
+
## 用法
|
|
6
|
+
|
|
7
|
+
- 按分类建子目录(和 `claims/` 中的主张对应)
|
|
8
|
+
- 转写文案用 `9000ai transcribe text --task-id <id> --dir <分类> --name <作者_标题>` 自动落盘到这里
|
|
9
|
+
- AI 按需读取单个文件进行分析、改写
|
|
10
|
+
|
|
11
|
+
## 目录结构示例
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
benchmarks/
|
|
15
|
+
├── AI+就业/
|
|
16
|
+
│ ├── 一鸣财经_中国教育的三大魔幻现象.txt
|
|
17
|
+
│ └── 张三说_AI替代了哪些工作.txt
|
|
18
|
+
├── 知识付费/
|
|
19
|
+
│ └── 李四_如何做知识付费.txt
|
|
20
|
+
└── README.md
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 和 claims 的关系
|
|
24
|
+
|
|
25
|
+
`claims/` 定义你的核心主张,`benchmarks/` 存对标账号的表达方式。AI 可以对比两者,找到差异化的内容角度。
|
package/skills/feedback/SKILL.md
CHANGED
|
@@ -46,6 +46,8 @@ agent 在对话中确认标题和内容后,直接组装参数调 CLI 就行。
|
|
|
46
46
|
| `--type` | 否 | 可选分类:workflow / bug / feature / other |
|
|
47
47
|
| `--context-json` | 否 | 附加上下文,比如涉及的 skill 名、task_id 等,JSON 格式 |
|
|
48
48
|
|
|
49
|
+
**必须带版本号**:提交反馈前先执行 `9000ai --version` 获取当前版本,在 content 末尾附上 `[CLI v0.x.x]`,方便定位问题。
|
|
50
|
+
|
|
49
51
|
## 命令
|
|
50
52
|
|
|
51
53
|
查看帮助:
|
|
@@ -67,13 +67,18 @@ output-format: task-oriented
|
|
|
67
67
|
|
|
68
68
|
不要把整份转写 JSON 原样塞进上下文。
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
提取原文文案:
|
|
71
71
|
|
|
72
72
|
```bash
|
|
73
73
|
9000ai transcribe text --task-id <task_id>
|
|
74
74
|
```
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
这个命令会:
|
|
77
|
+
1. 下载转写结果,提取纯文本
|
|
78
|
+
2. 保存到 `output/transcripts/{video_id}.txt`
|
|
79
|
+
3. 返回文件路径 + 前 100 字预览
|
|
80
|
+
|
|
81
|
+
AI 拿到路径后按需读取,不要一次性把所有文案塞进上下文。如果只需要输出到终端不落盘,加 `--no-save`。
|
|
77
82
|
|
|
78
83
|
## 命令
|
|
79
84
|
|
|
@@ -117,7 +122,7 @@ output-format: task-oriented
|
|
|
117
122
|
# 正确 — 只取需要的字段
|
|
118
123
|
9000ai task results --task-id <id> --fields status,output,video_url
|
|
119
124
|
|
|
120
|
-
# 只要原文 —
|
|
125
|
+
# 只要原文 — 落盘后按需读取
|
|
121
126
|
9000ai transcribe text --task-id <task_id>
|
|
122
127
|
```
|
|
123
128
|
|