zhihu-cli

Command-line tool for searching, reading, and interacting with Zhihu (知乎). Supports hot topics, content search, article reading, user info, and Browser Relay-based voting/following.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "zhihu-cli" with this command: npx skills add lightislost/zhihu-cli

Zhihu CLI

A CLI tool for interacting with Zhihu (知乎) content.

Installation

# Install globally
npm install -g zhihu-cli

# Or use npx
npx zhihu-cli <command>

Commands

CommandDescription
zhihu loginAuto-extract cookies from Chrome
zhihu whoamiCheck login status
zhihu set-cookie <cookie>Set cookie manually
zhihu hotGet hot topics
zhihu search <keyword>Search content
zhihu topics <keyword>Search topics
zhihu read <url>Read answer/article
zhihu user <token>Get user info by url_token
zhihu vote <url>Browser Relay vote instructions
zhihu follow [url]Browser Relay follow instructions
zhihu postBrowser Relay post instructions

Features

  • 🔍 Search Zhihu content
  • 🔥 Get hot topics
  • 📖 Read answers/articles
  • 👤 View user info
  • 👍 Vote (via Browser Relay)
  • 👣 Follow users (via Browser Relay)
  • 🔐 Auto cookie extraction from Chrome

Cookie Setup

Option 1: Auto (recommended)

zhihu login

Opens Chrome and extracts cookies automatically.

Option 2: Manual

zhihu set-cookie "your_zhihu_cookie_string"

Browser Relay Operations

Some operations (vote, follow, post) require Browser Relay due to API limitations.

Setup

  1. Ensure OpenClaw Browser Relay is connected
  2. Use the respective command to get instructions

Voting

zhihu vote <answer_url>

Then click the vote button in browser or use JS:

const btn = document.querySelector('button[class*="VoteButton"]');
if (btn) btn.click();

Following

zhihu follow <user_url>

Or click the follow button in browser.

API Limitations

Zhihu has restricted API access for:

  • Vote/unvote (use Browser Relay)
  • Follow/unfollow (use Browser Relay)
  • Comments (partially available)

Read operations (search, hot, read, user) work via API.

Examples

# Get hot topics
zhihu hot

# Search for Python tutorials
zhihu search Python教程

# Read an answer
zhihu read https://www.zhihu.com/question/123456/answer/789012

# Get user info
zhihu user lightislost

# Check login
zhihu whoami

Notes

  • Cookie is stored in ~/.zhihu-cookie
  • Some features require login (votes, follows)
  • Browser Relay provides more reliable write operations

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Fitbit Tracker

Personal Fitbit integration for daily health tracking with adaptive sleep and activity reporting

Registry SourceRecently Updated
General

Ollama Load Balancer

Ollama load balancer for Llama, Qwen, DeepSeek, and Mistral inference across multiple machines. Load balancing with auto-discovery via mDNS, health checks, q...

Registry SourceRecently Updated
General

Google Merchant Center

Google Merchant Center integration. Manage Accounts. Use when the user wants to interact with Google Merchant Center data.

Registry SourceRecently Updated
General

Twitter/X All-in-One — Search, Monitor & Publish Text & Media Posts

Searches and reads X (Twitter): profiles, timelines, mentions, followers, tweet search, trends, lists, communities, and Spaces. Publishes posts, likes/unlike...

Registry SourceRecently Updated