smart-search-cli
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSmart Search CLI
Smart Search CLI
Use the local command as the default execution layer for web research. The skill decides routing; the CLI performs the work; JSON or saved files provide evidence.
smart-search将本地命令作为网页研究的默认执行层。由Skill决定路由;CLI执行具体操作;JSON或保存的文件提供证据。
smart-searchDefault workflow
默认工作流程
- Run when configuration or availability is uncertain.
smart-search doctor --format json - If reports missing configuration, use
doctororsmart-search setupwhen the user provides keys. Do not ask users to edit global environment variables by default.smart-search config set KEY VALUE - If returns
doctor, use onlyok: trueCLI subcommands for web research. Do not call Codex native web search in the same task.smart-search - Use after CLI/provider architecture changes. Use
smart-search smoke --mock --format jsononly when real keys are available and the user expects live checks.--live - Use for realtime, broad, community, or multi-source synthesis.
smart-search search - Use for official documentation, API references, papers, and low-noise source discovery.
smart-search exa-search - Use /
smart-search context7-libraryonly for library, SDK, API, framework, or documentation intent.context7-docs - Use for Chinese, domestic, current, or domain-filtered web source discovery.
smart-search zhipu-search - Use only for experimental AnySearch acceptance and vertical-domain boundary tests; do not treat it as the default web-search or fetch fallback.
smart-search anysearch-* - Use when the user gives a representative URL and wants related pages or neighboring sources.
smart-search exa-similar - Use when the user gives a URL or a claim depends on page content.
smart-search fetch - Use when a documentation site or domain structure matters.
smart-search map - Use only to inspect explicit provider models. To change models, use
smart-search model currentorsmart-search config set XAI_MODEL ....smart-search config set OPENAI_COMPATIBLE_MODEL ... - For current-news, policy, finance, health, or other high-risk facts, do not answer from broad alone. Find reliable URLs with
search.content,exa-search, or source-focusedzhipu-search, thensearchkey pages and summarize only what the fetched text supports.fetch - Preserve command lines and source URLs in your answer. Prefer citing fetched pages or ; treat
primary_sourcesas follow-up candidates, not verified evidence for generated claims.extra_sources
- 当配置或可用性不确定时,运行。
smart-search doctor --format json - 如果报告缺少配置,在用户提供密钥时使用
doctor或smart-search setup。默认情况下不要要求用户编辑全局环境变量。smart-search config set KEY VALUE - 如果返回
doctor,仅使用ok: trueCLI子命令进行网页研究。同一任务中不要调用Codex原生网页搜索。smart-search - 在CLI/提供商架构变更后,使用。仅当有真实密钥且用户需要实时检查时才使用
smart-search smoke --mock --format json。--live - 使用进行实时、广泛、社区化或多来源的信息综合。
smart-search search - 使用查找官方文档、API参考、论文和低噪音来源。
smart-search exa-search - 仅当意图是查找库、SDK、API、框架或文档时,使用/
smart-search context7-library。context7-docs - 使用查找中文、国内、实时或域名过滤的网页来源。
smart-search zhipu-search - 仅在实验性AnySearch验收和垂直领域边界测试时使用;不要将其作为默认网页搜索或抓取的备选方案。
smart-search anysearch-* - 当用户提供代表性URL并需要相关页面或邻近来源时,使用。
smart-search exa-similar - 当用户提供URL或某个声明依赖于页面内容时,使用。
smart-search fetch - 当文档站点或域名结构很重要时,使用。
smart-search map - 仅使用检查明确的提供商模型。要更改模型,使用
smart-search model current或smart-search config set XAI_MODEL ...。smart-search config set OPENAI_COMPATIBLE_MODEL ... - 对于时事新闻、政策、金融、健康或其他高风险事实,不要仅依靠宽泛的作答。使用
search.content、exa-search或聚焦来源的zhipu-search找到可靠URL,然后search关键页面,仅总结抓取文本支持的内容。fetch - 在回答中保留命令行和来源URL。优先引用抓取的页面或;将
primary_sources视为后续候选,而非生成声明的已验证证据。extra_sources
Deep Research Mode
深度研究模式
Use Deep Research Mode when the user asks for , , , , , multi-source verification, cross-checking, serious review, or selection/comparison research. This is a capability-based orchestration workflow: the AI agent calls to get an offline plan, then composes existing CLI building blocks, the CLI executes those later commands, and JSON/Markdown files provide reproducible evidence. is a public planner entrypoint, not an executor; it does not call providers, run , or fetch pages by default. It does not change default , and it does not depend on an MCP session.
深度搜索深度调研深入搜索deep searchdeep researchsmart-search deep "question" --format jsonsmart-searchsmart-search deepdoctorsmart-search searchDo not select a fixed topic recipe. Market, product, technical docs, news, policy, claim-checking, and URL-first prompts are examples of user language, not schema modes. Decide from intent dimensions and capability needs.
Before running deep research commands, run and use the returned as your planning artifact. Use this shape:
smart-search deep "question" --format jsonresearch_planjson
{
"mode": "deep_research",
"query_mode": "deep",
"question": "user question",
"trigger_source": "explicit_cli",
"difficulty": "standard|high",
"intent_signals": {
"recency_requirement": "none|recent|current",
"docs_api_intent": false,
"locale_domain_scope": "global|china|known_domains|mixed",
"known_url": false,
"source_authority_need": "normal|high",
"claim_risk": "low|medium|high",
"cross_validation_need": "normal|high",
"breadth_depth_budget": "quick|standard|deep"
},
"decomposition": [
{
"id": "sq1",
"question": "subquestion",
"reason": "why this subquestion is needed",
"required_capabilities": ["broad_discovery"]
}
],
"capability_plan": [
{
"capability": "broad_discovery",
"tools": ["search"],
"reason": "Find the initial answer shape and candidate sources."
}
],
"preflight": {
"tool": "doctor",
"command": "smart-search doctor --format json",
"when": "configuration or availability is uncertain"
},
"evidence_policy": "fetch_before_claim",
"steps": [
{
"id": "s1",
"subquestion_id": "sq1",
"tool": "search",
"purpose": "broad discovery",
"command": "smart-search search \"query\" --validation balanced --extra-sources 1 --format json --output C:\\tmp\\smart-search-evidence\\YYYYMMDD-HHMM-topic\\01-search.json",
"output_path": "C:\\tmp\\smart-search-evidence\\YYYYMMDD-HHMM-topic\\01-search.json"
}
],
"gap_check": {
"required": true,
"rule": "fetch missing evidence for key claims or downgrade them to unverified candidates"
},
"final_answer_policy": "cite fetched evidence, list unverified candidates, and include key commands",
"usage_boundary": {
"search": "smart-search search runs live fast/broad search immediately.",
"deep": "smart-search deep is an offline planner; it does not execute provider calls or fetch pages.",
"execution": "An AI agent or user executes the listed steps with existing CLI commands, then performs gap_check."
}
}Allowed values are , , , , , , , and . Each step must include , , , , and . is preflight and must not appear in . Simple plans may have one subquestion; complex plans should use 2-6 subquestions unless the user explicitly asks for exhaustive coverage.
steps[].toolsearchexa-searchexa-similarzhipu-searchcontext7-librarycontext7-docsfetchmapidsubquestion_idpurposecommandoutput_pathdoctorsteps[]Capability boundaries:
- : broad discovery and synthesis through
search; inspectmain_search,routing_decision,provider_attempts, andfallback_used. Do not treat broad answers as proof for high-risk claims.source_warning - : low-noise discovery for official docs, APIs, papers, product pages, known domains, trusted media, and recency-filtered source search.
exa-search - : adjacent-source discovery when a known reliable URL is available.
exa-similar - : Chinese, domestic, current, or domain-filtered source discovery.
zhipu-search - /
context7-library: library, SDK, API, framework, and documentation intent only.context7-docs - : page-content evidence. Use it before claim-level conclusions.
fetch - : site structure exploration before many fetches from one site; not claim evidence by itself.
map
Default Deep Research orchestration:
- Run as preflight when configuration is uncertain.
smart-search doctor --format json - Call to create an offline
smart-search deep "question" --format json.research_plan - Inspect ,
intent_signals, anddecomposition; do not choose fixed topic recipe ids.capability_plan - Execute planned steps for broad discovery and read routing metadata.
search --validation balanced --extra-sources 1..3 - Execute planned ,
exa-search,exa-similar,zhipu-search,context7-library, orcontext7-docsonly when their capability boundary matches the intent.map - Use on key URLs before making claim-level statements.
fetch - Run : if an important claim lacks fetched evidence, fetch another source or mark the claim/source as unverified.
gap_check
Default evidence policy is : key claims in the final answer must be supported by fetched page text. Treat and as discovery candidates until the relevant URL has been fetched. The final answer should include fetched evidence, unverified candidate sources, and key commands used.
fetch_before_claimprimary_sourcesextra_sourcesDeep Research smoke matrix for workflow maintenance is mock-full plus live-limited. Mock-full coverage should include trigger phrases, normal search requests that should not trigger Deep Research, required fields, allowed tool whitelist, , evidence output paths, capability boundaries, , , , simple current prompts such as , docs/API prompts, claim-verification prompts, user-provided URL fetch-first flows, missing-provider failure guidance, and the rule that fixed topic recipe ids are not required schema. Live-limited coverage should run , one broad , one , and one only when real keys are available and the user expects live checks.
research_planfetch_before_claimintent_signalscapability_plangap_check深度搜索一下最近的比特币行情doctorsearchexa-searchfetchStandard user-facing Deep Research tests:
powershell
smart-search deep "深度搜索一下最近的比特币行情" --format json
smart-search deep "OpenAI Responses API web_search 和 Chat Completions 联网搜索怎么选" --budget deep --format json
smart-search deep "帮我核验这个说法是真是假:某某工具已经完全替代 Tavily 做 AI 搜索了" --format json
smart-search deep "https://example.com/source" --format json当用户要求、、、、、多来源验证、交叉核对、严谨审查或选型对比研究时,使用深度研究模式。这是基于能力的编排工作流:AI Agent调用获取离线计划,然后组合现有 CLI构建块,CLI执行后续命令,JSON/Markdown文件提供可复现的证据。是公共规划入口,而非执行器;默认情况下它不会调用提供商、运行或抓取页面。它不会更改默认的,也不依赖MCP会话。
深度搜索深度调研深入搜索deep searchdeep researchsmart-search deep "question" --format jsonsmart-searchsmart-search deepdoctorsmart-search search不要选择固定的主题模板。市场、产品、技术文档、新闻、政策、声明核查和以URL优先的提示是用户语言示例,而非模式类型。根据意图维度和能力需求做出决策。
运行深度研究命令前,先执行,并将返回的作为规划依据。使用以下格式:
smart-search deep "question" --format jsonresearch_planjson
{
"mode": "deep_research",
"query_mode": "deep",
"question": "user question",
"trigger_source": "explicit_cli",
"difficulty": "standard|high",
"intent_signals": {
"recency_requirement": "none|recent|current",
"docs_api_intent": false,
"locale_domain_scope": "global|china|known_domains|mixed",
"known_url": false,
"source_authority_need": "normal|high",
"claim_risk": "low|medium|high",
"cross_validation_need": "normal|high",
"breadth_depth_budget": "quick|standard|deep"
},
"decomposition": [
{
"id": "sq1",
"question": "subquestion",
"reason": "why this subquestion is needed",
"required_capabilities": ["broad_discovery"]
}
],
"capability_plan": [
{
"capability": "broad_discovery",
"tools": ["search"],
"reason": "Find the initial answer shape and candidate sources."
}
],
"preflight": {
"tool": "doctor",
"command": "smart-search doctor --format json",
"when": "configuration or availability is uncertain"
},
"evidence_policy": "fetch_before_claim",
"steps": [
{
"id": "s1",
"subquestion_id": "sq1",
"tool": "search",
"purpose": "broad discovery",
"command": "smart-search search \"query\" --validation balanced --extra-sources 1 --format json --output C:\\tmp\\smart-search-evidence\\YYYYMMDD-HHMM-topic\\01-search.json",
"output_path": "C:\\tmp\\smart-search-evidence\\YYYYMMDD-HHMM-topic\\01-search.json"
}
],
"gap_check": {
"required": true,
"rule": "fetch missing evidence for key claims or downgrade them to unverified candidates"
},
"final_answer_policy": "cite fetched evidence, list unverified candidates, and include key commands",
"usage_boundary": {
"search": "smart-search search runs live fast/broad search immediately.",
"deep": "smart-search deep is an offline planner; it does not execute provider calls or fetch pages.",
"execution": "An AI agent or user executes the listed steps with existing CLI commands, then performs gap_check."
}
}steps[].toolsearchexa-searchexa-similarzhipu-searchcontext7-librarycontext7-docsfetchmapidsubquestion_idpurposecommandoutput_pathdoctorsteps[]能力边界:
- :通过
search进行广泛发现和综合;检查main_search、routing_decision、provider_attempts和fallback_used。不要将宽泛的回答视为高风险声明的证据。source_warning - :用于查找官方文档、API、论文、产品页面、已知域名、可信媒体和按时效性过滤的来源的低噪音发现工具。
exa-search - :当有已知可靠URL时,用于发现相关来源。
exa-similar - :用于查找中文、国内、实时或域名过滤的网页来源。
zhipu-search - /
context7-library:仅用于查找库、SDK、API、框架和文档的场景。context7-docs - :页面内容证据。在得出声明级结论前使用。
fetch - :从单个站点进行多次抓取前探索站点结构;本身不构成声明证据。
map
默认深度研究编排:
- 当配置不确定时,运行作为预检查。
smart-search doctor --format json - 调用创建离线
smart-search deep "question" --format json。research_plan - 检查、
intent_signals和decomposition;不要选择固定的主题模板ID。capability_plan - 执行规划好的步骤进行广泛发现,并读取路由元数据。
search --validation balanced --extra-sources 1..3 - 仅当能力边界与意图匹配时,执行规划好的、
exa-search、exa-similar、zhipu-search、context7-library或context7-docs。map - 在做出声明级陈述前,对关键URL使用。
fetch - 执行:如果重要声明缺少抓取的证据,抓取另一个来源或将声明/来源标记为未验证。
gap_check
默认证据策略为:最终答案中的关键声明必须有抓取的页面文本支持。在相关URL被抓取前,将和视为发现候选。最终答案应包含抓取的证据、未验证的候选来源以及使用的关键命令。
fetch_before_claimprimary_sourcesextra_sources工作流维护的深度研究冒烟测试矩阵为全模拟加有限实时。全模拟覆盖应包括触发短语、不应触发深度研究的普通搜索请求、必填字段、允许的工具白名单、、证据输出路径、能力边界、、、、简单实时提示(如)、文档/API提示、声明验证提示、用户提供URL优先抓取流程、提供商缺失故障指导,以及不需要固定主题模板ID的规则。有限实时覆盖应在有真实密钥且用户需要实时检查时,仅运行、一次宽泛、一次和一次。
research_planfetch_before_claimintent_signalscapability_plangap_check深度搜索一下最近的比特币行情doctorsearchexa-searchfetch面向用户的标准深度研究测试:
powershell
smart-search deep "深度搜索一下最近的比特币行情" --format json
smart-search deep "OpenAI Responses API web_search 和 Chat Completions 联网搜索怎么选" --budget deep --format json
smart-search deep "帮我核验这个说法是真是假:某某工具已经完全替代 Tavily 做 AI 搜索了" --format json
smart-search deep "https://example.com/source" --format jsonProvider Routing
提供商路由
- builds
searchfrom configured peer providers:main_searchfor xAI Responses andXAI_API_KEY+OPENAI_COMPATIBLE_API_URLfor OpenAI-compatible Chat Completions.OPENAI_COMPATIBLE_API_KEY - Official xAI uses the Responses API route through
/responses. Compatible relays/gateways use Chat CompletionsXAI_*through/chat/completions.OPENAI_COMPATIBLE_* - or
OPENAI_COMPATIBLE_STREAM=truesetssearch --streamonly for OpenAI-compatiblestream=trueand provider-sidesearch; it is a relay compatibility switch and does not affect xAI Responses, URL description, or source ranking.fetch - Legacy ,
SMART_SEARCH_API_URL,SMART_SEARCH_API_KEY,SMART_SEARCH_API_MODE, andSMART_SEARCH_MODELare unsupported config keys.SMART_SEARCH_XAI_TOOLS - xAI Responses mode may use only and a subset of those tools.
XAI_TOOLS=web_search,x_search - Chat Completions mode must not send xAI /
web_searchtools or legacyx_search; xAI Chat Completions Live Search is deprecated.search_parameters - The standard minimum profile requires one configured provider in each of ,
main_search, and fetch capability. Missing required capabilities should be treated as a hard configuration failure.docs_search - AnySearch is reported only as optional experimental ; it is not part of the
vertical_searchfallback and is not required by theweb_searchminimum profile.standard - exposes
search,--validation fast|balanced|strict, and--fallback auto|off. Default validation is--providers auto|CSV; fallback only happens within the same capability.balanced - xAI Responses is the default main answer route for Grok/xAI. In , a failed xAI Responses main route can fall back to OpenAI-compatible only when the OpenAI-compatible provider is separately configured.
fallback=auto - Docs routing uses Exa first, then Context7 only for docs/API/SDK/library/framework intent.
- Zhipu is a general web-search reinforcement and same-capability fallback for Chinese, domestic, current, or domain-filtered source discovery.
- calls Tavily and/or Firecrawl only when
searchis greater than 0.--extra-sources N - With both Tavily and Firecrawl configured, splits extra sources between them, with Tavily receiving about 60% and Firecrawl the rest.
search --extra-sources N - Search JSON separates ,
primary_sources, and backward-compatible mergedextra_sources.sources - are extracted from the primary model answer.
primary_sourcesare parallel Tavily / Firecrawl candidates and are not automatically used to verifyextra_sources.content - tries Tavily first and uses Firecrawl only as a fallback when Tavily returns no content.
fetch - currently uses Tavily only.
map - and
exa-searchuse Exa only.exa-similar - and
context7-libraryuse Context7 only.context7-docs - ,
anysearch-domains,anysearch-search, andanysearch-extractuse AnySearch only. Treat results as acceptance evidence until the target vertical domain is reviewed.anysearch-batch - uses Zhipu only.
zhipu-search - Zhipu support currently corresponds to the official Zhipu Web Search API route, using plus
ZHIPU_API_URL; it is not Zhipu Chat CompletionsZHIPU_SEARCH_ENGINE, not Search Agent, and not the MCP Server.tools=[web_search] - defaults to
ZHIPU_SEARCH_ENGINE. Official Web Search API service values includesearch_std,search_std,search_pro, andsearch_pro_sogou; keep custom values possible because official services may change.search_pro_quark - only affects Tavily REST calls and does not proxy Zhipu. Zhipu defaults to
TAVILY_API_URLunlesshttps://open.bigmodel.cn/apiis set.ZHIPU_API_URL - tests configured main-search providers, Exa, Tavily, Zhipu, and Context7 connectivity. Firecrawl status currently means the key is configured, not that a live Firecrawl request succeeded.
doctor
- 通过配置的对等提供商构建
search:使用main_search调用xAI Responses,使用XAI_API_KEY+OPENAI_COMPATIBLE_API_URL调用兼容OpenAI的Chat Completions。OPENAI_COMPATIBLE_API_KEY - 官方xAI通过使用Responses API的
XAI_*路由。兼容中继/网关通过/responses使用Chat Completions的OPENAI_COMPATIBLE_*路由。/chat/completions - 或
OPENAI_COMPATIBLE_STREAM=true仅对兼容OpenAI的search --stream和提供商端search设置fetch;这是中继兼容性开关,不影响xAI Responses、URL描述或来源排序。stream=true - 旧版、
SMART_SEARCH_API_URL、SMART_SEARCH_API_KEY、SMART_SEARCH_API_MODE和SMART_SEARCH_MODEL为不支持的配置密钥。SMART_SEARCH_XAI_TOOLS - xAI Responses模式仅可使用及其子集工具。
XAI_TOOLS=web_search,x_search - Chat Completions模式不得发送xAI的/
web_search工具或旧版x_search;xAI Chat Completions实时搜索已弃用。search_parameters - 标准最小配置文件要求、
main_search和抓取能力各配置一个提供商。缺少所需能力应视为严重配置故障。docs_search - AnySearch仅作为可选实验性报告;它不属于
vertical_search备选方案,也不是web_search最小配置文件的必需项。standard - 支持
search、--validation fast|balanced|strict和--fallback auto|off。默认验证模式为--providers auto|CSV;仅在同一能力范围内触发备选方案。balanced - xAI Responses是Grok/xAI的默认主要回答路由。在时,xAI Responses主路由失败后仅当单独配置了兼容OpenAI的提供商时,才会回退到该提供商。
fallback=auto - 文档路由优先使用Exa,仅当意图是查找文档/API/SDK/库/框架时才回退到Context7。
- Zhipu是中文、国内、实时或域名过滤来源发现的通用网页搜索增强工具和同能力备选方案。
- 仅当大于0时,
--extra-sources N才会调用Tavily和/或Firecrawl。search - 当同时配置了Tavily和Firecrawl时,会在两者之间分配额外来源,Tavily约占60%,Firecrawl占剩余部分。
search --extra-sources N - 搜索JSON将、
primary_sources和向后兼容的合并extra_sources分开。sources - 从主模型回答中提取。
primary_sources是并行的Tavily / Firecrawl候选,不会自动用于验证extra_sources。content - 优先尝试Tavily,仅当Tavily未返回内容时才使用Firecrawl作为备选。
fetch - 目前仅使用Tavily。
map - 和
exa-search仅使用Exa。exa-similar - 和
context7-library仅使用Context7。context7-docs - 、
anysearch-domains、anysearch-search和anysearch-extract仅使用AnySearch。在目标垂直领域审核完成前,将结果视为验收证据。anysearch-batch - 仅使用Zhipu。
zhipu-search - Zhipu支持目前对应官方Zhipu网页搜索API路由,使用加
ZHIPU_API_URL;它不是Zhipu Chat Completions的ZHIPU_SEARCH_ENGINE,不是搜索Agent,也不是MCP Server。tools=[web_search] - 默认为
ZHIPU_SEARCH_ENGINE。官方网页搜索API服务值包括search_std、search_std、search_pro和search_pro_sogou;允许自定义值,因为官方服务可能变更。search_pro_quark - 仅影响Tavily REST调用,不代理Zhipu。Zhipu默认使用
TAVILY_API_URL,除非设置了https://open.bigmodel.cn/api。ZHIPU_API_URL - 测试已配置的主搜索提供商、Exa、Tavily、Zhipu和Context7的连通性。Firecrawl状态目前仅表示已配置密钥,不代表实时Firecrawl请求成功。
doctor
Evidence Files
证据文件
For multi-source research, use to save evidence under with a descriptive timestamped filename. Stdout should still contain the full JSON result unless markdown or content output was explicitly chosen for human reading.
--outputC:\tmp\smart-search-evidence\For claim-level evidence, prefer this order:
- Discover candidate URLs with or source-focused
exa-search.search - Fetch the exact pages that matter.
- Use broad only as synthesis or discovery, and mark claims as unverified when only
searchare available.extra_sources
Prefer shorter, source-directed commands:
powershell
smart-search exa-search "Reuters Iran Hormuz latest" --num-results 5 --include-highlights --format json --output C:\tmp\smart-search-evidence\iran-hormuz-exa.json
smart-search exa-search "OpenAI Responses API documentation" --include-domains platform.openai.com developers.openai.com --num-results 5 --include-text --format json
smart-search exa-similar "https://example.com/source" --num-results 5 --format json
smart-search fetch "https://example.com/source" --format json --output C:\tmp\smart-search-evidence\source-fetch.json
smart-search search "Iran Hormuz latest military talks" --extra-sources 3 --timeout 90 --format json --output C:\tmp\smart-search-evidence\iran-hormuz-search.json对于多来源研究,使用将证据保存到目录下,文件名包含描述性时间戳。除非明确选择markdown或内容输出供人类阅读,否则标准输出仍应包含完整的JSON结果。
--outputC:\tmp\smart-search-evidence\对于声明级证据,优先遵循以下顺序:
- 使用或聚焦来源的
exa-search发现候选URL。search - 抓取关键页面。
- 仅将宽泛的用于综合或发现,当仅有的来源是
search时,将声明标记为未验证。extra_sources
优先使用更简短、指向来源的命令:
powershell
smart-search exa-search "Reuters Iran Hormuz latest" --num-results 5 --include-highlights --format json --output C:\tmp\smart-search-evidence\iran-hormuz-exa.json
smart-search exa-search "OpenAI Responses API documentation" --include-domains platform.openai.com developers.openai.com --num-results 5 --include-text --format json
smart-search exa-similar "https://example.com/source" --num-results 5 --format json
smart-search fetch "https://example.com/source" --format json --output C:\tmp\smart-search-evidence\source-fetch.json
smart-search search "Iran Hormuz latest military talks" --extra-sources 3 --timeout 90 --format json --output C:\tmp\smart-search-evidence\iran-hormuz-search.jsonLocal wrapper contract
本地包装器约定
- Expect to resolve from the user's PATH.
smart-search - This bundled skill is maintained with the repository.
smartsearch - Prefer the CLI's local config file managed by /
smart-search setup.smart-search config - Environment variables remain supported for CI and advanced users, and override the local config file.
- Do not ask users to set Windows global API-key environment variables by default.
- If keys are changed with , rerun the CLI; no Codex restart is needed.
smart-search config set - If PATH is changed, a new terminal or Codex restart may be needed.
- On Windows, the default local config file is . Linux/macOS default to
%LOCALAPPDATA%\smart-search\config.json.~/.config/smart-search/config.json - In sandboxed runtimes (Codex CLI, containers, CI) where the default config directory is not writable or must be pinned, set to an absolute writable path. The CLI uses it for both config and relative logs and skips default-directory selection.
SMART_SEARCH_CONFIG_DIR - Earlier Windows source defaults used , while some installs were already pinned to
~\.config\smart-search\config.jsonthrough%LOCALAPPDATA%\smart-search. If the new default file is missing but the old file exists,SMART_SEARCH_CONFIG_DIRreportsdoctoras the active source so upgrades do not silently lose configuration. It also reports the override value and whether it matches the current default.legacy_windows_home - Use for agent/script parsing and
smart-search doctor --format jsonwhen a human wants a detailed diagnostic report.smart-search doctor --format markdown - If returns
smart-search doctor --format json, follow theok: falsefield's guidance (errororsmart-search setup); do not silently fall back to native web search.smart-search config set KEY VALUE - Interactive is a language-selecting grouped wizard with arrow-key / Space / Enter provider selection. It guides users through required
smart-search setup,main_search, and fetch capability, then optionaldocs_searchreinforcement.web_search - The setup wizard prints beginner filling examples for official-service and relay/pooled-endpoint minimum profiles. Keep that guidance on stderr so stdout remains parseable JSON/Markdown/content output.
- Use for an English wizard and
smart-search setup --lang enonly when low-level config keys must be shown one by one.smart-search setup --advanced - Use to save Zhipu Web Search API endpoint and search service without prompts.
smart-search setup --non-interactive --zhipu-api-url "https://open.bigmodel.cn/api" --zhipu-search-engine "search_std" - Use only when an OpenAI-compatible relay benefits from SSE streaming for long requests. Default remains false.
smart-search setup --non-interactive --openai-compatible-stream true - Use only for experimental AnySearch acceptance; do not add it to the normal minimum-profile setup.
smart-search setup --non-interactive --anysearch-api-url "https://api.anysearch.com/mcp" --anysearch-key "key" - Interactive setup asks for Zhipu API key, API URL, and search service when optional reinforcement selects Zhipu.
web_search - Use for Tavily Hikari / pooled endpoints. Root host and
TAVILY_API_URL=https://<host>/api/tavilyinputs are normalized by setup;/mcpitself is not the REST base Smart Search should call./mcp - controls the Tavily
TAVILY_TIMEOUT_SECONDSconnectivity timeout and defaults todoctor. Raise it for slower pooled/community Tavily endpoints before judging the provider unhealthy.30 - Use only for a Firecrawl-compatible REST base. Official default is
FIRECRAWL_API_URL.https://api.firecrawl.dev/v2
- 假设可从用户的PATH中找到。
smart-search - 此捆绑Skill与代码库一同维护。
smartsearch - 优先使用由/
smart-search setup管理的CLI本地配置文件。smart-search config - 环境变量仍支持用于CI和高级用户,且优先级高于本地配置文件。
- 默认情况下不要要求用户设置Windows全局API密钥环境变量。
- 如果使用更改了密钥,重新运行CLI即可;无需重启Codex。
smart-search config set - 如果PATH发生变更,可能需要重启终端或Codex。
- 在Windows上,默认本地配置文件为。Linux/macOS默认路径为
%LOCALAPPDATA%\smart-search\config.json。~/.config/smart-search/config.json - 在沙箱运行时(Codex CLI、容器、CI),如果默认配置目录不可写或必须固定,设置为绝对可写路径。CLI将使用该路径存储配置和相对日志,并跳过默认目录选择。
SMART_SEARCH_CONFIG_DIR - 早期Windows源默认使用,而部分安装已通过
~\.config\smart-search\config.json固定到SMART_SEARCH_CONFIG_DIR。如果新默认文件缺失但旧文件存在,%LOCALAPPDATA%\smart-search会将doctor报告为活动源,以便升级不会静默丢失配置。它还会报告覆盖值以及是否与当前默认匹配。legacy_windows_home - 对于Agent/脚本解析,使用;当人类需要详细诊断报告时,使用
smart-search doctor --format json。smart-search doctor --format markdown - 如果返回
smart-search doctor --format json,遵循ok: false字段的指导(error或smart-search setup);不要静默回退到原生网页搜索。smart-search config set KEY VALUE - 交互式是支持语言选择的分组向导,使用箭头键/空格/回车键选择提供商。它引导用户完成必需的
smart-search setup、main_search和抓取能力配置,然后是可选的docs_search增强配置。web_search - 设置向导会打印官方服务和中继/池化端点最小配置文件的入门示例。将这些指导输出到stderr,以便stdout保持可解析的JSON/Markdown/内容输出。
- 使用启动英文向导;仅当需要逐个显示低级配置密钥时,使用
smart-search setup --lang en。smart-search setup --advanced - 使用保存Zhipu网页搜索API端点和搜索服务,无需提示。
smart-search setup --non-interactive --zhipu-api-url "https://open.bigmodel.cn/api" --zhipu-search-engine "search_std" - 仅当兼容OpenAI的中继从SSE流中受益以处理长请求时,使用。默认值仍为false。
smart-search setup --non-interactive --openai-compatible-stream true - 仅在实验性AnySearch验收时,使用;不要将其添加到常规最小配置文件设置中。
smart-search setup --non-interactive --anysearch-api-url "https://api.anysearch.com/mcp" --anysearch-key "key" - 交互式设置在选择Zhipu作为可选增强时,会要求输入Zhipu API密钥、API URL和搜索服务。
web_search - 对于Tavily Hikari / 池化端点,使用。设置会规范化根主机和
TAVILY_API_URL=https://<host>/api/tavily输入;/mcp本身不是Smart Search应调用的REST基础路径。/mcp - 控制Tavily
TAVILY_TIMEOUT_SECONDS连通性超时,默认值为doctor。对于较慢的池化/社区Tavily端点,在判定提供商不健康前先提高该值。30 - 仅当使用兼容Firecrawl的REST基础路径时,使用。官方默认值为
FIRECRAWL_API_URL。https://api.firecrawl.dev/v2
Command Patterns
命令模式
powershell
smart-search search "query" --extra-sources 5 --timeout 90 --format json --output result.json
smart-search search "query" --stream --format json
smart-search search "query" --platform "Reuters" --model "model-id" --extra-sources 3 --timeout 90 --format json
smart-search search "nba战报" --format content
smart-search search "query" --validation strict --fallback auto --providers auto --format json
smart-search exa-search "query" --num-results 5 --search-type neural --include-text --include-highlights --include-domains docs.example.com developer.mozilla.org --format json
smart-search exa-similar "https://example.com/article" --num-results 5 --format json
smart-search context7-library "react" "hooks" --format json
smart-search context7-docs "/facebook/react" "useEffect cleanup" --format json
smart-search zhipu-search "today China AI news" --count 5 --format json
smart-search anysearch-domains security --format json
smart-search anysearch-search "CVE-2024-3094" --domain security.cve --max-results 3 --format json
smart-search anysearch-extract "https://example.com/source" --format json
smart-search anysearch-batch "AAPL" "RAG papers" --max-results 2 --format json
smart-search fetch "https://example.com" --format markdown --output page.md
smart-search map "https://docs.example.com" --instructions "Find API reference pages" --max-depth 1 --max-breadth 20 --limit 50 --format json
smart-search setup
smart-search setup --lang en
smart-search setup --advanced
smart-search setup --non-interactive --install-skills hermes
smart-search setup --non-interactive --zhipu-api-url "https://open.bigmodel.cn/api" --zhipu-search-engine "search_std"
smart-search setup --non-interactive --openai-compatible-stream true
smart-search setup --non-interactive --anysearch-api-url "https://api.anysearch.com/mcp" --anysearch-key "key"
smart-search setup --non-interactive --tavily-api-url "https://api.tavily.com" --tavily-key "key"
smart-search --version
smart-search config path --format json
smart-search config list --format json
smart-search config list --format markdown
smart-search config set XAI_API_KEY "key" --format json
smart-search config set XAI_MODEL "grok-4-fast" --format json
smart-search config set XAI_TOOLS "web_search,x_search" --format json
smart-search config set OPENAI_COMPATIBLE_API_URL "https://api.openai.com/v1" --format json
smart-search config set OPENAI_COMPATIBLE_API_KEY "key" --format json
smart-search config set OPENAI_COMPATIBLE_MODEL "model-id" --format json
smart-search config set OPENAI_COMPATIBLE_STREAM "true" --format json
smart-search config set ANYSEARCH_API_URL "https://api.anysearch.com/mcp" --format json
smart-search config set ANYSEARCH_API_KEY "key" --format json
smart-search config set ANYSEARCH_TIMEOUT_SECONDS "30" --format json
smart-search config set EXA_API_KEY "key" --format json
smart-search config set CONTEXT7_API_KEY "key" --format json
smart-search config set ZHIPU_API_KEY "key" --format json
smart-search config set ZHIPU_API_URL "https://open.bigmodel.cn/api" --format json
smart-search config set ZHIPU_SEARCH_ENGINE "search_pro" --format json
smart-search config set TAVILY_API_URL "https://api.tavily.com" --format json
smart-search config set TAVILY_TIMEOUT_SECONDS "45" --format json
smart-search config set FIRECRAWL_API_URL "https://api.firecrawl.dev/v2" --format json
smart-search model current --format json
smart-search doctor --format json
smart-search doctor --format markdown
smart-search regression
smart-search smoke --mock --format json
smart-search smoke --mock --format markdownShort aliases are supported for interactive use:
powershell
smart-search --v
smart-search s "query" --format json
smart-search s "nba战报" --format content
smart-search f "https://example.com" --format markdown
smart-search exa "OpenAI Responses API documentation" --format json
smart-search z "today China AI news" --format json
smart-search c7 "react" "hooks" --format json
smart-search c7docs "/facebook/react" "useEffect cleanup" --format json
smart-search cfg ls --format json
smart-search d --format markdown
smart-search mdl cur --format json
smart-search sm --format json
smart-search regpowershell
smart-search search "query" --extra-sources 5 --timeout 90 --format json --output result.json
smart-search search "query" --stream --format json
smart-search search "query" --platform "Reuters" --model "model-id" --extra-sources 3 --timeout 90 --format json
smart-search search "nba战报" --format content
smart-search search "query" --validation strict --fallback auto --providers auto --format json
smart-search exa-search "query" --num-results 5 --search-type neural --include-text --include-highlights --include-domains docs.example.com developer.mozilla.org --format json
smart-search exa-similar "https://example.com/article" --num-results 5 --format json
smart-search context7-library "react" "hooks" --format json
smart-search context7-docs "/facebook/react" "useEffect cleanup" --format json
smart-search zhipu-search "today China AI news" --count 5 --format json
smart-search anysearch-domains security --format json
smart-search anysearch-search "CVE-2024-3094" --domain security.cve --max-results 3 --format json
smart-search anysearch-extract "https://example.com/source" --format json
smart-search anysearch-batch "AAPL" "RAG papers" --max-results 2 --format json
smart-search fetch "https://example.com" --format markdown --output page.md
smart-search map "https://docs.example.com" --instructions "Find API reference pages" --max-depth 1 --max-breadth 20 --limit 50 --format json
smart-search setup
smart-search setup --lang en
smart-search setup --advanced
smart-search setup --non-interactive --install-skills hermes
smart-search setup --non-interactive --zhipu-api-url "https://open.bigmodel.cn/api" --zhipu-search-engine "search_std"
smart-search setup --non-interactive --openai-compatible-stream true
smart-search setup --non-interactive --anysearch-api-url "https://api.anysearch.com/mcp" --anysearch-key "key"
smart-search setup --non-interactive --tavily-api-url "https://api.tavily.com" --tavily-key "key"
smart-search --version
smart-search config path --format json
smart-search config list --format json
smart-search config list --format markdown
smart-search config set XAI_API_KEY "key" --format json
smart-search config set XAI_MODEL "grok-4-fast" --format json
smart-search config set XAI_TOOLS "web_search,x_search" --format json
smart-search config set OPENAI_COMPATIBLE_API_URL "https://api.openai.com/v1" --format json
smart-search config set OPENAI_COMPATIBLE_API_KEY "key" --format json
smart-search config set OPENAI_COMPATIBLE_MODEL "model-id" --format json
smart-search config set OPENAI_COMPATIBLE_STREAM "true" --format json
smart-search config set ANYSEARCH_API_URL "https://api.anysearch.com/mcp" --format json
smart-search config set ANYSEARCH_API_KEY "key" --format json
smart-search config set ANYSEARCH_TIMEOUT_SECONDS "30" --format json
smart-search config set EXA_API_KEY "key" --format json
smart-search config set CONTEXT7_API_KEY "key" --format json
smart-search config set ZHIPU_API_KEY "key" --format json
smart-search config set ZHIPU_API_URL "https://open.bigmodel.cn/api" --format json
smart-search config set ZHIPU_SEARCH_ENGINE "search_pro" --format json
smart-search config set TAVILY_API_URL "https://api.tavily.com" --format json
smart-search config set TAVILY_TIMEOUT_SECONDS "45" --format json
smart-search config set FIRECRAWL_API_URL "https://api.firecrawl.dev/v2" --format json
smart-search model current --format json
smart-search doctor --format json
smart-search doctor --format markdown
smart-search regression
smart-search smoke --mock --format json
smart-search smoke --mock --format markdown交互式使用支持短别名:
powershell
smart-search --v
smart-search s "query" --format json
smart-search s "nba战报" --format content
smart-search f "https://example.com" --format markdown
smart-search exa "OpenAI Responses API documentation" --format json
smart-search z "today China AI news" --format json
smart-search c7 "react" "hooks" --format json
smart-search c7docs "/facebook/react" "useEffect cleanup" --format json
smart-search cfg ls --format json
smart-search d --format markdown
smart-search mdl cur --format json
smart-search sm --format json
smart-search regGuardrails
防护规则
- Prefer JSON for agent parsing and markdown for fetched page text intended for reading.
- Use for multi-source work, long pages, or anything the answer may need to cite later.
--output - Keep small (
--extra-sourcesto1) unless the user asks for broad coverage. Large values are slower and can add noise.3 - Do not cite as proof for a sentence in
extra_sources; fetch the URL first or cite it only as a candidate source.content - Prefer for official documentation when likely domains are known.
exa-search --include-domains - Do not expose API keys. Treat output as safe only because it is expected to mask secrets.
doctor - In this CLI-first workflow, native is disabled unless the user explicitly configures another approved route.
web_search - If or a command fails, report the failure and recovery steps; do not silently fall back to another web-search route.
doctor - If the user explicitly asks to bypass smart-search, state that another approved web-search route must be configured first.
- Do not use legacy MCP tool names in prompts, notes, or generated instructions for this workflow.
- Treat key rotation as a hard safety gate when previous key values were pasted into chat or logs.
- For provider architecture maintenance, verify the distributable contract rather than the current developer machine's wrappers or local config. Keep fallback same-capability only.
- Treat xAI Responses and OpenAI-compatible as peer providers. Do not reuse one provider's URL/key to fabricate the other provider as a fallback.
main_search
- 对于Agent解析优先使用JSON,供人类阅读的抓取页面文本优先使用markdown。
- 对于多来源工作、长页面或后续可能需要引用的内容,使用。
--output - 保持较小(
--extra-sources到1),除非用户要求广泛覆盖。较大的值会更慢且可能增加噪音。3 - 不要将作为
extra_sources中语句的证据;先抓取URL,或将其仅作为候选来源引用。content - 当已知可能的域名时,优先使用查找官方文档。
exa-search --include-domains - 不要暴露API密钥。仅当输出预期会屏蔽敏感信息时,才将其视为安全内容。
doctor - 在这个CLI优先的工作流中,原生默认禁用,除非用户明确配置了其他已批准的路由。
web_search - 如果或某个命令失败,报告失败和恢复步骤;不要静默回退到其他网页搜索路由。
doctor - 如果用户明确要求绕过smart-search,说明必须先配置其他已批准的网页搜索路由。
- 在这个工作流的提示、注释或生成的说明中,不要使用旧版MCP工具名称。
- 当之前的密钥值已粘贴到聊天或日志中时,将密钥轮换视为硬性安全关卡。
- 对于提供商架构维护,验证可分发约定而非当前开发机器的包装器或本地配置。仅在同一能力范围内保留备选方案。
- 将xAI Responses和兼容OpenAI的服务视为对等的提供商。不要复用一个提供商的URL/密钥将另一个提供商伪装成备选方案。
main_search
Supporting Reference
参考资料
Read when you need command details, output fields, exit codes, or regression expectations.
references/cli-contract.md当需要命令细节、输出字段、退出代码或回归预期时,请阅读。
references/cli-contract.md