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

@token2chat/t2c

v0.2.0-beta.1

Published

t2c - Pay-per-request LLM access via Cashu ecash

Downloads

147

Readme

t2c - Token2Chat CLI

Pay-per-request LLM access via Cashu ecash.

Installation

npm install -g @token2chat/cli

Quick Start

# 1. Run setup wizard
t2c setup

# 2. Start the proxy service
t2c service start

# 3. Add funds to your wallet
t2c mint

# 4. Configure your AI tool
t2c config openclaw --apply  # For OpenClaw (auto-merge)
t2c config cursor            # For Cursor
t2c config env               # For other tools

# 5. (Optional) Install as system service for auto-start
t2c service install

Commands

t2c setup

Interactive setup wizard. Configures Gate URL, Mint URL, proxy port, and wallet path.

t2c status

Show service status and wallet balance.

t2c status          # Pretty output
t2c status --json   # JSON output

t2c service

Manage the local proxy service.

t2c service start           # Start as daemon
t2c service start -f        # Run in foreground
t2c service stop            # Stop the service
t2c service restart         # Restart the service
t2c service status          # Show detailed service status
t2c service logs            # Show logs
t2c service logs -f         # Follow logs

# System service management (auto-start on login)
t2c service install         # Install as launchd (macOS) or systemd (Linux)
t2c service uninstall       # Uninstall system service

t2c mint

Add funds to your wallet.

t2c mint              # Show deposit address
t2c mint --check      # Check for pending deposits
t2c mint 1000         # Create Lightning invoice for 1000 sat

t2c config

Generate configuration for AI tools.

t2c config list             # List supported tools
t2c config openclaw         # Show OpenClaw config
t2c config openclaw --apply # Apply to openclaw.json (creates backup)
t2c config openclaw --json  # Output raw JSON
t2c config cursor           # Show Cursor config
t2c config env              # Show environment variables

Architecture

┌─────────────┐     ┌──────────────────┐     ┌──────────┐
│  AI Tool    │────▶│  t2c proxy       │────▶│   Gate   │
│  (OpenClaw, │     │  :10402 (ecash)   │     │          │
│   Cursor,   │     └──────────────────┘     └──────────┘
│   etc.)     │
└─────────────┘

The proxy:

  1. Receives OpenAI-compatible requests from AI tools
  2. Selects ecash tokens from your local wallet
  3. Forwards requests to the Gate with payment
  4. Handles change/refund tokens automatically
  5. Returns the LLM response to your AI tool

Configuration

Config is stored in ~/.t2c/config.json:

{
  "gateUrl": "https://gate.token2chat.com",
  "mintUrl": "https://mint.token2chat.com",
  "walletPath": "~/.t2c/wallet.json",
  "proxyPort": 10402,
  "lowBalanceThreshold": 1000
}

System Service

macOS (launchd)

# Install
t2c service install

# Load manually
launchctl load ~/Library/LaunchAgents/com.token2chat.proxy.plist

# Uninstall
t2c service uninstall

Linux (systemd)

# Install
t2c service install

# Enable and start
systemctl --user daemon-reload
systemctl --user enable t2c-proxy.service
systemctl --user start t2c-proxy.service

# Uninstall
t2c service uninstall

Supported AI Tools

| Tool | Command | Notes | |------|---------|-------| | OpenClaw | t2c config openclaw --apply | Auto-merges token2chat provider | | Cursor | t2c config cursor | OpenAI base URL config | | Generic | t2c config env | OPENAI_API_KEY + OPENAI_BASE_URL |

Any tool that supports OpenAI-compatible APIs can use Token2Chat.

Error Handling

The CLI handles various error conditions gracefully:

  • No config: Prompts to run t2c setup
  • No wallet: Creates one automatically
  • Corrupted config: Auto-recovers with backup
  • Network timeout: Retries with exponential backoff
  • Insufficient balance: Clear error message with balance info

Development

# Clone and install
git clone https://github.com/token2chat/cli.git
cd cli
npm install

# Build
npm run build

# Run tests
npm test

# Run with coverage
npm run test:coverage

# Link for local testing
npm link

License

MIT