@seeed-studio/solution-cli 0.4.4 → 0.4.6

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/CHANGELOG.md ADDED
@@ -0,0 +1,84 @@
1
+ # Changelog
2
+
3
+ 本文件记录 `@seeed-studio/solution-cli` 的所有重要更新与版本演进。
4
+
5
+ ---
6
+
7
+ ## [0.4.6] - 2026-10-20
8
+
9
+ ### 新增功能 (Added)
10
+ - **方案成功案例接入与动态检索 (`cases`)**:
11
+ - `hub get <id> --section cases` 支持在线拉取方案落地成功案例集合(Typesense `cc_success_cases` 集合与 Solution `related_posts` 融合),支持多语言与真实带 UTM 归因的落地页链接。
12
+ - 搜索结果(`hub search`)直出落地案例计数值,提供直观的客户落地证据。
13
+ - **单篇案例完整正文下钻 (`case get`)**:
14
+ - 新增顶层命令 `solution-cli case get <id_or_slug> [--locale zh|en|ja] [--json]`,支持获取 2000+ 字完整 Markdown 正文(`body_md`)、现场背景、工况挑战、合作伙伴与硬件清单。
15
+ - **产品模块渐进式披露与字段裁剪 (`--section`)**:
16
+ - `product search` 与 `product query` 新增 `--section <overview|power|interfaces|specs|all>` 支持:
17
+ - `--section power`:专用于供电、线缆、开箱即用与必需配件分析,裁剪掉无关网络接口与算力字段,大幅缩减上下文占用;
18
+ - `--section interfaces`:仅保留板载接口、通信协议与 I/O 外设扩展槽;
19
+ - `--section overview`:仅保留家族简介与各 SKU 开箱判定简述。
20
+ - **中文硬件泛称同义词匹配**:
21
+ - 针对“树莓派”、“工控机”等中文通用行业用词内置分词同义词表与在线回退匹配,避免直接搜索中文硬件无结果。
22
+ - **场景化防回退 Benchmark 评测套件**:
23
+ - 新增 `npm run benchmark`(18 个端到端用户场景),覆盖方案咨询、案例下钻、硬件开箱判定、同义词、芯片避坑、离线降级与部署契约。
24
+
25
+ ### 体验与文档优化 (Documentation)
26
+ - **Agent Skill 技能升级**:更新 `SKILL.md` 与 `consult-and-select.md`,补充成功案例下钻与产品字段裁剪指引。
27
+
28
+ ---
29
+
30
+ ## [0.4.5] - 2026-10-19
31
+
32
+ ### 新增功能 (Added)
33
+ - **方案数据接口与参数自省 (`schema`)**:
34
+ - 新增 `schema` 命令,支持一键查询应用对外提供的数据接口(MQTT Topic、REST API 端点、TCP 语音/流媒体端口及数据格式),方便快速接入自有系统或数据库。
35
+ - 支持直接导出部署参数的标准 Draft-07 JSON Schema,包含默认值和条件依赖。
36
+ - **命令行直接传参部署 (`--input` / `--inputs-file`)**:
37
+ - 支持在部署时通过 `-i 参数名=值`(或 `-i 步骤.参数名=值`)直接传递参数,无需再手写多层 JSON 文件。
38
+ - 支持通过 `--inputs-file` 读取 YAML/JSON 配置文件批量传参。
39
+ - **已部署应用自动更新 (`--replace-existing`)**:
40
+ - 修改参数重新部署时,自动停止并替换已有冲突容器,快速应用新配置并重启服务。
41
+
42
+ ### 体验与文档优化 (Documentation)
43
+ - **Agent Skill 技能升级**:同步更新内置 AI 助手技能(支持 Claude Code, Codex, 豆包等),增加数据接入自省与无头入参推荐范式。
44
+
45
+ ---
46
+
47
+ ## [0.4.4] - 2026-10-15
48
+
49
+ ### 问题修复 (Fixed)
50
+ - 修复 Windows 与 macOS 环境下软链接创建异常,完善跨平台目录同步回退。
51
+ - 修复豆包工作(Doubao Work)技能路径协同问题。
52
+
53
+ ### 体验与文档优化 (Documentation)
54
+ - 补充各支持 Agent 的 CLI 指令集与硬件排错踩坑库(gotchas)参考。
55
+
56
+ ---
57
+
58
+ ## [0.4.3] - 2026-10-14
59
+
60
+ ### 问题修复 (Fixed)
61
+ - 修复 Agent 环境识别中的路径加载与语法异常。
62
+
63
+ ---
64
+
65
+ ## [0.4.2] - 2026-10-14
66
+
67
+ ### 体验与优化 (Improved)
68
+ - 规范并增强豆包工作(Doubao Work)技能的本地扫描发现路径。
69
+
70
+ ---
71
+
72
+ ## [0.4.1] - 2026-10-13
73
+
74
+ ### 体验与优化 (Improved)
75
+ - 增强硬件与配件匹配规则:优化电源线、电池及多国适配插头的识别过滤,准确识别开箱即用状态。
76
+
77
+ ---
78
+
79
+ ## [0.4.0] - 2026-10-13
80
+
81
+ ### 新增功能 (Added)
82
+ - **硬件开箱即用与包装清单查询**:支持精准查询硬件是否随附电源、盒内清单、外设接口与支持的落地场景。
83
+ - **Hermes Agent 支持**:新增对 Hermes Agent 的环境检测与技能自动安装支持。
84
+ - **Agent 架构解耦**:将豆包工作与 WorkBuddy 解耦为独立配置管理。
package/README.md CHANGED
@@ -9,7 +9,7 @@ Install the signed Rust deployment engine and the `solution-cli` AI Agent Skill
9
9
 
