Zhihu Websearch
Zhihu Web Search as an OpenCode websearch provider
0
19
19 in 7 days
28.0
Multi-signal model
3 days ago
2026-10-02
Install and configure
opencode.jsonWrites to this project's opencode.json — applies to this repository only.
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-zhihu-websearch@0.0.1"]
}Writes to ~/.config/opencode/opencode.json — applies to every project.
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-zhihu-websearch@0.0.1"]
}If you want to modify the plugin locally, install it into the project and reference the local path.
shell
pnpm add -D opencode-zhihu-websearchOpenCode loads npm dependencies through its embedded runtime on startup and caches them locally — no manual global install needed.
English | 简体中文
Zhihu Web Search (Global Search) as an OpenCode websearch provider.
Zhihu Global Search is a high-trust search service for AI applications, combining high-quality Zhihu content with authoritative web sources to deliver real-time, structured, and traceable results. It offers high-quality, highly relevant results for Chinese-language queries.
Requirements
- OpenCode v2
- A Zhihu Open Platform account with an Access Secret: https://developer.zhihu.com/profile
Install
opencode plugin add opencode-zhihu-websearch
Or add it to opencode.jsonc:
{
"$schema": "https://opencode.ai/config.json",
"plugins": ["opencode-zhihu-websearch"],
"websearch": { "provider": "zhihu" },
}
Without websearch.provider, OpenCode asks you to pick a provider the first time you search.
Credentials
Run /connect and pick Zhihu, or set ZHIHU_ACCESS_SECRET before starting OpenCode. A stored credential takes priority over the environment variable.
Options
Plugin options are optional:
{
"plugins": [
{
"package": "opencode-zhihu-websearch",
"options": { "count": 8, "searchDB": "realtime" },
},
],
}
| Option | Values | Default | Description |
|---|---|---|---|
count |
1-20 | 10 |
Number of results |
searchDB |
all, realtime, static |
all |
Search index |
filter |
Filter expression | none | Filter results by site or publish time |
endpoint |
URL | Zhihu Global Search API | Override the search endpoint |
filter uses Zhihu's filter syntax: host supports == and != with a double-quoted value, publish_time (Unix seconds) supports ==, !=, >, >=, < and <=, and conditions combine with uppercase AND/OR and parentheses. Filtering on zhihu.com itself is not supported. Escape the quotes in JSON:
"options": { "filter": "host!=\"example.com\" AND publish_time>=1735689600" }
Development
bun install
bun run typecheck
bun run test
# optional: hits the real API, needs ZHIHU_ACCESS_SECRET
LIVE=1 bun run test:live
License
Similar plugins
Codebase Index
@bandonker/opencode-codebase-index
Index a codebase and run BM25-ranked full-text search over it with SQLite FTS5.
Omniroute V2
@piyush97/opencode-omniroute-v2
OpenCode v2 plugin for live OmniRoute model discovery, combos, authentication, and metadata.
Raven
opencode-raven
Context-saving search and on-demand MCP routing for OpenCode through focused Raven agents.