@9000ai/cli 0.6.3 → 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,6 +76,8 @@ 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}` });
|
|
@@ -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;
|
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 可以对比两者,找到差异化的内容角度。
|