sp-rag 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/README.md +6 -1
- package/dist/cli.js +10 -1
- package/dist/lib/skill.js +3 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ CLI để setup nhanh SP-RAG theo hướng dev-friendly:
|
|
|
17
17
|
## Trạng thái package
|
|
18
18
|
|
|
19
19
|
- package npm public: `sp-rag`
|
|
20
|
-
- version đang publish: `0.6.
|
|
20
|
+
- version đang publish: `0.6.4`
|
|
21
21
|
- binary public: `sp-rag`
|
|
22
22
|
|
|
23
23
|
## Cài từ source trong monorepo
|
|
@@ -66,6 +66,11 @@ Flow khuyên dùng sau khi đã có `grc_pat_*`:
|
|
|
66
66
|
4. khi đổi token, chỉ cần `token add`
|
|
67
67
|
5. khi muốn kiểm tra máy đang được cấu hình ra sao, dùng `explain`
|
|
68
68
|
|
|
69
|
+
Ghi chú:
|
|
70
|
+
|
|
71
|
+
- với `cursor` và `vscode` ở `scope project`, nếu Sếpp đang đứng sẵn trong repo thì có thể bỏ `--cwd`
|
|
72
|
+
- CLI sẽ tự dùng thư mục hiện tại cho cả MCP lẫn skill
|
|
73
|
+
|
|
69
74
|
Ví dụ:
|
|
70
75
|
|
|
71
76
|
```bash
|
package/dist/cli.js
CHANGED
|
@@ -4,11 +4,16 @@ import { runEvaluationSuite } from './lib/eval.js';
|
|
|
4
4
|
import { defaultBaseUrl, defaultMcpServerAlias, defaultMcpUrl, installMcpConfig, resolveMcpConfigPath, } from './lib/mcp-config.js';
|
|
5
5
|
import { fetchJson, fetchText, runDoctor } from './lib/http.js';
|
|
6
6
|
import { installSkill, resolveSkillInstallTarget, } from './lib/skill.js';
|
|
7
|
+
const cliVersion = '0.6.4';
|
|
7
8
|
function parseArgv(argv) {
|
|
8
9
|
const positionals = [];
|
|
9
10
|
const options = {};
|
|
10
11
|
for (let index = 0; index < argv.length; index += 1) {
|
|
11
12
|
const current = argv[index];
|
|
13
|
+
if (current === '-v') {
|
|
14
|
+
options['version'] = true;
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
12
17
|
if (!current.startsWith('--')) {
|
|
13
18
|
positionals.push(current);
|
|
14
19
|
continue;
|
|
@@ -551,6 +556,10 @@ export async function runCli(argv) {
|
|
|
551
556
|
const parsed = parseArgv(argv);
|
|
552
557
|
const [group, action] = parsed.positionals;
|
|
553
558
|
try {
|
|
559
|
+
if (optionFlag(parsed, 'version')) {
|
|
560
|
+
process.stdout.write(`sp-rag ${cliVersion}\n`);
|
|
561
|
+
return 0;
|
|
562
|
+
}
|
|
554
563
|
if (!group || group === 'help' || group === '--help') {
|
|
555
564
|
process.stdout.write(helpText());
|
|
556
565
|
return 0;
|
|
@@ -643,7 +652,7 @@ export async function runCli(argv) {
|
|
|
643
652
|
return 0;
|
|
644
653
|
}
|
|
645
654
|
if (group === 'version') {
|
|
646
|
-
process.stdout.write(
|
|
655
|
+
process.stdout.write(`sp-rag ${cliVersion}\n`);
|
|
647
656
|
return 0;
|
|
648
657
|
}
|
|
649
658
|
process.stdout.write(helpText());
|
package/dist/lib/skill.js
CHANGED
|
@@ -31,10 +31,11 @@ function normalizeScope(client, scope) {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
function requireProjectCwd(client, cwd) {
|
|
34
|
-
|
|
34
|
+
const resolvedCwd = cwd?.trim() ? cwd : process.cwd();
|
|
35
|
+
if (!resolvedCwd.trim()) {
|
|
35
36
|
throw new Error(`${client} cần --cwd hoặc --target-dir để cài skill theo project.`);
|
|
36
37
|
}
|
|
37
|
-
return path.resolve(
|
|
38
|
+
return path.resolve(resolvedCwd);
|
|
38
39
|
}
|
|
39
40
|
export function defaultSkillDir(client = 'codex', cwd, scope) {
|
|
40
41
|
const normalizedScope = normalizeScope(client, scope);
|