10
10
  | 目标 AI 宿主 | 专属安装命令(直接复制发给 AI 或在终端运行) | 技能挂载路径 |
11
11
  |---|---|---|
12
- | **豆包工作 (Doubao Work)** | `npm install -g @seeed-studio/solution-cli && solution-cli install --agent doubao` | `~/Doubao/skills` (及 `~/.agents/skills`) |
12
+ | **豆包工作 (Doubao Work)** | `npm install -g @seeed-studio/solution-cli && solution-cli install --agent doubao` | `~/Doubao/skills` (Windows: `%USERPROFILE%\Doubao\skills`;及 `~/.agents/skills`) |
13
13
  | **Claude Code** | `npm install -g @seeed-studio/solution-cli && solution-cli install --agent claude` | `~/.claude/skills` |
14
14
  | **OpenAI Codex** | `npm install -g @seeed-studio/solution-cli && solution-cli install --agent codex` | `~/.agents/skills` 或 `~/.codex/skills` |
15
15
  | **Google Antigravity** | `npm install -g @seeed-studio/solution-cli && solution-cli install --agent antigravity` | `~/.gemini/config/skills` |
@@ -103,6 +103,9 @@ npx -y @seeed-studio/solution-cli product query recomputer_j40 --json
103
103
  | Command | Purpose |
104
104
  |---|---|
105
105
  | `solution-cli install --agent <agent-id> -y` | Install or update the signed Engine and Skill |
106
+ | `solution-cli update` | Check for Engine/content updates and sync installed AI Agent skills |
107
+ | `solution-cli agent list [--json]` | List supported AI agent hosts and their skill directories |
108
+ | `solution-cli gotchas [keyword] [--chip <chip>]` | Query edge hardware, chip troubleshooting & caveats |
106
109
  | `solution-cli hub search "<query>" --json` | Find solution scenarios and reference designs |
107
110
  | `solution-cli product query <family-id> --json` | Read hardware family specifications |
108
111
  | `solution-cli product accessories <family-id> --json` | Check required and compatible accessories |
package/bin/cli.js CHANGED
@@ -4,7 +4,7 @@ import path from 'node:path';
4
4
  import { fileURLToPath } from 'node:url';
5
5
  import { runInstall, runUpdate, listAgents, runStatus, runUninstall } from '../lib/installer.js';
6
6
  import { runDoctor } from '../lib/doctor.js';
7
- import { searchHub, listHub, getHubRecord, loadKnowledgeCore, queryProductFamily, searchProducts, queryAccessories, createDeploymentLockfile } from '../lib/knowledge.js';
7
+ import { searchHub, listHub, getHubRecord, getHubRecordAsync, getCaseRecord, loadKnowledgeCore, queryProductFamily, searchProducts, searchProductsAsync, queryAccessories, createDeploymentLockfile, PRODUCT_SECTIONS } from '../lib/knowledge.js';
8
8
  import { assertCompatibility } from '../lib/compatibility.js';
9
9
  import { searchGotchas } from '../lib/gotchas.js';
10
10
 
@@ -33,10 +33,12 @@ Commands:
33
33
  hub Search scenarios and reference designs from Seeed Solution Hub
34
34
  Usage: solution-cli hub search <keyword> [--limit 5] [--locale zh|en|ja] [--json]
