pi-short-links
Shorten long URLs and file paths in Pi assistant output so OSC 8 / click targets fit the pane width.
Package details
Install pi-short-links from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-short-links- Package
pi-short-links- Version
0.2.0- Published
- Sep 6, 2026
- Downloads
- 300/mo · 300/wk
- Author
- eiei114
- License
- MIT
- Types
- extension
- Size
- 15 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./extensions/short-links.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
Pi Short Links
Shorten long URLs and file paths in Pi assistant output so links fit the pane and stay clickable.
What this is
Pi Short Links is a TypeScript Pi package that rewrites long bare http(s) URLs and absolute/~/ paths in assistant text into short markdown links ([host/…tail](full-url), [~/dir/…/file](file://…)). When FORCE_HYPERLINK=1 or TERM_PROGRAM=Orca, it also forces Pi TUI OSC 8 hyperlinks on. Fenced code blocks are left untouched.
Features
- Pane-width-aware shortening for bare
http(s)URLs. - Absolute /
~/path shortening withfile://targets. - Forces OSC 8 hyperlinks when
FORCE_HYPERLINK=1orTERM_PROGRAM=Orca. - Skips content inside fenced code blocks.
- Does not rewrite existing markdown links' destinations.
Install
Install the published npm package with Pi:
pi install npm:pi-short-links
Pin a specific version when you want reproducible installs:
pi install npm:pi-short-links@0.2.0
Install into the current project instead of your user Pi settings:
pi install npm:pi-short-links -l
Or install from GitHub:
pi install git:github.com/eiei114/pi-short-links
Try it without permanently installing:
pi -e npm:pi-short-links
Quick start
Try the local checkout without permanently installing it:
FORCE_HYPERLINK=1 pi -e .
Then send a message containing a long URL or absolute file path and confirm it renders as a short clickable link.
Package contents
| Path | Purpose |
|---|---|
extensions/short-links.ts |
Assistant-text shortening hook and OSC 8 force |
lib/shorten.ts |
URL/path shortening logic |
docs/release.md |
Trusted Publishing and release flow |
README.md |
GitHub and npm package entrypoint |
CHANGELOG.md |
Versioned release notes |
LICENSE |
MIT license |
Development
npm install
npm run ci
npm pack --dry-run
FORCE_HYPERLINK=1 pi -e .
Release
This package is set up for npm Trusted Publishing, so no NPM_TOKEN is required.
npm version minor
git push
See docs/release.md for setup details.
Docs
docs/release.md— Trusted Publishing and automated release detailsROADMAP.md— current status and planned work
Security
Pi packages can execute code with your local permissions. Review extensions before installing third-party packages.
For vulnerability reporting, see SECURITY.md.
Links
- npm: https://www.npmjs.com/package/pi-short-links
- GitHub: https://github.com/eiei114/pi-short-links
- Issues: https://github.com/eiei114/pi-short-links/issues
License
MIT