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

@sweefi/cli

v0.3.2

Published

CLI for AI agent payments on Sui — pay, stream, escrow, and manage mandates from the terminal

Readme

@sweefi/cli

CLI for AI agent payments on Sui — pay, stream, escrow, and manage mandates from the terminal.

Apache 2.0 open source. Part of the SweeFi ecosystem — open-source agentic payment infrastructure for Sui.

Quick Start

# 1. Install
npm install -g @sweefi/cli

# 2. Configure
export SUI_PRIVATE_KEY="suiprivkey1..."
export SUI_NETWORK="testnet"

# 3. Pay
sweefi pay 0xRecipient... 1.5 --idempotency-key $(uuidgen)

Prerequisites: Node.js >= 22

Commands

| Command | Description | |---------|-------------| | sweefi pay <recipient> <amount> | Execute a payment on Sui | | sweefi pay-402 --url <URL> | Handle HTTP 402 Payment Required automatically | | sweefi balance [address] | Check wallet balance | | sweefi receipt <object-id> | Fetch an on-chain payment receipt | | sweefi prepaid deposit <provider> <amount> | Open a prepaid balance | | sweefi prepaid status <balance-id> | Check prepaid budget | | sweefi prepaid list [address] | List prepaid balances | | sweefi mandate create <agent> <per-tx> <total> <expires> | Set spending caps | | sweefi mandate check <mandate-id> | Verify mandate status | | sweefi mandate list [address] | List active mandates | | sweefi wallet generate | Generate a new keypair | | sweefi doctor | Run setup diagnostics | | sweefi schema | Machine-readable command manifest |

Output

All commands return JSON by default. Pass --human for human-readable output.

{
  "ok": true,
  "command": "pay",
  "version": "0.3.0",
  "data": {
    "txDigest": "...",
    "recipient": "0x...",
    "amount": "1500000000",
    "amountFormatted": "1.5 SUI",
    "gasCostSui": "0.001420",
    "explorerUrl": "https://suiscan.xyz/testnet/tx/..."
  },
  "meta": {
    "network": "testnet",
    "durationMs": 412,
    "cliVersion": "0.3.0",
    "requestId": "a1b2c3d4-..."
  }
}

Idempotent Payments

--idempotency-key prevents double-spend when agents crash and retry:

# First call — executes payment
sweefi pay 0xBob... 1.5 --idempotency-key 550e8400-e29b-41d4-a716-446655440000

# Retry with same key — returns existing receipt, no new TX
sweefi pay 0xBob... 1.5 --idempotency-key 550e8400-e29b-41d4-a716-446655440000

Required in JSON mode (default) for both pay and pay-402. Auto-generated in --human mode.

Limitations

Idempotency uses on-chain memo scanning (paginated getOwnedObjects). This protects against sequential retries (after Sui's ~400ms finality), not concurrent execution from multiple processes. For high-volume senders with 1000+ receipts, the scan may become slow. A future on-chain IdempotencyRegistry will provide O(1) guaranteed lookup.

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | SUI_PRIVATE_KEY | Yes (for transactions) | Wallet key (bech32 suiprivkey1... or base64) | | SUI_NETWORK | No | testnet (default), mainnet, or devnet | | SUI_RPC_URL | No | Custom RPC endpoint | | SUI_PACKAGE_ID | No | Override deployed contract package ID |

No config files. Environment variables only. Zero stored state = zero drift.

Global Flags

| Flag | Description | |------|-------------| | --network <testnet\|mainnet\|devnet> | Override SUI_NETWORK | | --human | Human-readable output | | --dry-run | Simulate without executing | | --idempotency-key <uuid> | Dedup key for crash-safe payments | | --verbose | Debug output on stderr | | --timeout <ms> | RPC timeout (default: 30000) |

Agent Integration

sweefi schema emits a machine-readable JSON manifest for MCP tool registration and LLM function-calling:

sweefi schema | jq '.commands[].name'

Error responses include structured fields for programmatic handling:

{
  "ok": false,
  "error": {
    "code": "TX_OBJECT_CONFLICT",
    "message": "Concurrent object access",
    "retryable": true,
    "suggestedAction": "This is transient — retry in a few seconds",
    "retryAfterMs": 2000
  }
}

Known Limitations

  • Facilitator dependency: pay-402 routes payments through a facilitator service for settlement. If the facilitator is unreachable, pay-402 will fail even with a funded wallet. Run sweefi doctor to check connectivity.
  • Double probe: pay-402 makes two HTTP requests to the target URL before payment (one from the CLI, one from the s402 client internally). This is a performance issue, not a safety issue.
  • Idempotency scan: Uses paginated on-chain receipt scanning. For high-volume senders (1000+ receipts), the check may be slow. A future on-chain registry will provide O(1) lookup.

License

Apache 2.0 — https://github.com/sweeinc/sweefi