zhihu-cli
知乎 CLI (pyzhihu-cli):搜索、热榜、问题/回答、发想法/提问/文章、删自己的内容、点赞关注、通知。Agent 代执行 zhihu 命令,Cookie 仅存本地。
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/baiguangmei/pyzhihu-clizhihu-cli 技能
前提
- 已安装:
zhihu在 PATH 中(uv tool install pyzhihu-cli/pipx install pyzhihu-cli/pip install pyzhihu-cli)。 - 路径:配置与二维码路径 — Linux/macOS:
~/.zhihu-cli/(如~/.zhihu-cli/cookies.json、~/.zhihu-cli/login_qrcode.png);Windows:%USERPROFILE%\.zhihu-cli\(如%USERPROFILE%\.zhihu-cli\cookies.json、%USERPROFILE%\.zhihu-cli\login_qrcode.png)。 - 配置:登录态存于上述
cookies.json;不得将 Cookie 上传或写入对话/日志。 - 登录方式:仅两种 — 扫码
zhihu login --qrcode、粘贴 Cookiezhihu login --cookie "z_c0=...; _xsrf=...; d_c0=..."。 - 扫码时:二维码会生成到上述路径的
login_qrcode.png。若用 OpenClaw 发给用户,须先复制到 OpenClaw 工作目录的 media 文件夹再openclaw message send --media <media 路径>。
Instruction Scope
本技能仅限:在用户本机调用已安装的 zhihu 命令,执行搜索、热榜、问题/回答、发想法/提问/文章、删除自己的内容、点赞关注、收藏与通知等操作;在用户请求扫码登录且已配置 OpenClaw 时,可将二维码图片经 OpenClaw 发送至用户指定渠道。不包含:代用户将 Cookie 上传至任何第三方、访问非知乎域名、或超出上述命令范围的操作。
Credentials
- 知乎登录态:仅存于用户本机(Linux/macOS:
~/.zhihu-cli/cookies.json;Windows:%USERPROFILE%\.zhihu-cli\cookies.json,权限 0600)。Agent 仅通过执行zhihu命令间接使用,不得将 Cookie 内容上传、转发或写入对话/日志。 - OpenClaw:若使用
openclaw message send发送二维码,需用户自行配置 OpenClaw 及渠道凭证;本技能不声明、不持有该部分凭证。
安装与更新
- 安装(任选其一):
uv tool install pyzhihu-clipipx install pyzhihu-clipip install pyzhihu-cli
- 更新:按安装方式执行
uv tool upgrade pyzhihu-cli、pipx upgrade pyzhihu-cli或pip install -U pyzhihu-cli。用户问「升级/更新 zhihu」时提示其执行对应命令;不确定安装方式时可三种都给出。 - 版本:
zhihu --version查看当前版本。
Agent 规则
- 诉求 → 命令:按下表映射。
- 数据查询必须用 --json:凡执行数据查询类指令(如
search、hot、question、answers、answer、user、user-answers、user-articles、feed、topic、collections、notifications、whoami等),必须带--json,以获取 API 返回的完整数据,便于解析、汇总或向用户展示;不得仅依赖终端表格等非结构化输出。 - 需登录时:先
zhihu status;未登录则zhihu login --qrcode或引导用户zhihu login --cookie "..."。 - 扫码登录:执行
zhihu login --qrcode后,若本轮未发过二维码且用户已配置 OpenClaw → 先将二维码复制到 OpenClaw 工作目录的media文件夹,再openclaw message send --channel <渠道> --target <目标> --media <media 路径>/login_qrcode.png --message "请用知乎 App 扫码并确认登录";保持登录进程不中断直到成功/失败/超时;用户说「重新登录/换号」则中断当前进程再重新执行登录。复制步骤:Linux/macOS:mkdir -p ~/.openclaw/workspace/media && cp ~/.zhihu-cli/login_qrcode.png ~/.openclaw/workspace/media/;Windows:mkdir "%USERPROFILE%\.openclaw\workspace\media" 2>nul & copy "%USERPROFILE%\.zhihu-cli\login_qrcode.png" "%USERPROFILE%\.openclaw\workspace\media\login_qrcode.png"(若 OpenClaw 工作目录不同则替换为实际路径)。 - 安全:Cookie 仅本地;优先扫码,避免在不可信处粘贴 Cookie;可提醒
zhihu logout清空。
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-baiguangmei-pyzhihu-cli": {
"enabled": true,
"auto_update": true
}
}
}Tags
Related Skills
obsidian-cli
Skill for the official Obsidian CLI (v1.12+). Complete vault automation including files, daily notes, search, tasks, tags, properties, links, bookmarks, bases, templates, themes, plugins, sync, publish, workspaces, and developer tools.
context-compressor
Intelligently compress context — conversations, code, logs. Preserve key information while reducing token usage. Auto-detects content type and applies optimal compression.
podcast-agent
Search articles on any topic, generate a two-host dialogue script, and synthesize podcast audio via TTS. Turn long reads into listenable content.
soul-weaver
AI Soul Weaver - 12 Curated Celebrity Templates + Custom Generation. Generate OpenClaw agent configurations through dialog or select from 12 world-famous tech & business leaders.
aethercore
AetherCore v3.3.4 - Security-focused final release. High-performance JSON optimization with universal smart indexing for all file types. All security review issues fixed, ready for production.