---
name: html-to-link-deploy-en
version: 1.1.0
description: Package and upload a project to HTML To Link. Anonymous agents can create and update their own 24-hour pages; an account token enables long-term management.
---

# HTML To Link Deploy Skill

Use this skill to automatically package the current project and publish it to `https://htmlto.link`.

## Optional env

- `HTML_TO_LINK_TOKEN`: optional. Without it, use project-scoped anonymous update credentials. With it, use account permissions to create, update, and manage pages.

## Workflow

1. Try to read `HTML_TO_LINK_TOKEN` from the environment.
2. Read `.htmltolink.json` from the project root. With an account token, reuse its `shareUrl`. Without an account token, update a project-owned temporary page only when both `shareUrl` and `updateToken` are present.
3. Ask for the entry HTML file when it is unclear.
4. Package the project into a zip archive. Always exclude `.htmltolink.json` because it may contain anonymous update credentials, plus `node_modules`, `.git`, `.next`, `dist/cache`, and other non-deployment folders.
5. Call:

```bash
curl -X POST "https://htmlto.link/api/skill/deploy" \
  -F "file=@htmltolink-upload.zip" \
  -F "entry_file=index.html" \
  -F "title=my-site"
```

Logged-in users add `Authorization: Bearer $HTML_TO_LINK_TOKEN` and may include `share_url` to update their own page.

For an anonymous update, omit Authorization and include both:

```bash
-F "share_url=<shareUrl from .htmltolink.json>" \
-F "update_token=<updateToken from .htmltolink.json>"
```

`shareUrl` identifies a page; `updateToken` grants update access to that temporary page. The API must reject missing or mismatched credentials.

## Project config file

After a successful anonymous deployment, create or replace `.htmltolink.json` with this structure:

```json
{
  "shareUrl": "https://htmlto.link/temp_xxxxxxxx",
  "updateToken": "updateToken returned by the API",
  "temporary": true,
  "expiresAt": "expiresAt returned by the API"
}
```

After each update, replace the corresponding fields with the latest response. This file grants update access, so add it to `.gitignore` and always exclude it from the upload ZIP.

## Output handling

- Without an account token or anonymous credentials: create a temporary page that lasts 24 hours
- Without an account token and with a matching `shareUrl + updateToken`: update the same temporary link and reset its lifetime to 24 hours from this deployment
- With a token and no `share_url`: create a managed page
- With a token and `share_url`: upload a new version for that user's page
- Always create or update `.htmltolink.json` after success
- In anonymous mode save `shareUrl`, `updateToken`, `temporary`, and `expiresAt`; in authenticated mode save at least `shareUrl` and `versionNo`
- In anonymous mode ensure `.gitignore` contains `.htmltolink.json`; never display or commit `updateToken`
- After updating the config file, return only the final `shareUrl` to the user
