← Catalog

pi-short-links

Shorten long URLs and file paths in Pi assistant output so OSC 8 / click targets fit the pane width.

Extension

Install

Install with PiG

pig install npm:pi-short-links

Install with Pi

pi install npm:pi-short-links
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./extensions/short-links.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.2.4 (README.md). PiG does not review it.

Join dotfield.xyz on Discord

CI Publish npm version npm downloads License: MIT Pi package Trusted Publishing Buy Me A Coffee

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 with file:// targets.
  • Forces OSC 8 hyperlinks when FORCE_HYPERLINK=1 or TERM_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

PathPurpose
extensions/short-links.tsAssistant-text shortening hook and OSC 8 force
lib/shorten.tsURL/path shortening logic
docs/release.mdTrusted Publishing and release flow
README.mdGitHub and npm package entrypoint
CHANGELOG.mdVersioned release notes
LICENSEMIT 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

Security

Pi packages can execute code with your local permissions. Review extensions before installing third-party packages.

For vulnerability reporting, see SECURITY.md.

License

MIT