pi-short-links0.2.2
Shorten long URLs and file paths in Pi assistant output so OSC 8 / click targets fit the pane width.
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
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 run smoke:pi
npm pack --dry-run
FORCE_HYPERLINK=1 pi -e .
npm run smoke:pi launches the locally pinned Pi SDK in an isolated temporary
agent directory, verifies the actual extension over RPC, and uses a local
deterministic provider response (no paid inference or global Pi settings).
CI runs this smoke as part of npm run ci.
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
