{"_id":"@alexanderfortin/pi-share-opengist","_rev":"3-7b4171b10a3fa2baee198ef40458d27d","name":"@alexanderfortin/pi-share-opengist","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@alexanderfortin/pi-share-opengist","version":"0.1.0","keywords":["pi-package","pi-extension","opengist","gist","share","session"],"author":{"name":"Alexander Fortin"},"license":"MIT","_id":"@alexanderfortin/pi-share-opengist@0.1.0","maintainers":[{"name":"alexanderfortin","email":"a@l3x.in"}],"homepage":"https://github.com/shaftoe/pi-share-opengist#readme","bugs":{"url":"https://github.com/shaftoe/pi-share-opengist/issues"},"pi":{"extensions":["./dist/index.js"]},"dist":{"shasum":"8872029114610cb6b24d59e8b967888ac3110406","tarball":"https://registry.npmjs.org/@alexanderfortin/pi-share-opengist/-/pi-share-opengist-0.1.0.tgz","fileCount":4,"integrity":"sha512-6qSd2NBbwU71T9BcyXQY089brlkIbazofcoSEQmMfUHfq6JWFIa98NqikrlRT7TRZ1ZfxEZDFg5qCLnAsqaAfQ==","signatures":[{"sig":"MEUCIHAiKzDolc1OZyUrDxCTn5xHCnO/e2Vc3C4GRvft6TesAiEAxyT0TeMChErsrU4p0tqEDu3J2Sp+AKEpooNJRaDBud4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":8130},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"ff65abebcd7af4e854a8dae86e4bae08d9b199ff","scripts":{"dev":"bun --watch src/index.ts","lint":"biome check src/ tests/","test":"bun test","build":"bun run typecheck && bun run build:tsc","check":"bun run typecheck && bun run lint","format":"biome format --write src/","release":"semantic-release","lint:fix":"biome check --write src/ tests/","build:tsc":"tsc","typecheck":"tsc --noEmit --project tsconfig.test.json","test:coverage":"bun test --coverage --coverage-reporter=lcov","release:dry-run":"semantic-release --dry-run"},"_npmUser":{"name":"alexanderfortin","email":"a@l3x.in"},"repository":{"url":"git+https://github.com/shaftoe/pi-share-opengist.git","type":"git"},"_npmVersion":"11.17.0","description":"Pi extension that shares sessions to a self-hosted Opengist instance","directories":{},"_nodeVersion":"26.4.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.14","typescript":"^6.0.3","@biomejs/biome":"^2.5.0","semantic-release":"^25.0.5","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^13.1.5","@semantic-release/exec":"^7.1.0","@semantic-release/github":"^12.0.8","@semantic-release/commit-analyzer":"^13.0.1","@alexanderfortin/semantic-release-keep-a-changelog":"^0.4.2"},"peerDependencies":{"@earendil-works/pi-coding-agent":"^0.79.6"},"_npmOperationalInternal":{"tmp":"tmp/pi-share-opengist_0.1.0_1782761601501_0.3865665572420047","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@alexanderfortin/pi-share-opengist","version":"0.1.1","keywords":["pi-package","pi-extension","opengist","gist","share","session"],"author":{"name":"Alexander Fortin"},"license":"MIT","_id":"@alexanderfortin/pi-share-opengist@0.1.1","maintainers":[{"name":"alexanderfortin","email":"a@l3x.in"}],"homepage":"https://github.com/shaftoe/pi-share-opengist#readme","bugs":{"url":"https://github.com/shaftoe/pi-share-opengist/issues"},"pi":{"extensions":["./dist/index.js"]},"dist":{"shasum":"74de4795b0b516f5465e63bbfce1b983a511517a","tarball":"https://registry.npmjs.org/@alexanderfortin/pi-share-opengist/-/pi-share-opengist-0.1.1.tgz","fileCount":24,"integrity":"sha512-djRro3MrFjOyWmVNBzCMCgGtsXsXv+1O+hlku6aE6SoMOkKlbBh5hpNNy28nssYtHTwQIUSqySr208Pr9br+Lw==","signatures":[{"sig":"MEUCIFusa18IqT3RU00CQDIhMHh18R/Z4I4nTMYDbjna/rsbAiEAtKWfPACl76LBDtVcno7nIyznTfJ9qaY9RgTbpAvtyn8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alexanderfortin%2fpi-share-opengist@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":45567},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"d85cafe6b45d3a501fbd732b5d03834083f9172e","scripts":{"dev":"bun --watch src/index.ts","lint":"biome check src/ tests/","test":"bun test","build":"bun run typecheck && bun run build:tsc","check":"bun run typecheck && bun run lint","format":"biome format --write src/","release":"semantic-release","lint:fix":"biome check --write src/ tests/","build:tsc":"tsc","typecheck":"tsc --noEmit --project tsconfig.test.json","test:coverage":"bun test --coverage --coverage-reporter=lcov","release:dry-run":"semantic-release --dry-run"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:11039c18-e28b-4e49-835b-01a670992133"}},"repository":{"url":"git+https://github.com/shaftoe/pi-share-opengist.git","type":"git"},"_npmVersion":"11.17.0","description":"Pi extension that shares sessions to a self-hosted Opengist instance","directories":{},"_nodeVersion":"24.17.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"^1.3.14","typescript":"^6.0.3","@biomejs/biome":"^2.5.1","semantic-release":"^25.0.5","@semantic-release/git":"^10.0.1","@semantic-release/npm":"^13.1.5","@semantic-release/exec":"^7.1.0","@semantic-release/github":"^12.0.8","@semantic-release/commit-analyzer":"^13.0.1","@alexanderfortin/semantic-release-keep-a-changelog":"^0.4.4"},"peerDependencies":{"@earendil-works/pi-coding-agent":"^0.80.2"},"_npmOperationalInternal":{"tmp":"tmp/pi-share-opengist_0.1.1_1782808143769_0.9180398272295767","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"pi":{"extensions":["./dist/index.js"]},"_id":"@alexanderfortin/pi-share-opengist@0.2.0","bugs":{"url":"https://github.com/shaftoe/pi-share-opengist/issues"},"dist":{"shasum":"47c9b63b9aaa238c8ed6c2c4d60f0eb66c136f0e","tarball":"https://registry.npmjs.org/@alexanderfortin/pi-share-opengist/-/pi-share-opengist-0.2.0.tgz","fileCount":24,"integrity":"sha512-F3KbLCnrRBCQ9HKIS9O7dKkB7+frDCIVZA85qwirqzGWLsKzNV9ZX3+LDRbGhswyxuIwZw1karLoyMSCU3lSDQ==","signatures":[{"sig":"MEYCIQDOz0dCdgiFA988AD8eOJ/G9Wi8yApAxBPnUfJIi0IkVAIhAKsuOf88yMtdPjENdVg7v6VrVUKf0eWbP1GCM/PmCHHd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICA3h06+I0pushlAtAkVOa0bNGRbSRexxOGoWcXm6TA/AiEA1gDHPxD4C23JzPrQ5Ql60ofNeVaHbsmWl38jyEhNUlU="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alexanderfortin%2fpi-share-opengist@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":46411},"main":"./dist/index.js","name":"@alexanderfortin/pi-share-opengist","type":"module","types":"./dist/index.d.ts","author":{"name":"Alexander Fortin"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"gitHead":"7d411daedfe6c42790b9a43a7da773115594799b","license":"MIT","scripts":{"lint":"biome check src/ tests/","test":"vitest run","build":"pnpm run typecheck && pnpm run build:tsc","check":"pnpm run typecheck && pnpm run lint","format":"biome format --write src/","release":"semantic-release","lint:fix":"biome check --write src/ tests/","build:tsc":"tsc","typecheck":"tsc --noEmit --project tsconfig.test.json","test:watch":"vitest","test:coverage":"vitest run --coverage","release:dry-run":"semantic-release --dry-run"},"version":"0.2.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:11039c18-e28b-4e49-835b-01a670992133"}},"homepage":"https://github.com/shaftoe/pi-share-opengist#readme","keywords":["pi-package","pi-extension","opengist","gist","share","session"],"repository":{"url":"git+https://github.com/shaftoe/pi-share-opengist.git","type":"git"},"_npmVersion":"11.19.0","description":"Pi extension that shares sessions to a self-hosted Opengist instance","directories":{},"maintainers":[{"name":"alexanderfortin","email":"a@l3x.in"}],"_nodeVersion":"24.21.0","dependencies":{},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^4.0.0","typescript":"^7.0.2","@types/node":"^26.0.0","@biomejs/biome":"^2.5.14","semantic-release":"^25.0.9","@vitest/coverage-v8":"^4.0.0","@semantic-release/git":"^11.0.1","@semantic-release/npm":"^13.2.0","@semantic-release/exec":"^7.1.0","@semantic-release/github":"^12.0.10","@semantic-release/commit-analyzer":"^13.0.1","@alexanderfortin/semantic-release-keep-a-changelog":"^0.4.14"},"peerDependencies":{"@earendil-works/pi-coding-agent":"^0.87.1"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/pi-share-opengist_0.2.0_1790308815311_0.7582124909082624"}}},"time":{"created":"2026-06-29T19:33:21.367Z","modified":"2026-09-25T04:00:15.707Z","0.1.0":"2026-06-29T19:33:21.632Z","0.1.1":"2026-06-30T08:29:03.902Z","0.2.0":"2026-09-25T04:00:15.404Z"},"bugs":{"url":"https://github.com/shaftoe/pi-share-opengist/issues"},"author":{"name":"Alexander Fortin"},"license":"MIT","homepage":"https://github.com/shaftoe/pi-share-opengist#readme","keywords":["pi-package","pi-extension","opengist","gist","share","session"],"repository":{"url":"git+https://github.com/shaftoe/pi-share-opengist.git","type":"git"},"description":"Pi extension that shares sessions to a self-hosted Opengist instance","maintainers":[{"name":"alexanderfortin","email":"a@l3x.in"}],"readme":"# pi-share-opengist\n\nA [Pi](https://pi.dev) extension that exports the current session to the same self-contained HTML Pi already produces for `/export`, uploads it to a self-hosted [Opengist](https://opengist.io/) instance, and prints a shareable link — without relying on the GitHub CLI or GitHub gists.\n\nVisualize with <https://gistviewer.l3x.in/>\n\n## Install\n\n```bash\npi install @alexanderfortin/pi-share-opengist\n```\n\nOr, for local development:\n\n```bash\ngit clone https://github.com/shaftoe/pi-share-opengist\ncd pi-share-opengist\npnpm install\npnpm run build\npi -e ./dist/index.js\n```\n\n## Configuration\n\nAll configuration is via environment variables (consistent with Pi's existing `PI_SHARE_VIEWER_URL` convention), so the extension stays stateless.\n\n| Var | Required | Example | Purpose |\n|---|---|---|---|\n| `PI_OPENGIST_HOST` | yes | `https://opengist.my.domain` | Opengist base URL (no trailing slash) |\n| `PI_OPENGIST_TOKEN` | yes | `og_…` | Bearer token for `POST /api/gists` |\n| `PI_OPENGIST_VISIBILITY` | no | `unlisted` | `public` \\| `unlisted` \\| `private` (gist visibility) |\n| `PI_OPENGIST_PUBLIC` | no | — | Legacy: `true` maps to `public` (overridden by `PI_OPENGIST_VISIBILITY`) |\n| `PI_SHARE_VIEWER_URL` | no | `https://gistviewer.l3x.in/` | Viewer base URL; the full Opengist URL is appended as `#<gistUrl>`. Defaults to the public gistviewer so links render full-screen out of the box. Set to empty to get the raw Opengist URL. |\n| `PI_OPENGIST_USE_INPROCESS` | no | `1` | Opt-in fast path: deep-import Pi's internal exporter instead of shelling out to `pi --export` |\n\n## Usage\n\nIn a Pi session with some content, run:\n\n```\n/share-og\n```\n\nYou'll get a notification with the share URL (copied to the clipboard when available). By default it's a `https://gistviewer.l3x.in/#<opengist-url>` link that renders the session full-screen; set `PI_SHARE_VIEWER_URL` to point at your own viewer, or to an empty string for the raw Opengist URL.\n\n## How it works\n\n1. Reads host + token from env; bails with a clear error if missing.\n2. Exports the active session to HTML. By default it shells out to the public `pi --export <session>` CLI (zero coupling to Pi internals). Set `PI_OPENGIST_USE_INPROCESS=1` to instead deep-import Pi's internal `exportSessionToHtml` for an in-process fast path (relies on an internal module path; can break on minor Pi versions).\n3. `POST {host}/api/gists` with an Opengist body, `Authorization: Bearer <token>`, and `visibility: \"unlisted\"` by default (reachable by link, not listed publicly).\n4. Parses the returned gist URL/UUID.\n5. Builds the share URL — `<viewer>#<gistUrl>` — defaulting the viewer to <https://gistviewer.l3x.in/> so links render full-screen out of the box (override with `PI_SHARE_VIEWER_URL`; set it empty for the raw Opengist URL). Copies it to the clipboard and notifies.\n6. Respects `ctx.signal` so `Esc` cancels the upload.\n\n## Troubleshooting\n\n- **\"Set PI_OPENGIST_HOST and PI_OPENGIST_TOKEN…\"** — both env vars are required.\n- **`Share failed: Opengist responded 401: …`** — the token is invalid/expired.\n- **`pi --export failed`** — make sure `pi` is on your `PATH` in Pi's launch environment, or switch to the in-process path via `PI_OPENGIST_USE_INPROCESS=1`.\n- **`In-process export failed …`** — the internal Pi module moved; unset `PI_OPENGIST_USE_INPROCESS` to fall back to the CLI.\n\n## Development\n\n```bash\npnpm install\npnpm run check     # typecheck + lint\npnpm test         # unit tests\npnpm run build     # typecheck + emit dist/\npnpm run release:dry-run\n```\n\nPre-commit hooks run via [lefthook](https://github.com/evilmartians/lefthook): format, lint, and tests.\n\n## License\n\nMIT © Alexander Fortin\n","readmeFilename":"README.md"}