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

v2ex-cdp-cli

v0.3.7

Published

CLI automation for Google login and V2EX interactions through managed Chrome CDP sessions.

Readme

v2ex-cdp-cli

CLI automation for Google login and V2EX interactions through managed Chrome CDP sessions.

The CLI keeps Chrome alive between commands. Use --session <slug> to isolate different Chrome instances, accounts, cookies, and V2EX workflows.

Install

npm install
npm run hooks:install
npm run build

Run during development:

npm run dev -- --session main chrome session start

Run after build:

node dist/cli.js --session main chrome session start

When installed as a package, both v2ex and v2ex-cdp run the same CLI.

Show the packaged skill guide and its installed path:

v2ex skillbook

Show the installed version:

v2ex version

Build the single-file bundle and create a local tarball:

npm run pack:tarball

Run the pre-commit dependency gate manually:

npm run dependency:health

If Chrome is not found automatically, pass --chrome-path or set CHROME_PATH.

Login

Start a persistent Chrome instance:

npm run dev -- --session main --headed chrome session start

Open Google login:

npm run dev -- --session main login google

Open V2EX login. The CLI clicks "Sign in with Google" when that option is present, so finish OAuth in the Chrome window:

npm run dev -- --session main login v2ex

The opened Chrome process remains alive after the command exits. Reuse the same --session main for later V2EX commands.

login defaults to headed mode because Google and V2EX OAuth need human interaction. Other commands default to headless mode for new sessions, but reuse an already-running session in its current mode unless you explicitly pass --headless or --headed. Add --headed when you want to watch or manually inspect a new browser.

V2EX Commands

List all channels/nodes from /planes:

npm run dev -- --session main v2ex channels

Command output defaults to a human-readable text view with compact tables and summaries. Add --format json when you need full structured data for scripts or jq:

npm run dev -- --session main v2ex channels --format json

Browse a channel:

npm run dev -- --session main v2ex channel python

Open a specific page:

npm run dev -- --session main v2ex channel python --page 2

Open the next page from a known current page:

npm run dev -- --session main v2ex next python --page 2

v2ex next opens the current page first and clicks the visible "Next Page" control when available. If the control is not available, it falls back to opening the next page URL directly.

Read a topic:

npm run dev -- --session main v2ex topic 1193196

Reply to a topic:

npm run dev -- --session main v2ex reply 1193196 --message "感谢分享。"

Comment on a visible reply floor. V2EX does not have nested comments, so this posts a topic reply prefixed with @username:

npm run dev -- --session main v2ex comment 1193196 --to 1 --message "我也遇到过类似问题。"

V2EX AI Recent Research

The AI recent-research workflow scans recent, finds AI/LLM/Agent-related topics, scores Tier1-like signals, and can generate a V2EX radar report. It is opt-in and uses this CLI's managed Chrome sessions for V2EX page reads.

Initialize the local cold-start store:

npm run dev -- v2ex ai recent-research migrate

Inspect migrated account/topic/score counts:

npm run dev -- v2ex ai recent-research status

Run a local heuristic-only watch scan:

npm run dev -- --session ai-watch v2ex ai recent-research watch --pages 3 --skip-deepseek

Enable DeepSeek scoring by installing the external CLI first:

npm install -g deepseek-cdp-cli
npm run dev -- --session ai-watch v2ex ai recent-research watch --pages 3 --max-candidates 30 --deepseek-limit 18

Generate a radar report from the Tier1-like account pool:

npm run dev -- --session ai-radar v2ex ai recent-research radar --pages 10 --skip-deepseek

Useful tuning flags:

  • --delay-ms <ms>: slow down browser reads between pages/topics.
  • --deep-think on|off|unchanged: match DeepSeek's DeepThink toggle naming.
  • --tiers <tiers>: comma-separated current or historical tiers for radar.
  • --score-decisions <decisions>: comma-separated decisions for radar, such as tier1_like,near_tier1.

Research data is stored under the app home, usually ~/.v2ex-cdp-cli/v2ex-ai-recent-research/. Use --store-file <path> to override the JSON store for tests or experiments. Design notes live in docs/v2ex-ai-recent-research/.

Chrome Session Management

List managed Chrome instances:

npm run dev -- chrome session list

Each listed session reports running only when both the recorded Chrome process and its CDP endpoint are alive. Regular V2EX commands disconnect from the session after finishing and intentionally leave the Chrome process running.

Stop one instance:

npm run dev -- --session main chrome session stop

Stop one instance and remove its persisted profile:

npm run dev -- --session main chrome session stop --remove-profile

Start another isolated instance:

npm run dev -- --session work chrome session start

Session data is stored under the app home directory, usually ~/.v2ex-cdp-cli/sessions/<slug>/.

Useful Options

  • --session <slug>: isolates Chrome processes and profiles; required for commands that open, reuse, or stop one specific session.
  • --chrome-path <path>: explicit Chrome/Chromium executable path.
  • --headless / --headed: choose Chrome mode for a new managed session. They are mutually exclusive. login defaults to headed; non-login automation defaults to headless for new sessions and reuses existing session mode when no mode flag is provided.
  • --proxy-server <server>: pass a proxy to launched Chrome sessions.
  • --viewport <WIDTHxHEIGHT>: set page viewport for automation pages.
  • --format text|json: choose output format for each command. Text is the default; JSON preserves the complete machine-readable result.

Notes

  • npm run hooks:install points Git at .githooks/; the pre-commit hook blocks commits when npm audit --include=dev finds moderate-or-higher vulnerabilities or npm ls --long reports deprecated dependency packages.
  • V2EX posting requires a logged-in account and may be subject to V2EX rate limits, anti-spam checks, and account rules.
  • Keep one human-controlled Chrome window per --session and reuse it; this is intentional so OAuth and V2EX sessions survive CLI command exits.
  • chrome session list marks sessions as running or stale; stale metadata can be removed with chrome session stop.
  • V2EX command results include a compact network section with observed V2EX requests, recent failures, and non-GET submission requests to help diagnose page automation outcomes.
  • Headed and headless sessions use a desktop-sized 1440x900 default viewport/window to avoid the tiny headless default. Override it with --viewport, for example --viewport 1920x1080.
  • Explicit --headless / --headed only apply when a --session is first started. If that slug is already running in the opposite mode, stop it first with chrome session stop --remove-profile or use a different slug. Without an explicit mode flag, commands reuse the running session mode.