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

@yuwei838/fotor-cli

v0.1.0

Published

Fotor CLI — device-code login (RFC 8628) against fotor-device-auth, local credential store, for Accio cli-login + webAuth:device-code.

Readme

fotor-cli

The CLI half of the Fotor connector demo — pairs with fotor-device-auth (the server half). Together they demonstrate the full cli-login + webAuth: device-code contract from the Accio 接入规范 (§6.3.2 / §6.3.4), end to end.

Run

npm install
npm run build

# in another terminal, from ../fotor-device-auth:
npm run dev

# then:
node dist/cli.js auth login --device

auth login --device will:

  1. Call POST /device/auth on the auth server.
  2. Print one line of JSON to stdout — verification_uri_complete, device_code, user_code, expires_in, interval — this is exactly the contract Accio's cli.webAuth.stdout.*Key config reads from a real CLI's stdout (§6.3.4). Everything else goes to stderr, never mixed into that line.
  3. Poll POST /token until the user finishes the browser step.
  4. Write the issued token to ~/.fotor-cli/credentials — matches the credential.home: ".fotor-cli/credentials" we'd declare in connectors/connectors.json.

Other commands:

node dist/cli.js auth status   # show masked key + credential file path
node dist/cli.js auth logout   # delete the credential file

Verified working

Ran the full loop for real (not just typechecked): started the auth server, ran auth login --device, drove an actual browser through the login + consent pages this repo's server renders, and confirmed:

  • the CLI's stdout line parses as valid JSON with the right keys
  • the browser flow completes with oidc-provider's built-in "Sign-in Success" page
  • the CLI's background poll picks up the token and writes ~/.fotor-cli/credentials
  • auth status reads it back, auth logout removes it (verified exit codes: 0 while logged in, 1 after logout)

What's still a stand-in

  • auth login only implements --device; the non-device (local loopback) variant from §6.3.2 isn't built.
  • No subcommand actually calls a Fotor generation API yet — this repo proves the auth handshake, not the business logic. A real fotor-skills refactor would add commands here (e.g. fotor-cli generate ...) that read ~/.fotor-cli/credentials instead of the FOTOR_OPENAPI_KEY env var.
  • Not published to npm — connectors.json's auth.npmPackage / mcpServer.npmPackage need a real published package name once this is ready to wire into Accio for real.