html2link Artifact Publishing
Publish a finished local artifact and return the exact URL from the API. Treat every generated URL as public.
Core workflow
- Finish and verify the artifact before uploading it.
- Package a multi-file static site as a ZIP containing
index.html.
- Check that the artifact contains no secrets, credentials, or unintended private data.
- Prefer the
html2link CLI when it is installed; otherwise use the anonymous curl fallback.
- Parse the exit status and JSON response. Do not claim success unless it contains
url.
- Return the exact
url value as a clickable link. Do not reconstruct it from slug.
Publish a new artifact
With the CLI:
html2link publish /absolute/path/to/report.html
Anonymous curl fallback for files up to 1 MB:
curl --fail-with-body -F "file=@/absolute/path/to/report.html" https://html2link.dev/api/upload
For larger files, use an API token from the signed-in home page:
HTML2LINK_API_TOKEN="..." html2link publish /absolute/path/to/report.html
Keep authenticated operations in the CLI so credentials stay in the local process environment rather than being embedded in reusable shell commands.
Use --json when another program needs the complete response:
html2link publish /absolute/path/to/report.html --json
Handle a successful response
{
"slug": "a1B2c3D4",
"updateToken": "keep-this-private",
"url": "https://html2link.dev/x/a1B2c3D4",
"kind": "html",
"size": "42 KB",
"updated": false
}
- Return
url to the user.
- Keep
updateToken private. Never include it in a public link or expose it unless the user explicitly needs to manage the upload.
- Retain
slug with updateToken only when the user asks to update or delete the same link later.
Update an existing link
Use the original slug, its updateToken, and the replacement file. A successful update keeps the public URL unchanged.
html2link update /absolute/path/to/report.html --slug a1B2c3D4 --update-token "keep-this-private"
Delete or list links
html2link delete --slug a1B2c3D4 --update-token "keep-this-private"
html2link list --token "$HTML2LINK_API_TOKEN"
Handle errors
400: Fix the multipart body, file type, slug, or update token before retrying.
401 with requiresLogin: true: Tell the user the anonymous limit was exceeded and ask them to provide an API token.
411: Retry with the CLI or a client that sends Content-Length.
413: Reduce or split the artifact. Do not retry the same file unchanged.
- Network error or a response without
url: Treat publishing as failed and do not invent a link.
Supported files and limits
- Extensions:
.html, .htm, .zip, .pdf, .md, .markdown, .xlsx, .xls, .csv, .docx, .pptx
- Static site ZIPs must contain
index.html; a single top-level folder is normalized automatically.
- Anonymous uploads: up to 1 MB.
- Authenticated uploads: up to 100 MB.
Safety and handoff rules
- Use an absolute local file path.
- Keep HTML self-contained when possible; remote assets can disappear or be blocked.
- Never upload environment files, access tokens, cookies, private keys, or credential-bearing logs.
- Never reveal
HTML2LINK_API_TOKEN or updateToken in the user-facing response.
- Do not describe a link as private or permanent.
- On success, provide a concise clickable link. On failure, state the blocker and next required action.
1---2name: html2link3description: Publish and manage browser-viewable artifacts with html2link. Use when a user asks an agent to deploy, publish, host, share, update, replace, or delete generated HTML, a static website ZIP, PDF, Markdown, spreadsheet, DOCX, or PPTX as a public link.4---56# html2link Artifact Publishing78Publish a finished local artifact and return the exact URL from the API. Treat every generated URL as public.910## Core workflow11121. Finish and verify the artifact before uploading it.132. Package a multi-file static site as a ZIP containing `index.html`.143. Check that the artifact contains no secrets, credentials, or unintended private data.154. Prefer the `html2link` CLI when it is installed; otherwise use the anonymous curl fallback.165. Parse the exit status and JSON response. Do not claim success unless it contains `url`.176. Return the exact `url` value as a clickable link. Do not reconstruct it from `slug`.1819## Publish a new artifact2021With the CLI:2223```bash24html2link publish /absolute/path/to/report.html25```2627Anonymous curl fallback for files up to 1 MB:2829```bash30curl --fail-with-body -F "file=@/absolute/path/to/report.html" https://html2link.dev/api/upload31```3233For larger files, use an API token from the signed-in home page:3435```bash36HTML2LINK_API_TOKEN="..." html2link publish /absolute/path/to/report.html37```3839Keep authenticated operations in the CLI so credentials stay in the local process environment rather than being embedded in reusable shell commands.4041Use `--json` when another program needs the complete response:4243```bash44html2link publish /absolute/path/to/report.html --json45```4647## Handle a successful response4849```json50{51 "slug": "a1B2c3D4",52 "updateToken": "keep-this-private",53 "url": "https://html2link.dev/x/a1B2c3D4",54 "kind": "html",55 "size": "42 KB",56 "updated": false57}58```5960- Return `url` to the user.61- Keep `updateToken` private. Never include it in a public link or expose it unless the user explicitly needs to manage the upload.62- Retain `slug` with `updateToken` only when the user asks to update or delete the same link later.6364## Update an existing link6566Use the original `slug`, its `updateToken`, and the replacement file. A successful update keeps the public URL unchanged.6768```bash69html2link update /absolute/path/to/report.html --slug a1B2c3D4 --update-token "keep-this-private"70```7172## Delete or list links7374```bash75html2link delete --slug a1B2c3D4 --update-token "keep-this-private"76html2link list --token "$HTML2LINK_API_TOKEN"77```7879## Handle errors8081- `400`: Fix the multipart body, file type, slug, or update token before retrying.82- `401` with `requiresLogin: true`: Tell the user the anonymous limit was exceeded and ask them to provide an API token.83- `411`: Retry with the CLI or a client that sends `Content-Length`.84- `413`: Reduce or split the artifact. Do not retry the same file unchanged.85- Network error or a response without `url`: Treat publishing as failed and do not invent a link.8687## Supported files and limits8889- Extensions: `.html`, `.htm`, `.zip`, `.pdf`, `.md`, `.markdown`, `.xlsx`, `.xls`, `.csv`, `.docx`, `.pptx`90- Static site ZIPs must contain `index.html`; a single top-level folder is normalized automatically.91- Anonymous uploads: up to 1 MB.92- Authenticated uploads: up to 100 MB.9394## Safety and handoff rules9596- Use an absolute local file path.97- Keep HTML self-contained when possible; remote assets can disappear or be blocked.98- Never upload environment files, access tokens, cookies, private keys, or credential-bearing logs.99- Never reveal `HTML2LINK_API_TOKEN` or `updateToken` in the user-facing response.100- Do not describe a link as private or permanent.101- On success, provide a concise clickable link. On failure, state the blocker and next required action.