skill-atlas-cli 0.2.4 → 0.2.5

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.
Files changed (2) hide show
  1. package/bin/cli.js +12 -5
  2. package/package.json +1 -1
package/bin/cli.js CHANGED
@@ -33,13 +33,20 @@ async function main() {
33
33
  if (!process.argv.includes("-y") && !process.argv.includes("--yes")) showLogo();
34
34
  const parseArgv = process.argv.slice(2).length === 0 ? [...process.argv.slice(0, 2), "--help"] : process.argv;
35
35
  const cli = cac("skill-atlas");
36
- cli.command("search [keyword]", "搜索 skill(按名称或描述匹配)").action(async (keyword) => {
37
- if (!keyword?.trim()) {
38
- logger.error("请提供搜索关键词");
39
- logger.info("提示: skill-atlas search <关键词>");
36
+ cli.command("search [keyword]", "搜索 skill(按名称或描述匹配)").option("-q, --query <text>", "搜索意图(自然语言描述;可单独使用,或与位置参数关键词组合:关键词用于接口 q,本项用于展示与语义)").action(async (keyword, options) => {
37
+ const kw = keyword?.trim() ?? "";
38
+ const intent = options.query?.trim() ?? "";
39
+ console.log("kw", kw);
40
+ console.log("intent", intent);
41
+ if (!kw && !intent) {
42
+ logger.error("请提供搜索关键词或 --query");
43
+ logger.info("提示: skill-atlas search <关键词> 或 skill-atlas search -q \"<意图描述>\"");
40
44
  process.exit(1);
41
45
  }
42
- await runSearch({ keyword: keyword.trim() });
46
+ await runSearch({
47
+ keyword: kw || intent,
48
+ ...intent ? { query: intent } : {}
49
+ });
43
50
  });
44
51
  cli.command("update", "快速升级 CLI 到最新版本").option("-y, --yes", "非交互模式,跳过确认直接升级").action(async (options) => {
45
52
  await runUpdate({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skill-atlas-cli",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "skill-atlas CLI - 虾小宝 命令行工具",
5
5
  "homepage": "https://ai.skillatlas.cn/",
6
6
  "type": "module",