35
35
  solution-cli hub list [--type scenario|tech|reference_design] [--page N] [--limit 50] [--locale zh|en|ja] [--json]
36
- solution-cli hub get <id> [--type ...] [--section overview|links|description|architecture|products|deployment|playbook|integration] [--preset <id>] [--locale zh|en|ja] [--json]
36
+ solution-cli hub get <id> [--type ...] [--section overview|links|description|architecture|products|deployment|playbook|integration|cases] [--preset <id>] [--locale zh|en|ja] [--json]
37
+ case Retrieve full story, body markdown, and details of a success case
38
+ Usage: solution-cli case get <id_or_slug> [--locale zh|en|ja] [--json]
37
39
  product Query product families, SKUs, physical interfaces, box contents, and verified accessories
38
- Usage: solution-cli product search <keyword|model|sku> [--limit 5] [--locale zh|en|ja] [--json]
39
- solution-cli product query <family_id> [--locale zh|en|ja] [--json]
40
+ Usage: solution-cli product search <keyword|model|sku> [--section overview|power|interfaces|specs|all] [--limit 5] [--locale zh|en|ja] [--json]
41
+ solution-cli product query <family_id> [--section overview|power|interfaces|specs|all] [--locale zh|en|ja] [--json]
40
42
  solution-cli product accessories <family_id> [--sku <sku>] [--category <cats>] [--compact] [--json]
41
43
  solution-cli product verify-compatibility --host <family_id> [--json]
42
44
  gotchas Search edge hardware and chip troubleshooting knowledge (RK3588, reCamera, Jetson, Hailo)
@@ -210,7 +212,8 @@ function validateCommandFlags(command, flags) {
210
212
  doctor: ['--json'],
211
213
  agent: ['--json'],
212
214
  hub: ['--json', '--compact', '--locale', '--limit', '--page', '--type', '--section', '--sections', '--preset'],
213
- product: ['--json', '--compact', '--locale', '--sku', '--host', '--accessory', '--category', '--limit'],
215
+ case: ['--json', '--locale'],
216
+ product: ['--json', '--compact', '--locale', '--sku', '--host', '--accessory', '--category', '--limit', '--section'],
214
217
  gotchas: ['--json', '--chip'],
215
218
  lockfile: ['--json', '--solution', '--version', '--hardware'],
216
219
  help: [],
@@ -310,6 +313,22 @@ function renderSectionOutput(r, section) {
310
313
  console.log('\n \x1b[35m[系统快速对接指引]\x1b[0m');
311
314
  r.integration.system_ingestion_guide.forEach((g) => console.log(` ${g}`));
312
315
  }
316
+ } else if (section === 'cases') {
317
+ console.log(` \x1b[36m[成功案例与客户实践 (Case Studies & Success Stories)]\x1b[0m`);
318
+ console.log(` 数据来源: ${r.cases?.source || 'bundled_manifest'} | 状态: ${r.cases?.availability || 'unavailable'}`);
319
+ const items = r.cases?.items || [];
320
+ if (items.length === 0) {
321
+ console.log(' 暂无结构化案例或当前处于离线状态。');
322
+ } else {
323
+ items.forEach((item, idx) => {
324
+ console.log(`\n \x1b[32m[案例 ${idx + 1}]\x1b[0m \x1b[1m${item.title}\x1b[0m`);
325
+ if (item.industry?.length) console.log(` 🏷️ 行业分类: ${item.industry.join(', ')}`);
326
+ if (item.region?.length) console.log(` 🌍 落地地区: ${item.region.join(', ')}`);
327
+ if (item.hardware?.length) console.log(` 🛠️ 采用硬件: ${item.hardware.join(', ')}`);
328
+ if (item.description) console.log(` 💡 案例概述: ${item.description}`);
329
+ if (item.url) console.log(` 🔗 详情链接: ${item.url}`);
330
+ });
331
+ }
313
332
  }
314
333
  }
315
334
 
