Publish Artifact
Publish only the artifact the user wants to share. Resolve script paths relative to this skill directory.
Workflow
Identify the completed file or directory. If several candidates exist, ask which one to publish.
Do not publish repositories, home directories, credentials, environment files, browser profiles, database files, or unrelated outputs. Inspect the intended artifact for obvious secrets before copying it.
Confirm the service is healthy:
systemctl --user is-active --quiet agent-artifacts.service || scripts/install-service.sh
Publish the artifact in snapshot mode by default:
python3 scripts/publish_artifact.py <file-or-directory>
Use --name <slug> when the user requests a memorable URL name. The publisher still creates a unique path and never overwrites an existing artifact.
Use live mode only when the user explicitly asks for the published URL to reflect ongoing edits to the original file or directory:
python3 scripts/publish_artifact.py --live <file-or-directory>
Live mode links the URL to the original path. Clearly tell the user that later changes and newly added files under a live directory become immediately visible. Never choose live mode merely to avoid a small copy.
Verify the returned URL server-side with curl --fail --head <url>. If localhost is not resolvable locally, verify the 127.0.0.1 URL reported by --json instead.
Return the http://localhost:8787/... URL. Mention the IP fallback printed by the script when useful for VPN or DNS troubleshooting.
Supported artifacts
- A single PDF, image, archive, text file, or other downloadable file is published at a direct file URL.
- A standalone HTML file is published at a direct HTML URL.
- A directory is copied intact so relative HTML, CSS, JavaScript, image, and font references continue to work. If it contains
index.html, the returned URL opens it automatically; otherwise the server shows a directory listing.
- With explicit
--live, the URL serves the selected original file or directory and reflects subsequent edits without republishing. The server blocks nested symbolic links that escape the selected live root.
Artifact homepage
Open http://localhost:8787/ for the responsive artifact library. It provides search, snapshot/live/broken filters, counts, open and copy-URL actions, refresh, and confirmed deletion. Deleting a snapshot removes only its published copy. Deleting a live publication removes only its publication link and preserves the original file or directory.
Maintenance
List published artifacts:
python3 scripts/publish_artifact.py --list
Delete publications older than 30 days:
python3 scripts/publish_artifact.py --prune-days 30
Snapshot mode exposes only copies under ~/.local/share/agent-artifacts/public. Opt-in live mode exposes only the explicitly selected original path, and the server prevents traversal through nested symbolic links outside that publication. The service intentionally has no application-level authentication and must remain limited to the trusted LAN/VPN by host firewall and network policy.
1---2name: publish-artifact3description: Publish generated HTML, PDFs, images, reports, or artifact directories to the machine's dedicated LAN/VPN web server and return a browser-ready URL. Use when the user needs to view or download non-terminal output from another device.4---56# Publish Artifact78Publish only the artifact the user wants to share. Resolve script paths relative to this skill directory.910## Workflow11121. Identify the completed file or directory. If several candidates exist, ask which one to publish.132. Do not publish repositories, home directories, credentials, environment files, browser profiles, database files, or unrelated outputs. Inspect the intended artifact for obvious secrets before copying it.143. Confirm the service is healthy:1516 ```bash17 systemctl --user is-active --quiet agent-artifacts.service || scripts/install-service.sh18 ```19204. Publish the artifact in snapshot mode by default:2122 ```bash23 python3 scripts/publish_artifact.py <file-or-directory>24 ```2526 Use `--name <slug>` when the user requests a memorable URL name. The publisher still creates a unique path and never overwrites an existing artifact.2728 Use live mode only when the user explicitly asks for the published URL to reflect ongoing edits to the original file or directory:2930 ```bash31 python3 scripts/publish_artifact.py --live <file-or-directory>32 ```3334 Live mode links the URL to the original path. Clearly tell the user that later changes and newly added files under a live directory become immediately visible. Never choose live mode merely to avoid a small copy.355. Verify the returned URL server-side with `curl --fail --head <url>`. If `localhost` is not resolvable locally, verify the `127.0.0.1` URL reported by `--json` instead.366. Return the `http://localhost:8787/...` URL. Mention the IP fallback printed by the script when useful for VPN or DNS troubleshooting.3738## Supported artifacts3940- A single PDF, image, archive, text file, or other downloadable file is published at a direct file URL.41- A standalone HTML file is published at a direct HTML URL.42- A directory is copied intact so relative HTML, CSS, JavaScript, image, and font references continue to work. If it contains `index.html`, the returned URL opens it automatically; otherwise the server shows a directory listing.43- With explicit `--live`, the URL serves the selected original file or directory and reflects subsequent edits without republishing. The server blocks nested symbolic links that escape the selected live root.4445## Artifact homepage4647Open `http://localhost:8787/` for the responsive artifact library. It provides search, snapshot/live/broken filters, counts, open and copy-URL actions, refresh, and confirmed deletion. Deleting a snapshot removes only its published copy. Deleting a live publication removes only its publication link and preserves the original file or directory.4849## Maintenance5051List published artifacts:5253```bash54python3 scripts/publish_artifact.py --list55```5657Delete publications older than 30 days:5859```bash60python3 scripts/publish_artifact.py --prune-days 3061```6263Snapshot mode exposes only copies under `~/.local/share/agent-artifacts/public`. Opt-in live mode exposes only the explicitly selected original path, and the server prevents traversal through nested symbolic links outside that publication. The service intentionally has no application-level authentication and must remain limited to the trusted LAN/VPN by host firewall and network policy.