---
name: share
description: Publish an HTML file to sharable.link and get a shareable URL. Use when the user says "share this", "publish this", "make this shareable", "share link", or "/share".
argument-hint: "[file.html]"
allowed-tools: Read, Bash, Glob
---

Publish an HTML file to sharable.link so it's accessible via a unique public URL.

## Steps

1. **Find the HTML file to share:**
   - If the user provided a file path in `$ARGUMENTS`, use that file.
   - Otherwise, use Glob to find the most recently created `.html` file in the project (check common output locations: current directory, `out/`, `dist/`, `build/`, `output/`).
   - If multiple HTML files exist and none was specified, list them and ask which one to share.

2. **Read the file** using the Read tool. Verify it contains HTML content.

3. **Publish it** by running this curl command via Bash (replace the content):

```bash
curl -s -X POST https://sharable.link/api/publish \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg html "$(cat FILE_PATH)" '{html: $html}')"
```

Replace `FILE_PATH` with the actual path to the HTML file.

4. **Return the result** — parse the JSON response and show the user the shareable URL. Format it clearly like:

> Published! Your sharable link: https://sharable.link/abc123
