pi-model-profiles
v0.3.3
Published
Pi extension for saving, importing, and applying agent model frontmatter profiles.
Maintainers
Readme
pi-model-profiles
pi-model-profiles is a Pi extension for saving, updating, deleting, sorting, and applying whole-agent model frontmatter snapshots.
- Command:
/model-profiles - npm: https://www.npmjs.com/package/pi-model-profiles
- GitHub: https://github.com/MasuRii/pi-model-profiles
Features
- Save the current user/project agent model frontmatter as a reusable snapshot.
- Apply a saved snapshot across matching agent markdown files with atomic writes.
- Rename, update, remove, and sort saved snapshots from the interactive modal.
- Preserve profile data in
profiles.jsonwith schema-versioned migration support. - Write optional debug logs only to the extension-local
debug/directory when enabled.
Installation
npm package
pi install npm:pi-model-profilesGit repository
pi install git:github.com/MasuRii/pi-model-profilesLocal extension folder
Place this folder in one of Pi's extension discovery paths:
| Scope | Path |
|-------|------|
| Global default | ~/.pi/agent/extensions/pi-model-profiles (respects PI_CODING_AGENT_DIR) |
| Project | .pi/extensions/pi-model-profiles |
Pi discovers the extension through the root index.ts entry listed in package.json.
Usage
Run the command in interactive TUI mode:
/model-profilesModal shortcuts:
| Shortcut | Action |
|----------|--------|
| ↑ / ↓ | Move through snapshots |
| Enter | Apply selected snapshot |
| s | Save current agent state as a new snapshot |
| r | Rename selected snapshot |
| Ctrl+U | Update selected snapshot from current agent state |
| Delete / Ctrl+D | Remove selected snapshot after confirmation |
| Ctrl+S | Open sort menu |
| Esc | Close modal, cancel input, or close sort menu |
Configuration
Runtime configuration lives in config.json at the extension root. The extension creates the file automatically with defaults on first load if it does not already exist.
A starter template is included at config/config.example.json. Copy it to config.json for local customization, or let the extension create config.json with defaults on first load.
{
"debug": false,
"profiles": {
"autoSave": true,
"maxProfiles": 100
},
"sorting": {
"defaultSort": "date-desc"
}
}| Key | Type | Default | Purpose |
|-----|------|---------|---------|
| debug | boolean | false | Enables debug logging under debug/ directory |
| profiles.autoSave | boolean | true | Reserved profile persistence setting |
| profiles.maxProfiles | number | 100 | Reserved maximum profile retention setting |
| sorting.defaultSort | name-asc \| name-desc \| date-asc \| date-desc | date-desc | Default snapshot sort order |
Profile Storage
Profile data is persisted in profiles.json at the extension root and should not be edited while Pi is running.
{
"version": 2,
"importedAt": "2026-04-26T00:00:00.000Z",
"profiles": [
{
"id": "profile-id",
"name": "Current agents snapshot",
"createdAt": "2026-04-26T00:00:00.000Z",
"updatedAt": "2026-04-26T00:00:00.000Z",
"agents": [
{
"fileName": "code.md",
"agentName": "code",
"fields": {
"model": "provider/model",
"temperature": 0.2,
"reasoningEffort": "medium"
}
}
]
}
]
}Debug Logging
Debug logging is controlled by the debug property in config.json.
- When
debugisfalseor absent, no debug file handles are opened and no debug files are written. - When
debugistrue, debug events are appended todebug/pi-model-profiles-debug.jsonl. - Debug output is never written to console, stdout, or stderr.
Development
npm install
npm run build
npm run lint
npm run test
npm run check
npm run package:dry-runPublishing
The package metadata follows the same publish-ready shape used by established Pi extensions:
- entrypoint:
index.ts - package exports:
.→./index.ts - Pi extension manifest:
pi.extensions - published files: source, README, changelog, license, and config template
- runtime
config.json,profiles.json, anddebug/logs excluded from npm publication
Related Pi Extensions
- pi-context-injector — Inject compact project context into first-turn and compaction prompts
- pi-agent-router — Active-agent routing and controlled subagent delegation
- pi-multi-auth — Multi-provider credential management, OAuth login, and account rotation
- pi-tool-display — Compact tool rendering and diff visualization
