npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dawnswwwww/zhihu-cli

v0.1.4

Published

CLI for the Zhihu Open Platform API

Readme

zhihu-cli

CLI for the Zhihu Open Platform API.

Supports authentication, Zhihu search, global web search, and the Zhida chat completion API.

Installation

From npm (recommended for Agent environments)

npm install -g @dawnswwwww/zhihu-cli
zhihu --help

From Homebrew

brew tap dawnswwwww/tap
brew install zhihu-cli

From crates.io

cargo install zhihu-cli

From GitHub Releases

Download the prebuilt archive for your platform from the Releases page, extract it, and place the zhihu binary in your PATH.

Quick start

# Authenticate with your Access Secret
zhihu auth login

# Or set it directly
zhihu auth set-secret <YOUR_ACCESS_SECRET>

# Search Zhihu
zhihu search zhihu "Rust 入门" --count 5

# Search the whole web
zhihu search global "Rust 入门" --count 5

# Ask Zhida
zhihu ask "Rust 和 Go 怎么选?" --model thinking

Claude Skill

This repository includes a Claude skill to help you use zhihu-cli from Claude Code or Claude.ai.

Install it with the Skills CLI:

# Install from GitHub
npx skills add dawnswwwww/zhihu-cli

# Or install globally
npx skills add dawnswwwww/zhihu-cli -g

Once installed, Claude will automatically use the skill whenever you ask about searching Zhihu, using the Zhida API, or configuring zhihu-cli.

Commands

| Command | Description | |---------|-------------| | zhihu auth login | Interactive login (reads secret from stdin). | | zhihu auth set-secret <SECRET> | Save Access Secret directly. | | zhihu auth status | Show authentication status. | | zhihu search zhihu <QUERY> | Search within Zhihu. | | zhihu search global <QUERY> | Search the whole web. | | zhihu ask <QUERY> | Ask Zhida. Use --model fast/thinking/agent and --stream. |

Run zhihu --help or zhihu <command> --help for details.

Configuration

The CLI stores configuration (including the Access Secret) under the user's config directory, typically:

  • macOS/Linux: ~/.config/zhihu-cli/config.toml
  • Windows: %APPDATA%\zhihu-cli\config.toml

You can also override the secret at runtime with the ZHIHU_ACCESS_SECRET environment variable.

Development

# Run tests
make test

# Lint
make lint

# Full local CI check
make check

See docs/development.md for the full workflow.

Release

Pushing a SemVer tag triggers the release workflow:

git tag -a v0.1.3 -m "Release 0.1.3"
git push origin v0.1.3

This builds cross-platform binaries, creates a GitHub Release, publishes zhihu-cli to npm, and updates the Homebrew tap.

License

MIT