# 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.

Latest version **0.1.1** (published 2026-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install pi-login-manager
pnpm add pi-login-manager
yarn add pi-login-manager
bun add pi-login-manager
```

## Health

**Score 60/100 (C)** — status: active.

Positive: esm support; no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2026-09-24 |
| First published | 2026-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 57.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | unsual |
| Keywords | pi-package, pi-extension, pi, login, provider, r4coder, commandcode |

## Links

- npm: https://www.npmjs.com/package/pi-login-manager
- Repository: https://github.com/wduo87391/pi-login-manager
- Homepage: https://github.com/wduo87391/pi-login-manager#readme
- Issues: https://github.com/wduo87391/pi-login-manager/issues
- npm.io page: https://npm.io/package/pi-login-manager

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.1.1 (latest) — 2026-09-24
- 0.1.0 — 2026-09-23

## README

# pi-login-manager

A [Pi](https://github.com/badlogic/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

```bash
pi install npm:pi-login-manager
```

Or try it without installing:

```bash
pi -e npm:pi-login-manager
```

## Usage

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

```bash
/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](https://github.com/badlogic/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

---
_Source: https://npm.io/package/pi-login-manager · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
