Agent skill

Zhihu CLI

by BAIGUANGMEI in BAIGUANGMEI/zhihu-cli

知乎 CLI (pyzhihu-cli):搜索、热榜、问题/回答/评论、推荐 Feed、用户资料、发想法/提问/文章、删自己的内容、点赞关注、收藏与通知。Agent 代执行 zhihu 命令,Cookie 仅存本地。

Apache-2.0Auto-check passed

Install Zhihu CLI

skills CLI
$ npx skills add BAIGUANGMEI/zhihu-cli --skill zhihu-cli -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install BAIGUANGMEI/zhihu-cli zhihu-cli --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/BAIGUANGMEI/zhihu-cli.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skill .claude/skills/zhihu-cli && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
zhihu-cli
GitHub stars
107
Used in
1 other repo
Token cost
~1.7k tokens
SKILL.md length
474 words
Files
1
Skills in repo
1
Repo updated
First seen
Licence
Apache-2.0

At a glance

知乎 CLI (pyzhihu-cli):搜索、热榜、问题/回答/评论、推荐 Feed、用户资料、发想法/提问/文章、删自己的内容、点赞关注、收藏与通知。Agent 代执行 zhihu 命令,Cookie 仅存本地。

  • Works in 6 steps: 诉求 → 命令:按下表映射。 → 数据查询优先用 --json:凡执行数据查询类指令(如… → 需登录时:先 zhihu status;未登录则 zhihu login… → …
  • SKILL.md covers 前提, Instruction Scope, Credentials and 安装与更新, plus 7 more sections
  • Calls uv, pipx and pip

What it does

Zhihu CLI is an agent skill from BAIGUANGMEI/zhihu-cli. 知乎 CLI (pyzhihu-cli):搜索、热榜、问题/回答/评论、推荐 Feed、用户资料、发想法/提问/文章、删自己的内容、点赞关注、收藏与通知。Agent 代执行 zhihu 命令,Cookie 仅存本地。

Its SKILL.md is about 1.7k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The repository describes itself as: 知乎命令行工具 — 在终端搜索问题、查看回答、发布文章、提问、想法(支持图文)、浏览热榜,支持二维码登录与Cookie登录. The licence is Apache-2.0.

Example prompts

  • “/zhihu-cli”

Requirements

  • Python 3

Workflow steps

6 steps, taken from the first numbered list in SKILL.md.

  1. 诉求 → 命令:按下表映射。
  2. 数据查询优先用 --json:凡执行数据查询类指令(如 search、hot、question、answers、answer、user、user-answers、user-articles、followers、following、feed、topic、collections、n…
  3. 需登录时:先 zhihu status;未登录则 zhihu login --qrcode 或引导用户 zhihu login --cookie "..."。
  4. 扫码登录:执行 zhihu login --qrcode 后,若本轮未发过二维码且用户已配置 OpenClaw → 先将二维码复制到 OpenClaw 工作目录的 media 文件夹,再 openclaw message send --channel <渠道>…
  5. 安全:Cookie 仅本地;优先扫码,避免在不可信处粘贴 Cookie;可提醒 zhihu logout 清空。
  6. 升级:uv tool upgrade pyzhihu-cli / pipx upgrade pyzhihu-cli / pip install -U pyzhihu-cli。

What it can do on your machine

Read from SKILL.md and the folder at commit 8e32b99. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • pipx
    • pip

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use uv, pipx and pip, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Zhihu CLI loads about 1.7k tokens when it runs. Until then it costs about 30 tokens; SKILL.md has 474 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~30
When it runs · the whole SKILL.md, loaded when a task matches
~1.7k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from BAIGUANGMEI/zhihu-cli at commit 8e32b99, republished under its Apache-2.0 licence (© BAIGUANGMEI). 474 words, ~1,738 tokens.

Download SKILL.mdSave it as .claude/skills/zhihu-cli/SKILL.md (or your agent's skills folder).
name
zhihu-cli
description
知乎 CLI (pyzhihu-cli):搜索、热榜、问题/回答/评论、推荐 Feed、用户资料、发想法/提问/文章、删自己的内容、点赞关注、收藏与通知。Agent 代执行 zhihu 命令,Cookie 仅存本地。
author
BAIGUANGMEI
version
0.2.6
tags
zhihu, cli, 知乎, agent

zhihu-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、粘贴 Cookie zhihu login --cookie "z_c0=...; _xsrf=...; d_c0=..."。
  • 扫码时:二维码会生成到上述路径的 login_qrcode.png。若用 OpenClaw 发给用户,须先复制到 OpenClaw 工作目录的 media 文件夹再 openclaw message send --media <media 路径>。

Instruction Scope

本技能仅限:在用户本机调用已安装的 zhihu 命令,执行搜索、热榜、问题/回答/评论、推荐 Feed、用户资料、发想法/提问/文章、删除自己的内容、点赞关注、收藏与通知等操作;在用户请求扫码登录且已配置 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-cli
    • pipx install pyzhihu-cli
    • pip install pyzhihu-cli
  • 更新:按安装方式执行 uv tool upgrade pyzhihu-cli、pipx upgrade pyzhihu-cli 或 pip install -U pyzhihu-cli。用户问「升级/更新 zhihu」时提示其执行对应命令;不确定安装方式时可三种都给出。
  • 版本:zhihu --version 查看当前版本。

Agent 规则

  1. 诉求 → 命令:按下表映射。
  2. 数据查询优先用 --json:凡执行数据查询类指令(如 search、hot、question、answers、answer、user、user-answers、user-articles、followers、following、feed、topic、collections、notifications、whoami 等),必须带 --json,以获取 API 返回的完整数据,便于解析、汇总或向用户展示;不得仅依赖终端表格等非结构化输出。例外:feeds 当前不支持 --json;需要展示回答评论时使用 answer --comments(--json 只输出回答详情,不输出评论)。
  3. 需登录时:先 zhihu status;未登录则 zhihu login --qrcode 或引导用户 zhihu login --cookie "..."。
  4. 扫码登录:执行 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 工作目录不同则替换为实际路径)。
  5. 安全:Cookie 仅本地;优先扫码,避免在不可信处粘贴 Cookie;可提醒 zhihu logout 清空。
  6. 升级:uv tool upgrade pyzhihu-cli / pipx upgrade pyzhihu-cli / pip install -U pyzhihu-cli。

诉求 → 命令 速查

诉求命令
登录 / 扫码登录zhihu login --qrcode
Cookie 登录zhihu login --cookie "z_c0=...; _xsrf=...; d_c0=..."
重新登录 / 换号中断当前进程 → zhihu login --qrcode
检查登录zhihu status;看资料 zhihu whoami [--json]
搜索zhihu search "关键词" [--type general/people/topic] [--limit N] [--answers N] [--json]
热榜zhihu hot [--limit N] [--answers N] [--json]
问题zhihu question <id> [--json];回答列表 zhihu answers <id> [--limit N] [--sort default/created] [--json]
回答详情zhihu answer <id> [--comments] [--limit N] [--json](评论默认全部,--limit 0 为全部)
用户zhihu user <url_token> [--json];user-answers / user-articles / followers / following 均支持 --limit N --json
推荐 / 话题zhihu feed [--limit N] [--json];zhihu feeds [--limit N] [--comment-limit N];zhihu topic <id> [--json]
赞同zhihu vote <answer_id>;取消 zhihu vote <answer_id> --neutral
关注问题zhihu follow-question <id>;取消 zhihu follow-question <id> --unfollow
发提问zhihu ask "标题" [-d "描述"] [-t 话题id ...] [-i 图 ...]
发想法zhihu pin "标题" [-c "正文"] [-i 图 ...]
发文章zhihu article "标题" "正文" [-t 话题id ...] [-i 图 ...]
删提问/想法/文章zhihu delete-question <id> / delete-pin <id> / delete-article <id> [-y]
收藏 / 通知zhihu collections [--limit N] [--json];zhihu notifications [--limit N] [--offset M] [--json]
退出zhihu logout
版本 / 升级zhihu --version;升级见上规则 6
Show full SKILL.md (111 more words)Show less

执行流程

用户诉求
  → 若「重新登录/换号」:中断当前 → zhihu login --qrcode → [发二维码] → 等完成
  → 否则:查上表得命令
    → 若该命令需登录:zhihu status → 未登录则 zhihu login --qrcode 或 --cookie
      → 若扫码且未发过图:复制到 media → openclaw message send --media ... → 保持进程
    → 执行 zhihu <子命令>(数据查询类必须带 --json;feeds 和 answer --comments 除外)
    → 整理结果或报错提示

登录方式

方式命令
扫码zhihu login --qrcode:终端显示二维码并保存到本地(Linux/macOS:~/.zhihu-cli/login_qrcode.png;Windows:%USERPROFILE%\.zhihu-cli\login_qrcode.png);可经 OpenClaw 发图给用户。
手动 Cookiezhihu login --cookie "z_c0=...; _xsrf=...; d_c0=..."(浏览器 F12 → Network → 请求头 Cookie 复制)。

常用示例

bash
zhihu login --qrcode
zhihu status
zhihu search "Python" --json
zhihu hot --limit 10 --json
zhihu question 12345678 --json
zhihu answers 12345678 --limit 5 --json
zhihu answer 87654321 --comments --limit 5
zhihu user someone --json
zhihu feed --limit 5 --json
zhihu feeds --limit 3 --comment-limit 5
zhihu vote 87654321
zhihu pin "标题" -c "<p>正文</p>"
zhihu delete-pin 98765432 -y
zhihu notifications -l 10 --json
zhihu logout

正文支持 HTML 富文本(ask 的 -d、pin 的 -c、article 的正文)。


OpenClaw 发二维码(仅扫码时)

  1. 确保二维码已生成(Linux/macOS:~/.zhihu-cli/login_qrcode.png;Windows:%USERPROFILE%\.zhihu-cli\login_qrcode.png)。
  2. 复制到 OpenClaw 工作目录的 media 文件夹:
    • Linux/macOS:mkdir -p ~/.openclaw/workspace/media && cp ~/.zhihu-cli/login_qrcode.png ~/.openclaw/workspace/media/
    • Windows(cmd):mkdir "%USERPROFILE%\.openclaw\workspace\media" 2>nul & copy "%USERPROFILE%\.zhihu-cli\login_qrcode.png" "%USERPROFILE%\.openclaw\workspace\media\login_qrcode.png"
    • Windows(PowerShell):New-Item -ItemType Directory -Force "$env:USERPROFILE\.openclaw\workspace\media" | Out-Null; Copy-Item "$env:USERPROFILE\.zhihu-cli\login_qrcode.png" "$env:USERPROFILE\.openclaw\workspace\media\login_qrcode.png" (若 OpenClaw 工作目录不是默认的 ~/.openclaw/workspace 或 %USERPROFILE%\.openclaw\workspace,则替换为实际路径。)
  3. 发送:openclaw message send --channel <渠道> --target <目标> --media <工作目录>/media/login_qrcode.png --message "请用知乎 App 扫码并确认登录"(Linux/macOS 用 ~/.openclaw/workspace/media/login_qrcode.png,Windows 用 %USERPROFILE%\.openclaw\workspace\media\login_qrcode.png 或 PowerShell 中 $env:USERPROFILE\.openclaw\workspace\media\login_qrcode.png)。
  4. 不中断 zhihu login --qrcode 进程,等待用户完成。

错误处理

  • 未登录 / 401 / 403:先登录(zhihu login --qrcode 或 --cookie),再执行原命令。
  • 超时 / 网络:提示重试或检查网络。
  • 其他:根据 CLI 报错给简短原因与建议(如检查 ID、url_token)。

© BAIGUANGMEI, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in skill of BAIGUANGMEI/zhihu-cli.

Open the folder on GitHubat commit 8e32b99

Used in 1 other repository

We found 1 copy of this SKILL.md (exact, near-identical or edited) in other folders, from 1 other GitHub owner. This page covers the copy in BAIGUANGMEI/zhihu-cli, which our catalogue first saw on October 7, 2026.

Compare with similar skills

Zhihu CLI next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Zhihu CLI compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Zhihu CLI this skillBAIGUANGMEI/zhihu-cli1071 repos~1.7kAutomated safety check: PassApache-2.0
Zhihusigcli/sigcli293—~1.7kAutomated safety check: PassMIT
Zhihu Searchitwanger/toBeBetterJavaer18k—~1.5kAutomated safety check: PassNone
Zhihu Reproducezly2006/zhihu-plus-plus4.2k—~1.3kAutomated safety check: PassAGPL-3.0
Zhihu Performance Regression Reviewzly2006/zhihu-plus-plus4.2k—~868Automated safety check: PassAGPL-3.0
Zhihu Instrument Test Governancezly2006/zhihu-plus-plus4.2k—~2.4kAutomated safety check: PassAGPL-3.0

Similar skills

  • Zhihu

    sigcli/sigcli

    Interact with Zhihu (zhihu.com) — browse hot questions, read answers, search content, view topics, check user profiles.

    293 GitHub stars~1.7k tokensUpdated 10 days ago
    Auto-check passed
  • Zhihu Search

    itwanger/toBeBetterJavaer

    Search Zhihu for content using the searchv3 API. An agent skill from itwanger/toBeBetterJavaer.

    18k GitHub stars~1.5k tokensUpdated today
    Backend & APIsAuto-check passed
  • Zhihu Reproduce

    zly2006/zhihu-plus-plus

    复刻或验证知乎的产品功能、交互、接口、字段、分页、创作流程和视觉行为,并落地到 Zhihu++。当需求包含“知乎有什么我全要”、官方行为对齐、API 字段/include 判断、Web 与 Android 差异、真实请求取证或协议稳定性时使用。

    4.2k GitHub stars~1.3k tokensUpdated yesterday
    MobileAuto-check passed
  • Review and fix Zhihu++ functional regressions caused by performance optimizations.

    4.2k GitHub stars~868 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Zhihu Instrument Test Governance

    zly2006/zhihu-plus-plus

    Audit, add, migrate, or remove Zhihu++ Android instrument tests under app/src/androidTest.

    4.2k GitHub stars~2.4k tokensUpdated yesterday
    Testing & QAAuto-check passed
  • Zhihu Parallel PR Workflow

    zly2006/zhihu-plus-plus

    Coordinate Zhihu++ issue implementation and pull requests when the user explicitly asks for subagents or when multiple independent issues or scopes have real parallel value.

    4.2k GitHub stars~2.4k tokensUpdated yesterday
    DevelopmentAuto-check passed

Questions about Zhihu CLI

What does Zhihu CLI do?

知乎 CLI (pyzhihu-cli):搜索、热榜、问题/回答/评论、推荐 Feed、用户资料、发想法/提问/文章、删自己的内容、点赞关注、收藏与通知。Agent 代执行 zhihu 命令,Cookie 仅存本地。. Zhihu CLI is an agent skill from BAIGUANGMEI/zhihu-cli.

How do I install Zhihu CLI in Claude Code?

Run `npx skills add BAIGUANGMEI/zhihu-cli --skill zhihu-cli -a claude-code`. Or copy the skill folder (skill in BAIGUANGMEI/zhihu-cli) into .claude/skills/zhihu-cli in your project. Claude Code loads it when a task matches its description.

How do I install Zhihu CLI in Codex?

Run `npx skills add BAIGUANGMEI/zhihu-cli --skill zhihu-cli -a codex`. Or copy the skill folder (skill in BAIGUANGMEI/zhihu-cli) into .agents/skills/zhihu-cli in your project. Codex loads it when a task matches its description.

Can I use Zhihu CLI in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add BAIGUANGMEI/zhihu-cli --skill zhihu-cli -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/zhihu-cli, .gemini/skills/zhihu-cli, .github/skills/zhihu-cli and .opencode/skills/zhihu-cli in your project.

What does Zhihu CLI need to run?

Going by SKILL.md and its folder, Zhihu CLI needs the command-line tools its instructions call (uv, pipx and pip). Our summary lists: Python 3.

Does Zhihu CLI access the network?

SKILL.md contains no URLs. Its commands use uv and pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is Zhihu CLI safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Zhihu CLI use?

Zhihu CLI is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Zhihu CLI use?

About 1.7k tokens (SKILL.md is roughly 7k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Zhihu CLI?

Skills that share tags, products or a category with Zhihu CLI: Zhihu (sigcli/sigcli, 293 stars), Zhihu Search (itwanger/toBeBetterJavaer, 18k stars), Zhihu Reproduce (zly2006/zhihu-plus-plus, 4.2k stars) and Zhihu Performance Regression Review (zly2006/zhihu-plus-plus, 4.2k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Zhihu CLI?

BAIGUANGMEI (a GitHub user) maintains it in BAIGUANGMEI/zhihu-cli, which has 107 GitHub stars. The repository was last updated on May 4, 2026.

Source: BAIGUANGMEI/zhihu-cli on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.