@team-semicolon/semo-cli 4.7.2 → 4.7.3
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/index.js +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1508,6 +1508,7 @@ kbCmd
|
|
|
1508
1508
|
.option("--service <name>", "서비스(프로젝트) 필터")
|
|
1509
1509
|
.option("--limit <n>", "최대 결과 수", "10")
|
|
1510
1510
|
.option("--mode <type>", "검색 모드 (hybrid|semantic|text)", "hybrid")
|
|
1511
|
+
.option("--short", "미리보기 모드 (content를 80자로 잘라서 표시)")
|
|
1511
1512
|
.action(async (query, options) => {
|
|
1512
1513
|
const spinner = (0, ora_1.default)(`'${query}' 검색 중...`).start();
|
|
1513
1514
|
try {
|
|
@@ -1525,12 +1526,17 @@ kbCmd
|
|
|
1525
1526
|
else {
|
|
1526
1527
|
console.log(chalk_1.default.cyan.bold(`\n🔍 검색 결과: '${query}' (${results.length}건)\n`));
|
|
1527
1528
|
for (const entry of results) {
|
|
1528
|
-
const preview = entry.content.substring(0, 80).replace(/\n/g, " ");
|
|
1529
1529
|
const score = entry.score;
|
|
1530
1530
|
const scoreStr = score ? chalk_1.default.yellow(` (${(score * 100).toFixed(1)}%)`) : "";
|
|
1531
1531
|
const fullKey = entry.sub_key ? `${entry.key}/${entry.sub_key}` : entry.key;
|
|
1532
1532
|
console.log(chalk_1.default.cyan(` [${entry.domain}] `) + chalk_1.default.white(fullKey) + scoreStr);
|
|
1533
|
-
|
|
1533
|
+
if (options.short) {
|
|
1534
|
+
const preview = entry.content.substring(0, 80).replace(/\n/g, " ");
|
|
1535
|
+
console.log(chalk_1.default.gray(` ${preview}${entry.content.length > 80 ? "..." : ""}`));
|
|
1536
|
+
}
|
|
1537
|
+
else {
|
|
1538
|
+
console.log(chalk_1.default.gray(` ${entry.content}`));
|
|
1539
|
+
}
|
|
1534
1540
|
console.log();
|
|
1535
1541
|
}
|
|
1536
1542
|
}
|