@d3ara1n/pi-session-namer
v0.1.1
Published
Auto-name pi sessions using a cheap side agent — generates concise titles from the first user message
Downloads
379
Readme
@d3ara1n/pi-session-namer
Auto-name pi sessions using a cheap side agent.
On the first user prompt of a new session, calls a lightweight side agent model
to generate a concise session title, then sets it via pi.setSessionName().
Subsequent turns are skipped with near-zero overhead.
Features
- Zero-config: Works out of the box with pi-model-roles'
utilityrole - First-turn only: Adds ~0.5-1s latency on the first prompt, zero overhead after
- Graceful fallback: If the side agent fails, truncates the user prompt as name
- Manual rename:
/namer:renameto regenerate at any time
Configuration
In ~/.pi/agent/settings.json:
{
"sessionNamer": {
"enabled": true,
"sideAgentRole": "utility",
"maxLength": 50,
"language": "zh"
}
}| Field | Default | Description |
|-------|---------|-------------|
| enabled | true | Global on/off switch |
| sideAgentRole | "utility" | pi-model-roles role for the naming side agent |
| maxLength | 50 | Maximum name length in characters |
Project-level .pi/settings.json overrides global settings.
Commands
| Command | Description |
|---------|-------------|
| /namer | Show status and config |
| /namer on | Enable auto-naming |
| /namer off | Disable auto-naming |
| /namer:rename | Regenerate session name from last prompt |
Dependencies
@earendil-works/pi-ai—complete()for LLM calls@earendil-works/pi-coding-agent— Extension API@d3ara1n/pi-model-roles— Model role resolution
Install
Add to ~/.pi/agent/settings.json:
{
"extensions": [
"/path/to/pi-extensions/packages/pi-session-namer"
]
}