npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-autoname

v0.6.4

Published

AI-powered session naming for Pi — generate meaningful, semantic session names via LLM

Readme

✨ What it does

| Scenario | Behavior | |---|---| | First dialogue completes | Automatically generates a semantic session name | | Conversation continues | Silently re-names every 10 minutes (configurable) | | Session topic drifts | Name updates to reflect the new focus | | Run /autoname | Manually regenerate from recent context | | AI naming fails | Falls back to smart text extraction |

🚀 Install

pi install npm:pi-autoname

Works out of the box. No configuration needed — uses your current session's model by default.

⚙️ Configuration

Config file is auto-generated on first use at ~/.pi/agent/pi-autoname.json:

{
  "enabled": true,
  "model": "",
  "fallbackModels": [],
  "cooldownMinutes": 10,
  "debug": false,
  "respectManualName": false
}

| Field | Type | Default | Description | |---|---|---|---| | enabled | boolean | true | Set to false to disable AI naming | | model | string | (session model) | Primary model (provider/modelId). Empty = use session model | | fallbackModels | string[] | [] | Additional models to try if primary fails | | cooldownMinutes | number | 10 | Minutes between periodic re-names | | debug | boolean | false | Enable debug logging | | respectManualName | boolean | false | When false (default), pi-autoname owns session naming: automatic naming runs on first dialogue and periodically, and may overwrite a name set via /name or /autoname. Set to true for the legacy behavior of treating a user-issued rename as sticky. |

Example: Model fallback chain

{
  "enabled": true,
  "model": "minimax-cn/MiniMax-M2.7",
  "fallbackModels": [
    "xiaomi-token-plan-cn/mimo-v2-omni"
  ],
  "cooldownMinutes": 10
}

This tries models in order: MiniMax-M2.7mimo-v2-omni → session model.

🏗️ How it works

Automatic naming

first user message
        ↓
first assistant reply finishes
        ↓
AI generates semantic session name
        ↓
setSessionName(name)

Periodic re-naming

agent_end event (new message processed)
        ↓
cooldown passed? (10 min default)
        ↓
AI generates new name from recent context
        ↓
name changed? → silently update
name same? → skip

Model fallback chain

primary model (from config)
        ↓ failed?
fallback models (from config)
        ↓ failed?
session model (automatic)
        ↓ failed?
smart text extraction (no AI)

Manual naming

/autoname

Regenerates the session name from recent conversation context. Useful when you want to force an immediate rename.

Built-in /name is largely redundant

Pi's native command still works:

/name My custom title

However, with pi-autoname installed, the periodic re-naming (cooldownMinutes default 10 min) will likely overwrite your /name change on the next agent_end. This is the default behavior (respectManualName: false) — pi-autoname owns the session name.

  • For a one-shot rename that pi-autoname will then take over again: use /name.
  • To force a re-name from the current conversation right now: use /autoname.
  • To opt out of pi-autoname ever overwriting your /name: set respectManualName: true in the config.

/name grace period

When you /name a session, pi-autoname detects the out-of-band change on the next agent_end and resets the rename cooldown to now. That gives your /name choice a full cooldownMinutes window before the next periodic rename is allowed to consider overwriting it. If the conversation topic changes earlier, the periodic rename will still run normally — /name is a grace period, not a lock.

🔐 Privacy note

pi-autoname sends a short, recent conversation excerpt to the selected naming model. Before sending, it redacts common secret patterns such as API keys, bearer tokens, AWS access keys, private keys, and *_TOKEN / *_SECRET / *_PASSWORD environment assignments. If the AI call fails and the user text contained a detected secret, the local fallback name is skipped to avoid turning secrets into session names.

🌍 Locale support

Auto-detected from system environment (PI_LOCALE > LC_ALL > LANG). Names are generated in the detected language.

🔗 Related

License

MIT