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

@bussolabs/presentforme-cli

v1.1.9

Published

CLI TypeScript per PresentForMe — consuma il canale /cli/v1 del backend Rails.

Readme

presentforme-cli

CLI TypeScript (oclif) per PresentForMe. Consuma il canale /cli/v1 del backend Rails (presentforme-rails). Autenticazione via token utente (account-proxy).

Il comando si chiama presentforme, con alias pfm.

Installazione

npm install -g @bussolabs/presentforme-cli
presentforme --help
pfm --help          # identico

Per lavorare sul repo, node e pnpm sono pinnati in mise.toml (node 24.11.0 + pnpm 11.5.2):

mise install
pnpm install
pnpm build
./bin/run.js --help

Comandi

| Comando | Cosa fa | Endpoint | |---|---|---| | login --token <T> | Verifica il token e lo salva | GET /cli/v1/session | | logout | Rimuove il token salvato (locale, idempotente) | — | | whoami | Mostra l'account autenticato | GET /cli/v1/session | | config list \| get <k> \| set <k> <v> | Legge e scrive la config locale | — | | profile show | Mostra il profilo | GET /cli/v1/profile | | profile update | Aggiorna nome, username, locale, compleanno | PATCH /cli/v1/profile | | gifts list | Elenca i propri regali | GET /cli/v1/gifts | | gifts create | Crea un regalo, anche da URL | POST /cli/v1/gifts (+ /gifts/previews) | | friends list | Elenca i propri amici | GET /cli/v1/friends |

Con --url senza --name, gifts create scrappa prima una bozza da POST /cli/v1/gifts/previews e poi conferma la creazione.

Supportano --json tutti i comandi tranne login e logout, che stampano solo una riga di esito.

pfm login --token TOKEN
pfm whoami --json
pfm gifts list --quiet
pfm gifts create --url https://shop.example.com/prodotto

Configurazione

Persistita in ~/.presentforme/config.json (mode 0600).

| Chiave | Descrizione | Default | |--------|-------------|---------| | serverUrl | URL base del backend | https://presentformenew.bussolarialessio.me | | token | Token utente (mascherato in output) | — |

| Variabile d'ambiente | Effetto | |---|---| | PRESENTFORME_API_URL | Sovrascrive serverUrl | | PRESENTFORME_CONFIG_DIR | Sposta la directory di config (profili multipli, isolamento nei test) |

login verifica il token contro GET /cli/v1/session e lo persiste solo se il backend risolve un account; altrimenti propaga l'errore (es. R401-AUTH-001) senza toccare la config.

Error handling

  • Errori locali → codice C{STATUS}-{DOMAIN}-{SEQ} (registry in src/errors/error-codes.ts).
  • Errori dal backend (R/G-prefix) → estratti dal body e propagati as-is, mai rimappati.
  • Exit code: 0 successo · 1 errore (locale o backend) · 2 errore di utilizzo.

Struttura

src/
  commands/   login · logout · whoami · config · profile/* · gifts/* · friends/*
  errors/     error-codes.ts (registry C-prefix)
  lib/        api-client · auth · config · output · errors · types
test/         lib/* + commands/* (vitest)
opencli.json  manifesto OpenCLI (opencli.org), spedito nel pacchetto

Sviluppo

pnpm build         # tsup → dist/ (ESM)
pnpm typecheck     # tsc --noEmit
pnpm test          # vitest run
./bin/run.js ...   # esegue da dist/