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

weibo-client

v1.0.1

Published

Weibo CLI — read, post, search, comment, follow, and download from Weibo.

Readme

weibo-client

Weibo CLI — read, post, search, comment, follow, and download from Weibo.

Installation

npm install -g weibo-client

After installation, the weibo command is available globally.

Authentication

weibo-client authenticates via Weibo cookies. There are two ways to provide them:

Auto-extract from browser (recommended)

By default, cookies are extracted from your Chrome active profile automatically. No extra flags needed:

weibo whoami

To specify a browser or profile:

# Use a specific Chrome profile
weibo --chrome-profile "Profile 1" whoami

# Use Edge browser
weibo --cookie-source edge whoami

# Use Firefox
weibo --cookie-source firefox whoami

Supported browsers: Chrome, Edge, Firefox, Opera, Brave, Vivaldi.

Manual cookie input

Pass cookie values directly:

weibo --SUB "xxx" --SUBP "xxx" --WBPSESS "xxx" --ALF "xxx" --SCF "xxx" --XSRFTOKEN "xxx" whoami

Commands

weibo whoami

Show current logged-in Weibo account info.

weibo whoami

weibo read

Read posts from a user's timeline. Defaults to the current user.

# Read current user's latest posts (one page)
weibo read

# Read posts from a specific user
weibo read --screen-name "username"

# Fetch all posts with auto-pagination
weibo read --all

# Fetch at most 50 posts
weibo read --limit 50

# Only fetch posts after a specific date
weibo read --since 2025-01-01

# Filter by post type: 0=all, 1=original, 2=images, 3=video, 4=music
weibo read --feature 1

# Output as JSON (for scripting)
weibo read --json

weibo search

Search weibo posts by keyword.

# Search (returns first page of results)
weibo search "keyword"

# Search and fetch up to 100 results with auto-pagination
weibo search --limit 100 "keyword"

# Output as JSON
weibo search --json "keyword"

weibo post

Publish a new weibo post.

# Post text only
weibo post "Hello Weibo!"

# Post with one image
weibo post -m photo.jpg "Check out this photo"

# Post with multiple images and alt text
weibo post -m img1.jpg -m img2.jpg --alt "first image" --alt "second image" "My photos"

# Post with a video
weibo post -m video.mp4 "My video"

weibo comment

Comment on a weibo post.

# Comment on a post
weibo comment 5120000000000001 "Great post!"

# Comment with an image
weibo comment -m reaction.jpg 5120000000000001 "Nice!"

# Comment and also repost the original post
weibo comment --repost 5120000000000001 "Sharing this"

weibo reply

Reply to a comment on a post.

# Reply to a comment (post ID, comment ID, text)
weibo reply 5120000000000001 5130000000000001 "Thanks!"

# Reply with an image
weibo reply -m photo.jpg 5120000000000001 5130000000000001 "Here you go"

weibo comments

Read comments for a weibo post.

# Read comments (sorted by hot, default)
weibo comments 5120000000000001

# Sort by time
weibo comments --sort 1 5120000000000001

# Limit to 20 parent comments
weibo comments --limit 20 5120000000000001

# Fetch more child (nested) comments per parent
weibo comments --max-children 10 5120000000000001

# Skip child comments entirely
weibo comments --no-children 5120000000000001

# Output as JSON
weibo comments --json 5120000000000001

weibo like

Like a weibo post.

weibo like 5120000000000001

weibo follow

Follow a user by screen name or user ID.

weibo follow username
weibo follow @username
weibo follow 1234567890

weibo unfollow

Unfollow a user by screen name or user ID.

weibo unfollow username
weibo unfollow 1234567890

weibo followers

List followers of a user. Defaults to the current user.

# List followers (one page)
weibo followers

# List followers of a specific user
weibo followers --screen-name "username"

# Fetch all followers with auto-pagination
weibo followers --all

# Fetch all, but stop after 5 pages
weibo followers --all --max-pages 5

# Start from a specific page
weibo followers --start-page 3

# Output as JSON
weibo followers --json

weibo following

List users followed by a user. Defaults to the current user.

# List following (one page)
weibo following

# List following of a specific user
weibo following --screen-name "username"

# Fetch all with auto-pagination
weibo following --all

# Output as JSON
weibo following --json

weibo download

Download media (image or video) from a URL.

# Download to current directory (filename from URL)
weibo download "https://example.com/image.jpg"

# Specify output path
weibo download -o ~/Downloads/photo.jpg "https://example.com/image.jpg"

# Disable resume (always download from scratch)
weibo download --no-resume "https://example.com/video.mp4"

# Set idle timeout (abort if no data for 60s, default 30s)
weibo download --idle-timeout 60000 "https://example.com/video.mp4"

Global Options

| Option | Description | | ---------------- | ------------------------------------------- | | --timeout <ms> | Request timeout in milliseconds | | --plain | Plain output (no emoji, no color) | | --no-emoji | Disable emoji in output | | --no-color | Disable ANSI colors (or set NO_COLOR env) | | -V, --version | Show version number | | -h, --help | Show help |

Development

# Run in development mode (no build required)
pnpm run dev -- whoami

# Type-check and bundle for npm
pnpm run build:dist

# Compile standalone binary (requires bun)
pnpm run build:binary

License

MIT