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

@duo121/chrome-cdp

v0.1.0

Published

AI-native CLI for managing Chrome CDP instances, targets, and page actions

Downloads

29

Readme

chrome-cdp

English

chrome-cdp 是一个面向 AI 的 Chrome DevTools Protocol 命令行工具。

  • 命令:chrome-cdp
  • 别名:ccdp
  • 包名:@duo121/chrome-cdp
  • GitHub:https://github.com/duo121/chrome-cdp

设计目标

这个 CLI 不是给人手工拼 CDP 请求用的,而是给 AI 直接调用:

  • 所有命令结果统一输出 JSON
  • chrome-cdp spec 是机器可读合同
  • 推荐工作流是 list -> targets -> resolve-target -> exact action
  • 尽量避免让 AI 猜测 tab,或者直接手写底层 CDP 请求

安装

npm install -g @duo121/chrome-cdp

本地开发:

npm install

核心工作流

chrome-cdp list
chrome-cdp targets --port 9222
chrome-cdp resolve-target --port 9222 --type page
chrome-cdp goto --target <handle> --url https://example.com
chrome-cdp screenshot --target <handle> --out ./shot.png

常用命令

chrome-cdp spec
chrome-cdp doctor --port 9222
chrome-cdp list
chrome-cdp launch --port 9222
chrome-cdp targets --port 9222
chrome-cdp new-target --port 9222 --url https://example.com
chrome-cdp activate-target --target <handle>
chrome-cdp close-target --target <handle>
chrome-cdp resolve-target --port 9222 --title-contains github
chrome-cdp goto --target <handle> --url https://example.com
chrome-cdp eval --target <handle> --expr "document.title"
chrome-cdp screenshot --target <handle>
chrome-cdp cookies --target <handle>
chrome-cdp set-cookie --target <handle> --name session --value abc --url https://example.com
chrome-cdp stop --port 9222

面向 AI 的输入方式

结构化写入支持 --stdin,避免拼很长的 shell 参数:

printf '%s\n' '[{"name":"theme","value":"dark","domain":"example.com","path":"/"}]' \
  | chrome-cdp set-cookie --target <handle> --stdin

chrome-cdp spec 就是给 AI 用的稳定机器合同。

测试

npm test
npm run test:live
npm run pack:check

npm test 会跑单元测试和基于 fake CDP server 的集成测试。

npm run test:live 会在本机存在 Chrome 时执行真实端到端测试。

发布

npm version patch
git push origin main --tags
npm publish

prepublishOnly 会先执行 npm test,GitHub Actions 也会在 push 和 pull request 时跑 CI。