---
name: publish-to-mylocalhost
description: Publish a user-owned static HTML page or ZIP website to mylocalhost.ai and return a shareable URL. Use when the user asks to upload, deploy, host, publish, or share a static website through mylocalhost.ai.
---

# Publish to mylocalhost.ai

Use the public deployment API to publish static sites without an account.

Canonical skill URL: `https://mylocalhost.ai/SKILL.md`

## When to use

Use this skill when the user asks to publish a site they own or are authorized to publish and the source is one of:

- an HTML string
- one `.html` or `.htm` file
- one `.zip` archive containing a static website

Do not upload third-party content without authorization. Do not upload secrets, private keys, credentials, databases, server-side code, or personal data.

## API

Endpoint:

```text
POST https://mylocalhost.ai/api/v1/deployments
Content-Type: multipart/form-data
```

Required fields:

- `source_type`: `html_text`, `html_file`, or `zip`
- `public_confirmed`: `true`
- exactly one source:
  - `html_text` for `html_text`
  - `file` for `html_file` or `zip`

Optional fields:

- `title`: up to 200 characters
- `slug`: 8–64 lowercase letters, numbers, or hyphens; no underscores; must start and end with a letter or number

An explicit user request to publish their content counts as confirmation. If ownership or public visibility is unclear, ask before sending the request.

## Upload

Pasted HTML:

```bash
curl --fail-with-body -X POST "https://mylocalhost.ai/api/v1/deployments" \
  -F "source_type=html_text" \
  -F "html_text=<index.html" \
  -F "title=My site" \
  -F "public_confirmed=true"
```

Single HTML file:

```bash
curl --fail-with-body -X POST "https://mylocalhost.ai/api/v1/deployments" \
  -F "source_type=html_file" \
  -F "file=@index.html;type=text/html" \
  -F "title=My site" \
  -F "public_confirmed=true"
```

ZIP website:

```bash
curl --fail-with-body -X POST "https://mylocalhost.ai/api/v1/deployments" \
  -F "source_type=zip" \
  -F "file=@site.zip;type=application/zip" \
  -F "title=My site" \
  -F "public_confirmed=true"
```

Add `-F "slug=my-static-site"` only when the user requests a custom slug.

## Protect the management key

The response contains:

```json
{
  "deployment_id": "...",
  "status": "processing",
  "status_url": "...",
  "manage_token": "...",
  "expires_at": "..."
}
```

The `manage_token` is shown once and cannot be recovered. Treat it as a secret:

1. Never print it in chat, logs, commits, issue trackers, or public files.
2. Save the complete response to a user-approved local secret file, such as `.mylocalhost/<deployment_id>.json`.
3. Restrict the file to the current user (`chmod 600` where supported).
4. Ensure `.mylocalhost/` is excluded from version control.
5. Tell the user where the key was saved.

If secure storage fails, stop and warn the user before losing the response.

## Wait for publication

Poll the private status endpoint with the management key:

```text
GET https://mylocalhost.ai/api/v1/deployments/<deployment_id>/private
Authorization: Bearer <manage_token>
```

Poll every 2 seconds initially, then back off to 10 seconds. Stop after 10 minutes unless the user asks to continue.

Terminal outcomes:

- `ready`: return `site_url` to the user
- `review`: explain that moderation is pending
- `blocked`: explain that publication was rejected
- `failed`: report the safe error details and suggest correcting the package
- `deleted` or `expired`: explain that the deployment is unavailable

Do not invent a public URL before `site_url` is returned.

## Delete

Only delete after explicit user confirmation:

```text
DELETE https://mylocalhost.ai/api/v1/deployments/<deployment_id>
Authorization: Bearer <manage_token>
```

## Limits

- pasted HTML: 2 MiB
- HTML file: 5 MiB
- ZIP upload: 20 MiB compressed
- extracted ZIP: 50 MiB, 500 files
- sites are scanned, rendered, and moderated before publication
- anonymous deployments expire according to the `expires_at` value

## Final response

Return:

- deployment status
- shareable `site_url` when ready
- expiry time
- local path where the management key was saved

Never include the plaintext management key.
