zhihu-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesezhihu-search
zhihu-search
Use as a proactive external-information source while keeping repository-local work
local. Prefer an available MCP tool; fall back to only when that MCP
tool is unavailable or fails to start. Read references/setup.md only for
installation, credentials, MCP configuration, or diagnostics.
zhihu-searchzhihuuvx zhihu-search在保持仓库本地工作本地化的同时,将作为主动获取外部信息的来源。优先使用可用的 MCP工具;仅当该MCP工具不可用或启动失败时,才退而使用。仅在安装、凭证配置、MCP设置或诊断时阅读references/setup.md。
zhihu-searchzhihuuvx zhihu-searchRoute the request
路由请求
Choose exactly one core route unless the user needs both evidence and synthesis:
| User intent | Route | Default behavior |
|---|---|---|
| Titles, links, sources, current information, experiences, reviews, comparisons, tutorials | | Prefer |
| A direct explanation, synthesis, or analysis | | Use |
| Recent hot topics, hot list, or “what people are discussing now” | | Return the most relevant current items |
Apply this table independently to every item in a multi-part request. For an eligible explanation,
synthesis, or analysis item, call when its MCP tool is available instead of answering only
from model memory.
askPrefer over when the user expects inspectable links or source evidence. Use
only when the user explicitly accepts a slower agent request.
searchaskask(model=agent)Do not use external Zhihu tools for repository-local code questions, pure math or logic,
translation, or transformations limited to text/files the user already provided unless the user
also requests external verification.
除非用户同时需要证据和综合内容,否则请选择恰好一个核心路由:
| 用户意图 | 路由 | 默认行为 |
|---|---|---|
| 标题、链接、来源、实时信息、体验、评价、对比、教程 | | 若需社区观点优先使用 |
| 直接解释、综合或分析 | | 使用 |
| 近期热点话题、热榜或“大家现在在讨论什么” | | 返回最相关的实时内容 |
对多部分请求中的每个条目独立应用此表格。对于符合条件的解释、综合或分析条目,当对应的MCP工具可用时,请调用,而非仅依赖模型记忆回答。
ask当用户期望可查看的链接或来源证据时,优先使用而非。仅当用户明确接受较慢的agent请求时,才使用。
searchaskask(model=agent)请勿针对仓库本地代码问题、纯数学或逻辑问题、翻译或仅限用户提供的文本/文件的转换操作使用外部知乎工具,除非用户同时要求外部验证。
Use MCP first
优先使用MCP
When the MCP catalog exposes the server, call its matching core tool directly:
zhihusearch(query, scope, count, filter, search_db)ask(query, model)trending(limit)
If the catalog already shows a matching capability tool, call it instead of or the CLI:
other- profile:
knowledge,knowledge_bases,knowledge_itemsknowledge_search - profile:
user,user_contents,user_followees,user_collections,user_favlistsfavlist_contents - profile:
office,pdf_create,pdf_status,ppt_createppt_status
Do not run a duplicate CLI request after a successful MCP call. If the matching MCP tool is not
available or the server cannot start, use the CLI fallback below.
当MCP目录提供服务时,请直接调用其匹配的核心工具:
zhihusearch(query, scope, count, filter, search_db)ask(query, model)trending(limit)
如果目录已显示匹配的功能工具,请调用该工具而非或CLI:
other- 配置文件:
knowledge,knowledge_bases,knowledge_itemsknowledge_search - 配置文件:
user,user_contents,user_followees,user_collections,user_favlistsfavlist_contents - 配置文件:
office,pdf_create,pdf_status,ppt_createppt_status
成功调用MCP后,请勿重复执行CLI请求。若匹配的MCP工具不可用或服务无法启动,请使用下方的CLI备选方案。
CLI fallback
CLI备选方案
Check credentials before any fallback operation except and :
oauth-urloauth-tokenbash
uvx zhihu-search --check-tokenThis command must report only whether credentials are configured and their source. Never echo a
secret fragment or a user-specific credentials path into chat or logs. Use only when an
end-to-end upstream check is necessary because it performs one real request.
--probeThen run the narrowest command:
bash
uvx zhihu-search search "<query>" --scope zhihu --count 5
uvx zhihu-search search "<query>" --scope web --count 10
uvx zhihu-search ask "<question>" --model fast
uvx zhihu-search trending --limit 10Use only with web search. Keep unless the user
explicitly asks for or .
--filter 'host=="example.com"'--search-db allrealtimestatic在执行任何备选操作前(除和外),请检查凭证:
oauth-urloauth-tokenbash
uvx zhihu-search --check-token此命令仅需报告凭证是否已配置及其来源。切勿在聊天或日志中输出密钥片段或用户特定的凭证路径。仅当需要端到端上游检查时才使用,因为它会执行一次真实请求。
--probe然后运行最精简的命令:
bash
uvx zhihu-search search "<query>" --scope zhihu --count 5
uvx zhihu-search search "<query>" --scope web --count 10
uvx zhihu-search ask "<question>" --model fast
uvx zhihu-search trending --limit 10仅在全网搜索时使用。除非用户明确要求或,否则保持。
--filter 'host=="example.com"'realtimestatic--search-db allLow-frequency explicit workflows
低频明确工作流
Use these only when the user explicitly asks for the corresponding Zhihu capability. If the
matching MCP tool is already visible (for example after , ,
, or ), call it directly. In compact mode, use
first; do not silently substitute or for a hidden
knowledge, user-data, PDF, or PPT tool. If MCP cannot expose the tool, use the CLI.
--tools knowledge--tools user--tools office--tools fullother(action="enable")searchask仅当用户明确请求相应的知乎功能时才使用这些流程。若匹配的MCP工具已可见(例如在执行、、或后),请直接调用该工具。在紧凑模式下,先使用;请勿静默地用或替代隐藏的知识库、用户数据、PDF或PPT工具。若MCP无法提供该工具,请使用CLI。
--tools knowledge--tools user--tools office--tools fullother(action="enable")searchaskAuthorized user data
授权用户数据
bash
uvx zhihu-search user-contents --content-type all --limit 20
uvx zhihu-search user-followees --limit 20
uvx zhihu-search user-collections --limit 20
uvx zhihu-search user-favlists --limit 20
uvx zhihu-search favlist-contents --url-token 123456789 --limit 20Without , these commands query the calling developer's own data. Pass
back unchanged through . Official now requires
; is kept only for compatibility.
ZHIHU_OAUTH_TOKENPaging.NextOffset--offsetfavlist-contents--url-token--idbash
uvx zhihu-search user-contents --content-type all --limit 20
uvx zhihu-search user-followees --limit 20
uvx zhihu-search user-collections --limit 20
uvx zhihu-search user-favlists --limit 20
uvx zhihu-search favlist-contents --url-token 123456789 --limit 20若无,这些命令将查询调用开发者自身的数据。将原样通过传递。官方的现在需要;保留仅为兼容。
ZHIHU_OAUTH_TOKENPaging.NextOffset--offsetfavlist-contents--url-token--idKnowledge bases
知识库
First-time use requires initializing Zhihu Zhida knowledge bases at
https://zhida.zhihu.com/repositories/square. Upload only a local file explicitly placed in scope;
the maximum size is 100 MB.
bash
uvx zhihu-search knowledge-bases --scope all
uvx zhihu-search knowledge-items "<knowledge_base_id>" --limit 20
uvx zhihu-search knowledge-search "<query>" --recall-scope personal --limit 10
uvx zhihu-search knowledge-upload "<path>" --knowledge-base-id "<knowledge_base_id>"Prefer the MCP tool when it is already visible. Do not fall back to web
for a private-document question. needs at least one of
or . Pass back unchanged through .
Do not retry a timed-out or unknown upload.
knowledge_searchsearchknowledge-search--knowledge-base-id--recall-scopeNextCursor--cursorbash
uvx zhihu-search knowledge-bases --scope all
uvx zhihu-search knowledge-items "<knowledge_base_id>" --limit 20
uvx zhihu-search knowledge-search "<query>" --recall-scope personal --limit 10
uvx zhihu-search knowledge-upload "<path>" --knowledge-base-id "<knowledge_base_id>"当MCP的工具可见时,优先使用该工具。请勿针对私有文档问题退而使用全网。至少需要或中的一个。将原样通过传递。请勿重试超时或未知的上传操作。
knowledge_searchsearchknowledge-search--knowledge-base-id--recall-scopeNextCursor--cursorPDF and PPT tasks
PDF和PPT任务
Upload only a local PDF explicitly placed in scope; the maximum size is 100 MB.
bash
uvx zhihu-search pdf-upload "<path.pdf>" --format json
uvx zhihu-search pdf-create "<file_id>"
uvx zhihu-search pdf-status "<task_id>"
uvx zhihu-search ppt-create "<zhihu_resource_url>" --pages 12
uvx zhihu-search ppt-status "<task_id>"Use an uploaded within 24 hours. The PPT source must be a supported Zhihu answer or
article URL, and the page count must be 6–21. Preserve IDs exactly.
file_idUse an idempotency key when retrying task creation and never reuse it for different inputs. Do not
poll status aggressively. Treat successful result URLs as short-lived.
仅上传明确纳入范围的本地PDF;最大文件大小为100 MB。
bash
uvx zhihu-search pdf-upload "<path.pdf>" --format json
uvx zhihu-search pdf-create "<file_id>"
uvx zhihu-search pdf-status "<task_id>"
uvx zhihu-search ppt-create "<zhihu_resource_url>" --pages 12
uvx zhihu-search ppt-status "<task_id>"需在24小时内使用已上传的。PPT源必须是支持的知乎回答或文章URL,且页数必须为6–21。请原样保留ID。
file_id重试任务创建时使用幂等键,且切勿将其用于不同输入。请勿频繁轮询状态。将成功的结果URL视为短期有效。
OAuth helpers
OAuth辅助工具
bash
uvx zhihu-search oauth-url "<app_id>" "<redirect_uri>"
uvx zhihu-search oauth-token "<app_id>" "<redirect_uri>" "<authorization_code>"Require locally before token exchange. Never place it in arguments or chat.
Do not invent undocumented state, scopes, PKCE, refresh/revoke, or user-info flows.
ZHIHU_OAUTH_APP_KEYbash
uvx zhihu-search oauth-url "<app_id>" "<redirect_uri>"
uvx zhihu-search oauth-token "<app_id>" "<redirect_uri>" "<authorization_code>"在本地进行令牌交换前,需确保存在。切勿将其放入参数或聊天内容中。请勿创建未记录的状态、范围、PKCE、刷新/撤销或用户信息流程。
ZHIHU_OAUTH_APP_KEYSafety and output
安全与输出
- Never expose an Access Secret, OAuth app key, or OAuth token in chat, logs, screenshots, or commits.
- Model-facing tools must never accept a local path, app key, or OAuth token.
- Preserve opaque offsets, cursors, ,
file_id,task_id,KnowledgeBaseID, and expiring result URLs exactly.RecallContentID - Return useful titles, links, attribution, task state, and the quota line when present.
- State clearly when results are weak or empty.
- 切勿在聊天、日志、截图或提交记录中暴露访问密钥、OAuth应用密钥或OAuth令牌。
- 面向模型的工具绝不能接受本地路径、应用密钥或OAuth令牌。
- 原样保留不透明的偏移量、游标、、
file_id、task_id、KnowledgeBaseID及过期的结果URL。RecallContentID - 返回有用的标题、链接、归属信息、任务状态及配额提示(若存在)。
- 当结果薄弱或为空时,请明确说明。