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

pocketclaw-server

v1.9.5

Published

OpenClaw plugin — remote tunnel and QR pairing for PocketClaw iOS App

Readme

pocketclaw-server

OpenClaw plugin — remote tunnel and QR pairing for PocketClaw iOS App.

What it does

When OpenClaw Gateway starts, this plugin automatically:

  1. ✅ Checks that cloudflared is installed (with platform-specific install help)
  2. 🌐 Creates a Cloudflare Tunnel (public HTTPS endpoint)
  3. 📱 Prints a QR code in the terminal
  4. 📲 PocketClaw iOS App scans the QR → remote control ready!

Install

1. Install cloudflared (one-time)

| Platform | Command | |----------|---------| | macOS | brew install cloudflared | | Windows | winget install Cloudflare.cloudflared | | Ubuntu/Debian | sudo apt install cloudflared | | Other Linux / VPS | Download from GitHub |

2. Install the plugin

openclaw plugins install pocketclaw-server

3. (Recommended) Enable full functionality

Quick queries work out of the box. For Commands and AI Tasks, enable the chatCompletions endpoint:

openclaw config set gateway.http.endpoints.chatCompletions.enabled true

4. Start / restart Gateway

openclaw gateway restart

The terminal will display a QR code. Open PocketClaw on your iPhone and scan it.

Supported Platforms

| Platform | OpenClaw | cloudflared | This Plugin | |----------|----------|-------------|-------------| | macOS | ✅ | ✅ brew | ✅ | | Windows | ✅ | ✅ winget | ✅ | | Linux (Ubuntu, Debian, etc.) | ✅ | ✅ apt / binary | ✅ | | VPS / Cloud Server | ✅ | ✅ binary | ✅ |

QR Code Format

{"h":"xxxx.trycloudflare.com","p":443,"t":"gateway-token","s":1,"n":"hostname"}

| Field | Description | |-------|-------------| | h | Tunnel hostname | | p | Port (443 = HTTPS) | | t | Gateway auth token | | s | HTTPS flag (1=yes) | | n | Host machine name |

FAQ

Q: Do I need to re-scan after Gateway restart?

| Scenario | Re-scan needed? | Why | |----------|----------------|-----| | Gateway restart, tunnel process alive | ❌ No | URL and token unchanged | | Gateway restart, cloudflared also restarts | ❌ Usually no | App auto-discovers new URL via LAN | | Phone and computer on different networks + tunnel URL changed | ⚠️ Yes | Cannot discover new URL via LAN | | Using a fixed Cloudflare Tunnel domain | ❌ Never | URL is permanent |

Q: Can I use this from a different network?

Yes! The Cloudflare tunnel works from any network — WiFi, 5G, anywhere.

Remote Control Features

Once installed, the plugin registers the following tools for remote control:

| Tool | Description | |------|-------------| | pocketclaw_session_control | Adjust session settings (thinking level, model, verbose, etc.) | | pocketclaw_elevated | Toggle elevated mode (on/off/ask/full) | | pocketclaw_session_reset | Reset or create new sessions | | pocketclaw_models | List available AI models | | pocketclaw_usage | Check token usage and costs | | pocketclaw_cron_list | List scheduled cron jobs |

Build & Development

# 发布构建(编译 + 混淆)— 用于 npm publish
npm run build

# 开发构建(仅编译,保留可读性)— 用于本地调试
npm run build:dev

# 运行测试
npm test

注意:本地部署到 ~/.openclaw/extensions/pocketclaw-server/ 时建议用 build:dev,混淆版日志可读性较差。发布到 npm 时务必用 build

Security

代码保护

发布到 npm 的包经过多层保护,防止逆向分析:

| 保护层 | 说明 | |--------|------| | 源码隔离 | TypeScript 源码(src/)、测试(test/)、构建脚本(scripts/)均不发布 | | 标识符混淆 | 变量名、函数名 → 十六进制(_0x1a2b) | | 字符串加密 | 字符串提取到数组 + Base64 编码 | | 键名混淆 | 对象属性键名转换 | | 代码压缩 | 压缩为单行,去除所有注释和空格 |

Session 安全模型

  • QR 码仅携带短期一次性 pairingToken(10 分钟有效)
  • 扫码后兑换为独立 sessionToken(与 Gateway Token 完全隔离)
  • 每个设备独立 Session,支持单设备吊销
  • Session 持久化到磁盘,Gateway 重启后自动恢复

License

MIT