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

@wechatbot/pi-agent

v0.1.2

Published

Pi extension — type /wechat, scan QR code, chat with Pi from WeChat

Downloads

246

Readme

@wechatbot/pi-agent

Pi extension — type /wechat in pi, scan QR code in terminal, chat with Pi from WeChat.

Install

From npm (recommended)

pi install npm:@wechatbot/pi-agent

Done. The extension auto-loads on next pi session. Type /wechat to start.

From git

pi install https://github.com/jiweiyuan/wechatbot

Quick test (no install)

pi -e npm:@wechatbot/pi-agent

Manual (local development)

git clone https://github.com/jiweiyuan/wechatbot
cd wechatbot/pi-agent && npm install

# Load directly
pi -e ./src/index.ts

# Or copy to auto-discovery directory
cp -r . ~/.pi/agent/extensions/wechat/

Usage

/wechat              Scan QR code → connect WeChat to this pi session
/weixin              Alias for /wechat
/wechat --force      Force re-login (new QR code)
/wechat-disconnect   Disconnect
/wechat-send <text>  Send text to WeChat user manually

What happens

> /wechat

  📱 Scan this QR code in WeChat:

    ▄▄▄▄▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄
    █ ▄▄▄ █ █▀█ █ ▄▄▄ █
    █ ███ █ ▄▀▄ █ ███ █
    █▄▄▄▄▄█ █ ▄ █▄▄▄▄▄█
    ▄▄▄▄▄ ▄▄▄█▄▄▄ ▄▄▄▄▄
    █▄█▀█▄▄ ▀▀▄▀▀█▄▀█▀▄
    ▄▄▄▄▄▄▄ ▀▄ █▀▄█▄█▀▄
    █▄▄▄▄▄█ █▀▄█▀▀█▀███

  [wechat] ✓ Connected: [email protected]

# Now send "帮我看看这个bug" from WeChat...
# Pi processes it, sends reply back to WeChat.
# "对方正在输入中..." shown while Pi thinks.

How It Works

WeChat User (phone)
    │
    ▼
iLink API (Tencent) ←── @wechatbot/wechatbot SDK
    │
    ▼
Pi Extension
    │
    ├── WeChat msg → pi.sendUserMessage(text)  → pi processes as prompt
    │
    └── pi.on('agent_end') → bot.reply(text)   → sent back to WeChat
  1. /wechat creates a WeChatBot instance (SDK)
  2. SDK calls iLink API → gets QR URL
  3. qrcode-terminal renders QR code in pi TUI via ctx.ui.setWidget()
  4. User scans QR in WeChat → login confirmed → credentials saved
  5. SDK starts long-poll → incoming WeChat messages trigger pi.sendUserMessage()
  6. When pi finishes (agent_end event), response is sent back via bot.reply()
  7. bot.sendTyping() shows "对方正在输入中..." while pi thinks

QR Code Display

The QR code is rendered using qrcode-terminal — a real scannable QR code in the terminal.

The SDK does NOT render QR codes — that is the developer's responsibility. This extension is the developer. It receives the URL via onQrUrl callback and renders it.

Dependencies

| Package | Purpose | |---|---| | @wechatbot/wechatbot | WeChat iLink Bot SDK — login, poll, send, typing, context_token | | qrcode-terminal | Render scannable QR code in terminal | | @mariozechner/pi-coding-agent | Pi extension API (peer dependency) |

Pi Package

This is a pi package. It declares "keywords": ["pi-package"] and "pi": { "extensions": [...] } in package.json. Pi auto-discovers the extension after install.