---
slug: "pi-session-name-border"
source_type: "readme"
source_url: "https://cdn.jsdelivr.net/gh/rxreyn3/pi-session-name-border@master/README.md"
repo: "https://github.com/rxreyn3/pi-session-name-border"
source_file: "README.md"
branch: "master"
---
# pi-session-name-border

Show the current [Pi](https://pi.dev) session name on the prompt editor's horizontal border.

This is especially useful with [`pi-session-auto-rename`](https://www.npmjs.com/package/pi-session-auto-rename), which automatically calls `pi.setSessionName(...)` after the first prompt. This extension reads that same public session name with `pi.getSessionName()` and displays it on the editor border:

```text
──────────────────────────── Refactor Auth Module
<editor input area>
──────────────────────────────────────────────────
```

No Pi core/source changes are required.

## Features

- Displays the current session name on Pi's prompt editor border instead of in the bottom footer.
- Works with names generated by `pi-session-auto-rename` or any extension that calls `pi.setSessionName(...)`.
- Refreshes from Pi lifecycle events or `/session-name-status refresh`; no periodic polling loop or slash-command guessing is used.
- Includes `/session-name-status` to hide, show, toggle, or force refresh the border label.

## Install

### Local development install

From the parent directory containing this package:

```bash
pi install ./pi-session-name-border
```

Or run Pi with the extension for only the current invocation:

```bash
pi -e ./pi-session-name-border
```

### GitHub install

```bash
pi install git:github.com/rxreyn3/pi-session-name-border
```

You can also pin a tag or branch:

```bash
pi install git:github.com/rxreyn3/pi-session-name-border@v0.2.2
```

### npm install

```bash
pi install npm:pi-session-name-border
```

## Pairing with pi-session-auto-rename

Install both packages:

```bash
pi install npm:pi-session-auto-rename
pi install npm:pi-session-name-border
```

Then start a new Pi session and send a prompt. Once `pi-session-auto-rename` generates a title during normal message flow, this extension will show it on the editor border.

Pi does not currently expose a dedicated session-name-changed event to extensions, so this extension refreshes from lifecycle events. If another extension changes the session name outside normal message flow, run `/session-name-status refresh` to force the border label to update.

## Command

```text
/session-name-status [on|off|toggle|refresh]
```

Examples:

```text
/session-name-status off
/session-name-status on
/session-name-status refresh
```

With no argument, the command toggles visibility.

## Notes

This extension uses Pi's public `ctx.ui.setEditorComponent(...)` API. Like other custom-editor extensions, it may conflict with extensions that also replace the editor component; whichever extension sets the editor last wins. If the label disappears after enabling another custom-editor extension, reinstall/reorder this extension or disable the other editor replacement.

Visibility changes from `/session-name-status off`, `on`, or `toggle` persist for the current Pi process only.

## Publishing checklist

To make this available to other users and eligible for discovery on <https://pi.dev/packages>:

1. Ensure `package.json` includes the `pi-package` keyword and a `pi.extensions` manifest.
2. Commit the package to git.
3. Create/push the public GitHub repository at `github.com/rxreyn3/pi-session-name-border`.
4. Verify GitHub install:

   ```bash
   pi install git:github.com/rxreyn3/pi-session-name-border
   ```

5. Publish to npm:

   ```bash
   npm pack --dry-run
   npm publish --access public
   ```

6. Verify npm install:

   ```bash
   pi install npm:pi-session-name-border
   ```

The Pi package gallery displays packages tagged with `pi-package`; publishing publicly via npm is the best path for broad package-gallery discoverability.

## License

MIT