@@ -403,7 +422,7 @@ async function main() {
403
422
  const listLimit = flags.usedFlags.has('--limit') ? flags.limit : 50;
404
423
  dto = listHub({ type: flags.type, locale: flags.locale, page: flags.page, limit: listLimit });
405
424
  } else if (sub === 'get') {
406
- const row = getHubRecord(flags.positionals[1], {
425
+ const row = await getHubRecordAsync(flags.positionals[1], {
407
426
  type: flags.type,
408
427
  locale: flags.locale,
409
428
  section: flags.section,
@@ -415,16 +434,17 @@ async function main() {
415
434
  process.exit(1);
416
435
  }
417
436
  const core = loadKnowledgeCore();
437
+ const rowSource = row.cases?.source === 'typesense' ? 'typesense' : 'bundled_manifest';
418
438
  dto = {
419
439
  records: [row],
420
- source: 'bundled_manifest',
440
+ source: rowSource,
421
441
  freshness: 'UNKNOWN',
422
442
  dataset_version: core.dataset_version || null,
423
443
  build_time: core.build_time || null,
424
444
  provenance: core.provenance || null,
425
- scope: 'bundled_catalog_snapshot',
445
+ scope: rowSource === 'typesense' ? 'typesense' : 'bundled_catalog_snapshot',
426
446
  locale: flags.locale,
427
- warnings: [],
447
+ warnings: row.warnings || [],
428
448
  };
429
449
  } else {
430
450
  const query = flags.positionals.slice(1).join(' ');
@@ -477,6 +497,9 @@ async function main() {
477
497
  }).join(', ');
478
498
  console.log(` Available Sections: ${sectionSummary}`);
479
499
  }
500
+ if (r.cases_count > 0) {
501
+ console.log(` \x1b[32m成功案例:\x1b[0m ${r.cases_count} 个落地案例 (使用 hub get ${r.id} --section cases 查看详情)`);
502
+ }
480
503
  console.log('');
481
504
  });
482
505
  }
@@ -515,13 +538,24 @@ async function main() {
515
538
  }
516
539
  const familyId = queryTarget;
517
540
 
