pi-auth-profiles
Auth profile switching for pi — save and switch between named credential profiles via slash commands
Package details
Install pi-auth-profiles from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-auth-profiles- Package
pi-auth-profiles- Version
0.1.2- Published
- Mar 18, 2026
- Downloads
- 39/mo · 5/wk
- Author
- rjshrjndrn
- License
- MIT
- Types
- extension
- Size
- 22.9 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./extensions"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-auth-profiles
Save and switch between named credential profiles in pi without leaving your session.
Install
pi install npm:pi-auth-profiles
Or for a single run:
pi -e npm:pi-auth-profiles
Usage
Save the current credentials as a profile
/auth-save work
Copies ~/.pi/agent/auth.json → ~/.pi/agent/auth.json.work.
Switch to a saved profile
/auth-switch personal
Copies the profile back to auth.json and reloads credentials in-memory. Your session context, ACM state, and conversation history are completely unaffected.
List saved profiles
/auth-list
Shows all profiles with their providers and marks which one matches the active credentials.
Delete a profile
/auth-delete work
Removes the profile file after confirmation.
How it works
~/.pi/agent/
├── auth.json ← active credentials (what pi reads)
├── auth.json.work ← saved profile
├── auth.json.personal ← saved profile
└── ...
Profiles are full copies of auth.json. Switching replaces the entire file and calls authStorage.reload() to update pi's in-memory credential cache immediately.
- Same provider, different accounts (e.g., two Anthropic subscriptions): seamless switch, session continues.
- Different providers (e.g., Anthropic → OpenAI): auth switches, but you may need to
/modelto select a model from the new provider.
Notes
- Profile files are stored with mode
0600(owner read/write only) - Tab completion works on
/auth-switchand/auth-delete - OAuth tokens in saved profiles may expire — pi handles refresh automatically on next use