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

protocodebase-cli

v0.1.10

Published

ProtoCodeBase command line tool for authenticated search and one-command source download.

Downloads

1,018

Readme

ProtoCodeBase CLI (pcb)

pcb is the npm-distributed command line client for ProtoCodeBase search and source download.

Install

npm i -g protocodebase-cli

Or run without global install:

npx protocodebase-cli --help

Commands

pcb search [options]
pcb pull [options]
pcb token save --token PCBToken_xxx
pcb token clear

search and pull both execute the same workflow exposed by cli-search.sh.

Default endpoints:

  • Web: https://protocodebase.com
  • API: https://protocodebase.com/api/v1
  • Built-in fallback: if API base is unreachable or accidentally points to web not API, CLI can auto-try https://api.<web-host>/api/v1 once (when fallback is enabled).
  • Optional direct-IP fallback: if you pass --api-ip or set PROTOCODEBASE_API_IP, CLI keeps the domain API as primary and switches to the direct IP endpoint only after failure.

Override for local development if needed:

export PROTOCODEBASE_WEB_BASE="http://127.0.0.1:9527"
export PROTOCODEBASE_API_BASE="http://127.0.0.1:9528/api/v1"

Temporary direct-IP fallback for troubleshooting:

export PROTOCODEBASE_API_IP="8.146.230.241:9528"

Optional network compatibility override:

export PROTOCODEBASE_CURL_BIN="/usr/bin/curl"
export PROTOCODEBASE_CURL_TLS_MAX="1.2"

By default, CLI does not force TLS version. It only auto-retries once with TLS1.2 when handshake fails.

API fallback behavior:

  • CLI may auto-switch API base to api.<web-host>/api/v1 when current API base looks wrong.
  • If --api-ip or PROTOCODEBASE_API_IP is provided, CLI may switch again to http://<ip>:9528/api/v1 after the domain endpoint still fails.
  • When API base points to local/tunnel/private address (for example 127.0.0.1, localhost, 10.x, 192.168.x, 172.16-31.x), auto-switch is disabled to avoid breaking SSH tunnel workflows.
  • You can explicitly disable or enable:
export PROTOCODEBASE_DISABLE_API_FALLBACK=1
# or
export PROTOCODEBASE_ENABLE_API_FALLBACK=1

Common Examples

pcb search --query "时间管理" --pick 1
pcb search --query "时间管理" --api-ip "8.146.230.241:9528" --pick 1
pcb search --query "时间管理" --project-name "my_project"
pcb pull --slug "timediary-1775372092457" --save-path "/abs/path/project_root" --yes
pcb token save --token "PCBToken_xxx"

Output Layout

After confirmation:

  • Protocol files are written directly to project root.
  • Code repository is downloaded to <project-root>/<repo-name>.

If no --project-name or --save-path is provided, a non-conflicting root folder is auto-created as new-project-x.