541
+ const productSection = flags.usedFlags.has('--section') ? String(flags.section).toLowerCase().trim() : 'all';
542
+ if (!PRODUCT_SECTIONS.has(productSection)) {
543
+ console.error(`Unsupported product section "${flags.section}". Supported: ${Array.from(PRODUCT_SECTIONS).join(', ')}.`);
544
+ process.exit(1);
545
+ }
546
+
518
547
  if (sub === 'search') {
519
548
  const q = (rawFirst === 'search' ? flags.positionals.slice(1).join(' ') : queryTarget) || '';
520
549
  if (!q.trim()) {
521
550
  console.error('Please specify a search query (e.g. "solution-cli product search J4012 Super")');
522
551
  process.exit(1);
523
552
  }
524
- const dto = searchProducts({ query: q, locale: flags.locale, limit: flags.limit ? parseInt(flags.limit, 10) : 5 });
553
+ const dto = await searchProductsAsync({
554
+ query: q,
555
+ locale: flags.locale,
556
+ limit: flags.limit ? parseInt(flags.limit, 10) : 5,
557
+ section: productSection,
558
+ });
525
559
  if (flags.json) {
526
560
  console.log(JSON.stringify(dto, null, 2));
527
561
  } else {
@@ -531,64 +565,130 @@ async function main() {
531
565
  console.log(`\n🔍 找到 ${dto.records.length} 个匹配的硬件产品族:`);
532
566
  dto.records.forEach((fam) => {
533
567
  console.log(`\n======================================================================`);
534
- console.log(`📦 \x1b[1m${fam.title}\x1b[0m (Family ID: \x1b[36m${fam.family_id}\x1b[0m)`);
568
+ const sectionTag = productSection !== 'all' ? ` \x1b[33m[Section: ${productSection}]\x1b[0m` : '';
569
+ console.log(`📦 \x1b[1m${fam.title}\x1b[0m (Family ID: \x1b[36m${fam.family_id}\x1b[0m)${sectionTag}`);
535
570
  if (fam.summary) console.log(` 💡 简介: ${fam.summary}`);
536
- if (fam.interfaces?.length) console.log(` 🔌 板载接口 (Interfaces): ${fam.interfaces.join(', ')}`);
537
- if (fam.protocols?.length) console.log(` 📡 通信协议 (Protocols): ${fam.protocols.join(', ')}`);
538
-
539
- if (fam.supported_scenarios?.length) {
540
- console.log(` 🚀 官方落地方案 (该设备可以干嘛):`);
541
- fam.supported_scenarios.slice(0, 5).forEach((sc) => {
542
- const scTitle = sc.title?.[flags.locale] || sc.title?.zh || sc.title?.en || sc.id;
543
- console.log(` - \x1b[32m${scTitle}\x1b[0m (ID: ${sc.id})`);
544
- });
545
- }
546
571
 
547
- if (fam.matched_skus?.length) {
548
- console.log(` 🎯 具体型号 (SKU) & 开箱配置:`);
549
- fam.matched_skus.forEach((s) => {
550
- console.log(` --------------------------------------------------`);
551
- console.log(` SKU: \x1b[1m${s.sku}\x1b[0m | 型号: ${s.model || '标准款'} | 名称: ${s.name}`);
552
- if (s.ai_performance) console.log(` ⚡ 算力: ${s.ai_performance}`);
553
-
554
- // Power & Readiness summary
555
- if (s.package_profile?.readiness_summary) {
556
- const icon = s.package_profile.out_of_the_box_ready ? '\x1b[32m✔ 开箱即用\x1b[0m' : '\x1b[33m⚠️ 无法直接开机/需配件\x1b[0m';
557
- console.log(` ⚡ 开箱状态: ${icon}`);
558
- console.log(` ${s.package_profile.readiness_summary}`);
559
- } else if (s.power.adapter_included === true) {
560
- console.log(` 🔌 电源适配器: \x1b[32m✔ 随附\x1b[0m (${s.power.adapter_spec || s.power.input_voltage || '标配适配器'})`);
561
- } else if (s.power.adapter_included === false) {
562
- console.log(` 🔌 电源适配器: \x1b[31m✖ 不随附\x1b[0m (需要自备或加配: ${s.power.adapter_spec || s.power.input_voltage || '需外接电源'})`);
563
- } else if (s.power.input_voltage) {
564
- console.log(` 🔌 供电要求: ${s.power.input_voltage} ${s.power.input_connector || ''}`);
565
- }
566
-
567
- // Required accessories if any
568
- if (s.required_accessories?.length) {
569
- console.log(` 🔌 必需加配配件:`);
570
- s.required_accessories.forEach((acc) => {
571
- console.log(` • \x1b[1m${acc.name}\x1b[0m (SKU: ${acc.sku || 'N/A'})${acc.reason ? ` - ${acc.reason}` : ''}`);
572
- });
573
- }
574
-
575
- // Package contents
576
- if (s.package_contents?.length) {
577
- console.log(` 📦 包装清单 (Box Contents):`);
578
- s.package_contents.forEach((item) => console.log(` • ${item}`));
579
- }
580
-
581
- // I/O ports
582
- if (s.io_ports?.length) {
583
- const portSummary = s.io_ports.map((p) => `${p.count}x ${p.type}${p.notes ? ` (${p.notes})` : ''}`).join(', ');
584
- console.log(` 🖥️ 外设端口 (I/O Ports): ${portSummary}`);
585
- }
586
-
587
- if (s.url) console.log(` 🔗 购买链接: ${s.url}`);
588
- });
572
+ if (productSection === 'power') {
573
+ if (fam.matched_skus?.length) {
574
+ console.log(` 🎯 型号供电与开箱配置:`);
575
+ fam.matched_skus.forEach((s) => {
576
+ console.log(` --------------------------------------------------`);
577
+ console.log(` SKU: \x1b[1m${s.sku}\x1b[0m | 型号: ${s.model || '标准款'} | 名称: ${s.name}`);
578
+ if (s.package_profile?.readiness_summary) {
579
+ const icon = s.package_profile.out_of_the_box_ready ? '\x1b[32m✔ 开箱即用\x1b[0m' : '\x1b[33m⚠️ 无法直接开机/需配件\x1b[0m';
580
+ console.log(` ⚡ 开箱状态: ${icon}`);
581
+ console.log(` ${s.package_profile.readiness_summary}`);
582
+ } else if (s.power?.adapter_included === true) {
583
+ console.log(` 🔌 电源适配器: \x1b[32m✔ 随附\x1b[0m (${s.power.adapter_spec || s.power.input_voltage || '标配适配器'})`);
584
+ } else if (s.power?.adapter_included === false) {
585
+ console.log(` 🔌 电源适配器: \x1b[31m✖ 不随附\x1b[0m (需要自备或加配: ${s.power.adapter_spec || s.power.input_voltage || '需外接电源'})`);
586
+ } else if (s.power?.input_voltage) {
587
+ console.log(` 🔌 供电要求: ${s.power.input_voltage} ${s.power.input_connector || ''}`);
588
+ }
589
+ if (s.required_accessories?.length) {
590
+ console.log(` 🔌 必需加配配件:`);
591
+ s.required_accessories.forEach((acc) => {
592
+ console.log(` • \x1b[1m${acc.name}\x1b[0m (SKU: ${acc.sku || 'N/A'})${acc.reason ? ` - ${acc.reason}` : ''}`);
593
+ });
594
+ }
595
+ if (s.package_contents?.length) {
596
+ console.log(` 📦 包装清单: ${s.package_contents.join(', ')}`);
597
+ }
598
+ if (s.url) console.log(` 🔗 购买链接: ${s.url}`);
599
+ });
600
+ }
601
+ } else if (productSection === 'interfaces') {
602
+ if (fam.interfaces?.length) console.log(` 🔌 板载接口 (Interfaces): ${fam.interfaces.join(', ')}`);
603
+ if (fam.protocols?.length) console.log(` 📡 通信协议 (Protocols): ${fam.protocols.join(', ')}`);
604
+ if (fam.matched_skus?.length) {
605
+ console.log(` 🎯 型号外设端口与扩展:`);
606
+ fam.matched_skus.forEach((s) => {
607
+ console.log(` --------------------------------------------------`);
608
+ console.log(` SKU: \x1b[1m${s.sku}\x1b[0m | 型号: ${s.model || '标准款'} | 名称: ${s.name}`);
609
+ if (s.interfaces?.length) console.log(` 🔌 接口: ${s.interfaces.join(', ')}`);
610
+ if (s.io_ports?.length) {
611
+ const portSummary = s.io_ports.map((p) => `${p.count}x ${p.type}${p.notes ? ` (${p.notes})` : ''}`).join(', ');
612
+ console.log(` 🖥️ 外设端口: ${portSummary}`);
613
+ }
614
+ if (s.expansion_slots?.length) {
615
+ const slotSummary = s.expansion_slots.map((sl) => `${sl.type}`).join(', ');
616
+ console.log(` 🧩 扩展槽位: ${slotSummary}`);
617
+ }
618
+ if (s.url) console.log(` 🔗 购买链接: ${s.url}`);
619
+ });
620
+ }
621
+ } else if (productSection === 'overview') {
622
+ if (fam.matched_skus?.length) {
623
+ console.log(` 🎯 SKU 概览 (${fam.matched_skus.length} 款):`);
624
+ fam.matched_skus.forEach((s) => {
625
+ const icon = s.out_of_the_box_ready ? '\x1b[32m✔\x1b[0m' : '\x1b[33m⚠️\x1b[0m';
626
+ console.log(` - SKU: \x1b[1m${s.sku}\x1b[0m (${s.model || '标准款'}) | ${s.name} [${icon} ${s.readiness_summary || ''}]`);
627
+ if (s.url) console.log(` 链接: ${s.url}`);
628
+ });
629
+ }
630
+ } else {
631
+ // all or specs
632
+ if (fam.interfaces?.length) console.log(` 🔌 板载接口 (Interfaces): ${fam.interfaces.join(', ')}`);
633
+ if (fam.protocols?.length) console.log(` 📡 通信协议 (Protocols): ${fam.protocols.join(', ')}`);
634
+
635
+ if (fam.supported_scenarios?.length) {
636
+ console.log(` 🚀 官方落地方案 (该设备可以干嘛):`);
637
+ fam.supported_scenarios.slice(0, 5).forEach((sc) => {
638
+ const scTitle = sc.title?.[flags.locale] || sc.title?.zh || sc.title?.en || sc.id;
639
+ console.log(` - \x1b[32m${scTitle}\x1b[0m (ID: ${sc.id})`);
640
+ });
641
+ }
642
+
643
+ if (fam.matched_skus?.length) {
644
+ console.log(` 🎯 具体型号 (SKU) & 开箱配置:`);
645
+ fam.matched_skus.forEach((s) => {
646
+ console.log(` --------------------------------------------------`);
647
+ console.log(` SKU: \x1b[1m${s.sku}\x1b[0m | 型号: ${s.model || '标准款'} | 名称: ${s.name}`);
648
+ if (s.ai_performance) console.log(` ⚡ 算力: ${s.ai_performance}`);
649
+
650
+ // Power & Readiness summary
651
+ if (s.package_profile?.readiness_summary) {
652
+ const icon = s.package_profile.out_of_the_box_ready ? '\x1b[32m✔ 开箱即用\x1b[0m' : '\x1b[33m⚠️ 无法直接开机/需配件\x1b[0m';
653
+ console.log(` ⚡ 开箱状态: ${icon}`);
654
+ console.log(` ${s.package_profile.readiness_summary}`);
655
+ } else if (s.power?.adapter_included === true) {
656
+ console.log(` 🔌 电源适配器: \x1b[32m✔ 随附\x1b[0m (${s.power.adapter_spec || s.power.input_voltage || '标配适配器'})`);
657
+ } else if (s.power?.adapter_included === false) {
658
+ console.log(` 🔌 电源适配器: \x1b[31m✖ 不随附\x1b[0m (需要自备或加配: ${s.power.adapter_spec || s.power.input_voltage || '需外接电源'})`);
659
+ } else if (s.power?.input_voltage) {
660
+ console.log(` 🔌 供电要求: ${s.power.input_voltage} ${s.power.input_connector || ''}`);
661
+ }
662
+
663
+ // Required accessories if any
664
+ if (s.required_accessories?.length) {
665
+ console.log(` 🔌 必需加配配件:`);
666
+ s.required_accessories.forEach((acc) => {
667
+ console.log(` • \x1b[1m${acc.name}\x1b[0m (SKU: ${acc.sku || 'N/A'})${acc.reason ? ` - ${acc.reason}` : ''}`);
668
+ });
669
+ }
670
+
671
+ // Package contents
672
+ if (s.package_contents?.length) {
673
+ console.log(` 📦 包装清单 (Box Contents):`);
674
+ s.package_contents.forEach((item) => console.log(` • ${item}`));
675
+ }
676
+
677
+ // I/O ports
678
+ if (s.io_ports?.length) {
679
+ const portSummary = s.io_ports.map((p) => `${p.count}x ${p.type}${p.notes ? ` (${p.notes})` : ''}`).join(', ');
680
+ console.log(` 🖥️ 外设端口 (I/O Ports): ${portSummary}`);
681
+ }
682
+
683
+ if (s.url) console.log(` 🔗 购买链接: ${s.url}`);
684
+ });
685
+ }
589
686
  }
590
687
  });
591
688
  console.log(`\n💡 提示: 查看该设备必需与推荐配件请使用: solution-cli product accessories <family_id>`);
689
+ if (productSection === 'all') {
690
+ console.log(`💡 渐进式披露建议: 可使用 --section <overview|power|interfaces|specs> 按需裁剪输出减少上下文占用。`);
691
+ }
592
692
  }
593
693
  }
594
694
  } else if (sub === 'query') {
@@ -596,7 +696,7 @@ async function main() {
596
696
  console.error('Please specify a product family ID (e.g. "solution-cli product query recomputer_j40")');
597
697
  process.exit(1);
598
698
  }
599
- const dto = queryProductFamily(familyId, { locale: flags.locale });
699
+ const dto = queryProductFamily(familyId, { locale: flags.locale, section: productSection });
600
700
  if (flags.json) {
601
701
  console.log(JSON.stringify(dto, null, 2));
602
702
  } else {
@@ -715,6 +815,57 @@ async function main() {
715
815
  break;
716
816
  }
717
817
 
818
+ case 'case': {
819
+ const rawFirst = flags.positionals[0];
820
+ let sub = rawFirst;
821
+ let targetSlug = flags.positionals[1];
822
+
823
+ if (sub !== 'get') {
824
+ // Auto routing: solution-cli case <slug_or_id>
825
+ targetSlug = flags.positionals.join(' ');
826
+ sub = 'get';
827
+ }
828
+
829
+ if (!targetSlug || !targetSlug.trim()) {
830
+ console.error('Please specify a case slug or ID (e.g. "solution-cli case get rice-pest-and-disease-monitoring-solution-to-ensure-a-bountiful-harvest")');
831
+ process.exit(1);
832
+ }
833
+
834
+ const dto = await getCaseRecord(targetSlug.trim(), { locale: flags.locale });
835
+ if (flags.json) {
836
+ console.log(JSON.stringify(dto, null, 2));
837
+ } else {
838
+ if (dto.records.length === 0) {
839
+ console.log(`未找到案例 "${targetSlug}"。${dto.warnings?.join(' ') || ''}`);
840
+ } else {
841
+ const c = dto.records[0];
842
+ console.log(`\n======================================================================`);
843
+ console.log(`📖 \x1b[1m${c.title}\x1b[0m (ID: \x1b[36m${c.id}\x1b[0m)`);
844
+ if (c.slug) console.log(` Slug: ${c.slug}`);
845
+ if (c.solution_ids?.length) console.log(` 🚀 关联方案 (Solution IDs): ${c.solution_ids.join(', ')}`);
846
+ if (c.hardware?.length) console.log(` 📦 使用硬件: ${c.hardware.join(', ')}`);
847
+ if (c.industry?.length || c.region?.length) {
848
+ const meta = [];
849
+ if (c.region?.length) meta.push(`地区: ${c.region.join(', ')}`);
850
+ if (c.industry?.length) meta.push(`行业: ${c.industry.join(', ')}`);
851
+ console.log(` 🌍 ${meta.join(' | ')}`);
852
+ }
853
+ if (c.url) console.log(` 🔗 案例原文: ${c.url}`);
854
+ if (c.excerpt) console.log(`\n💡 \x1b[33m摘要:\x1b[0m\n ${c.excerpt.replace(/\n/g, '\n ')}`);
855
+ if (c.body_md) {
856
+ console.log(`\n📄 \x1b[32m案例正文 (Full Story):\x1b[0m`);
857
+ console.log(`----------------------------------------------------------------------`);
858
+ console.log(c.body_md);
859
+ console.log(`----------------------------------------------------------------------`);
860
+ }
861
+ }
862
+ if (dto.warnings?.length) {
863
+ dto.warnings.forEach((w) => console.log(`\x1b[33mNote:\x1b[0m ${w}`));
864
+ }
865
+ }
866
+ break;
867
+ }
868
+
718
869
  case 'gotchas': {
719
870
  const query = flags.positionals.join(' ');
720
871
  const results = searchGotchas({ query, chip: flags.chip });
@@ -5,6 +5,7 @@
5
5
  "host": "https://rel-search.seeedstudio.com",
6
6
  "search_key_solution": "dNsKBp0Pepdz9tvyIY1O92EMOM00XCHv",
7
7
  "search_key_reference_design": "rEy4VhZnqEmrduFG2e8uvfWMz5ZzXhjb",
8
- "search_key_purchase_profile": ""
8
+ "search_key_purchase_profile": "YrowCXcDOGTt9KedslTEmeY0ZJEhlBml",
9
+ "search_key_cc_success_cases": "FIVCfDzHtAaZLbAXBa0DAFD7DKyqYCxm"
9
10
  }
10
11
  }
package/docs/cli-guide.md CHANGED
@@ -34,7 +34,7 @@ Agent 的默认工作流是“先咨询,再选型,再检查,最后在用
34
34
 
35
35
  | 目标 AI 宿主平台 | 专属安装命令(直接复制发给 AI 或在终端运行) | 技能默认配置路径 |
36
36
  |---|---|---|
37
- | **豆包工作 (Doubao Work)** | `npm install -g @seeed-studio/solution-cli && solution-cli install --agent doubao` | `~/Doubao/skills` (及 `~/.agents/skills`) |
37
+ | **豆包工作 (Doubao Work)** | `npm install -g @seeed-studio/solution-cli && solution-cli install --agent doubao` | `~/Doubao/skills` (Windows: `%USERPROFILE%\Doubao\skills`;及 `~/.agents/skills`) |
38
38
  | **Claude Code** | `npm install -g @seeed-studio/solution-cli && solution-cli install --agent claude` | `~/.claude/skills` |
39
39
  | **OpenAI Codex** | `npm install -g @seeed-studio/solution-cli && solution-cli install --agent codex` | `~/.agents/skills` 或 `~/.codex/skills` |
40
40
  | **Google Antigravity** | `npm install -g @seeed-studio/solution-cli && solution-cli install --agent antigravity` | `~/.gemini/config/skills` |
@@ -255,14 +255,26 @@ solution-cli status
255
255
 
256
256
  查看 Engine 路径、版本、内容缓存和 Skill 挂载状态。
257
257
 
258
- ### 3. 网络与源排查
258
+ ### 3. 日常更新同步(solution-cli update)
259
+
260
+ 当官方发布了新的硬件知识库、避坑指南或部署契约更新时,运行以下命令即可增量同步所有已配置的 Agent 技能与本地 Engine:
261
+
262
+ ```bash
263
+ solution-cli update
264
+ ```
265
+
266
+ 该命令会自动:
267
+ 1. 检查并拉取最新稳定的 `sensecraft-engine` 核心二进制与云端方案目录。
268
+ 2. 扫描已安装的全部 AI 宿主(如豆包、Claude、Codex 等),安全增量同步最新的 Skill 文件(保留用户的自定义修改)。
269
+
270
+ ### 4. 网络与源排查
259
271
 
260
272
  若遇到 npm 下载或同步延迟,可在命令中显式指定官方源:
261
273
  ```bash
262
274
  npx -y --registry=https://registry.npmjs.org/ @seeed-studio/solution-cli install -y
263
275
  ```
264
276
 
265
- ### 4. 干净卸载
277
+ ### 5. 干净卸载
266
278
 
267
279
  只卸载指定宿主,并先备份需要保留的用户修改:
268
280