pi-login-manager

Single pi extension that registers and logs the user into third-party vendors (Command Code, R4 Coder). One adapter per vendor; credentials live in pi's auth.json.

Packages

Package details

extension

Install pi-login-manager from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-login-manager
Package
pi-login-manager
Version
0.1.1
Published
Sep 24, 2026
Downloads
356/mo · 11/wk
Author
unsual
License
MIT
Types
extension
Size
57.7 KB
Dependencies
0 dependencies · 2 peers

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-login-manager

A Pi extension that registers third-party model vendors and manages their logins — one adapter per vendor, credentials stored by pi itself in ~/.pi/agent/auth.json.

Vendors

Provider id Auth paths Notes
commandcode Browser OAuth (localhost callback) or paste API key Static model catalog registered instantly, upgraded to the live catalog in the background
r4coder Paste API key (r4.codes dashboard login is not automatable — Cloudflare Turnstile) Static 10-model catalog, compat.sendSessionAffinityHeaders preserved

Install

pi install npm:pi-login-manager

Or try it without installing:

pi -e npm:pi-login-manager

Usage

After installing, pi loads the extension on session start and both providers are registered automatically. Then:

/login commandcode   # browser OAuth, or paste a key
/login r4coder       # paste the coder_* key from the r4.codes dashboard

Credentials are stored by pi in ~/.pi/agent/auth.json — the same place pi's native logins live. No plaintext keys in models.json, no scraping.

Credential expiry

When a stored credential is expired or near expiry, the extension says which vendor expired and how to re-login, instead of leaving you with a raw 401.

Legacy models.json migration

If your ~/.pi/agent/models.json still defines r4coder with a plaintext apiKey, the extension warns on session start (models.json entries shadow registered providers). Delete that entry — after one /login r4coder the key lives in auth.json and models.json can go.

Requirements

  • Pi coding agent
  • Node 22+ (pi's bundled runtime)

What this is not

  • No usage/billing surface (see docs/adr/); use a usage extension for that
  • No dashboard scraping; R4 login is intentionally paste-key only

License

MIT