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

fanfou

v0.1.2

Published

An LLM-friendly command line for the Fanfou (饭否) API, with a bundled agent skill.

Downloads

28

Readme

饭否 CLI (fanfou)

An LLM-friendly command line for the Fanfou (饭否) API, plus a bundled agent skill that works with Claude Code, Codex, Cursor, and 50+ other AI coding agents. JSON-by-default output, schema introspection, dry-run previews, and a three-layer command surface (shortcuts / resource commands / raw API).

Requirements

  • Node.js ≥ 22.6 (the CLI runs TypeScript directly via type-stripping — no build step needed).

Install

# 1) The CLI (provides the `fanfou` command):
npm install -g fanfou          # or one-off, no install: npx fanfou <command>

# 2) The skill, into your AI agent(s) — via npx skills (GitHub as registry):
npx skills add Leaking/fanfou-cli -y -g
#    …or target specific agents (Claude Code, Codex, Cursor, 50+ more):
npx skills add Leaking/fanfou-cli --agent claude-code codex cursor

Run it:

fanfou --help

Developing from a clone (Node ≥ 22.6 runs the TypeScript directly — no build):

node src/index.ts --help

Quick start

# 1) Log in (XAuth). Use env vars to keep secrets out of argv.
FANFOU_USERNAME='[email protected]' FANFOU_PASSWORD='••••••' fanfou auth login

# 2) Read your timeline
fanfou +timeline --count 10
fanfou +timeline --format table

# 3) Post / reply / repost
fanfou +post "Hello 饭否"
fanfou +reply <status-id> "说得对"
fanfou +repost <status-id>

# 4) Anything else, raw:
fanfou api GET statuses/mentions.json --query count=5

Three layers

  1. Shortcuts (+timeline, +post, +reply, +repost, +mentions, +me, +search, +fav, +dm) — high-frequency operations with smart defaults.
  2. Resource commandsauth, timeline, status, favorite, user, friendship, dm, account, search (full Fanfou API coverage).
  3. Raw APIfanfou api <GET|POST> <path> [--query ...] [--form ...].

Authentication

Two flows, stored per-profile under ~/.config/fanfou/config.json (mode 0600):

  • XAuth (default): fanfou auth login -u <name> -p <pass>
  • OAuth web: fanfou auth oauth-url → approve in browser → fanfou auth oauth-exchange --token … --secret … [--verifier …]

Env overrides (handy for CI / agents): FANFOU_USERNAME, FANFOU_PASSWORD, FANFOU_OAUTH_TOKEN, FANFOU_OAUTH_TOKEN_SECRET, FANFOU_CONSUMER_KEY, FANFOU_CONSUMER_SECRET, FANFOU_PROFILE, FANFOU_CONFIG_DIR.

Multiple accounts: pass --profile <name> to any command, or fanfou auth use <name> to change the default.

LLM / agent friendliness

  • JSON by default on stdout; errors are JSON on stderr with exit codes (2 usage, 3 auth-required, 1 other/HTTP).
  • Schema introspection: fanfou <cmd> --help --format json.
  • Dry-run (--dry-run / -n) on every state-changing command prints the exact signed request without sending it.
  • Output formats: --format json|ndjson|table|raw (-o).
  • Robust arg parsing for Fanfou IDs that begin with -.

The bundled agent skill

A single, cross-agent skill lives at skills/fanfou/SKILL.md. It is consumable by any AI coding agent that supports the skills convention — Claude Code, Codex, Cursor, Cline, Aider, Continue, and 50+ more.

Install it globally for all of your agents at once, or scope it to a specific agent:

npx skills add Leaking/fanfou-cli -y -g                           # all agents
npx skills add Leaking/fanfou-cli --agent claude-code codex cursor # specific

From a local clone, you can also drop the skill into a Claude Code skills directory directly (other agents typically use the skills CLI above):

npm run install-skill           # -> ./.claude/skills/fanfou (project)
npm run install-skill -- --user # -> ~/.claude/skills/fanfou (global)

Develop

npm run typecheck   # tsc --noEmit
npm test            # node --test (OAuth1 signer vectors)
npm run build       # emit dist/

The OAuth1 HMAC-SHA1 signer matches the canonical RFC 5849 example signature (pinned by test/oauth1.test.ts). Fanfou signs the base string over http:// even on HTTPS requests — the signer replicates that quirk.