lan-artifacts-pi
Pi tools for publishing and managing self-contained HTML artifacts on a LAN Artifacts server
Package details
Install lan-artifacts-pi from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:lan-artifacts-pi- Package
lan-artifacts-pi- Version
0.1.0- Published
- Aug 25, 2026
- Downloads
- 132/mo · 132/wk
- Author
- liushiyumathxjtu
- License
- MIT
- Types
- extension
- Size
- 32 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./extensions/lan-artifacts.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
lan-artifacts-pi
Self-hosted HTML artifacts for Pi. Package includes a small local server and four Pi tools.
Install
pi install npm:lan-artifacts-pi
Or install a pinned GitHub release:
pi install git:github.com/liush2yuxjtu/lan-artifacts-pi@v0.1.0
Start server
Set one shared write token for server and Pi, then start both from the same shell environment:
export LAN_ARTIFACT_WRITE_TOKEN="$(openssl rand -hex 24)"
npx lan-artifacts-pi
pi
Server defaults to http://127.0.0.1:4173 and stores data under ~/.lan-artifacts.
To make pages readable from other devices on your LAN, opt in explicitly:
LAN_ARTIFACT_HOST=0.0.0.0 npx lan-artifacts-pi
Tools
artifact_publish: create an artifact, or add a version whenartifactIdis explicitartifact_list: list artifactsartifact_get: inspect one artifact and its versionsartifact_delete: permanently delete an artifact after interactive human confirmation
Configuration
| Variable | Default | Purpose |
|---|---|---|
LAN_ARTIFACT_SERVER |
http://127.0.0.1:4173 |
Server URL used by Pi tools |
LAN_ARTIFACT_WRITE_TOKEN |
generated by server | Required for create, update, and delete |
LAN_ARTIFACT_HOST |
127.0.0.1 |
Server bind address; use 0.0.0.0 only to opt into LAN access |
LAN_ARTIFACT_PORT |
4173 |
Server port |
LAN_ARTIFACT_DIR |
~/.lan-artifacts |
Artifact metadata and immutable HTML versions |
LAN_ARTIFACT_MAX_VERSIONS |
50 |
Versions retained per artifact |
If the server generates a token because none was supplied, copy its printed value into LAN_ARTIFACT_WRITE_TOKEN before starting Pi.
Safety
- Default binding is loopback-only. Setting
LAN_ARTIFACT_HOST=0.0.0.0makes artifact reads available to devices able to reach your machine. - Never publish passwords, API keys, tokens, private source, or confidential data.
- Write operations require
x-artifact-write-token; token values are read only from process environment and never from dotenv files. - Artifact HTML renders in a sandboxed iframe under restrictive CSP and cannot make external requests.
artifact_publishcreates a new artifact unlessartifactIdis explicit, avoiding silent overwrite of unrelated work.artifact_deleteis unavailable without interactive UI and requires human confirmation.- Package does not inject system prompts, auto-publish progress, or read Claude/Pi session context.
- Pi extensions execute with full user permissions. Review source before installation.
Development
npm install
npm test
npm run typecheck
npm pack --dry-run
License
MIT