---
name: flingflyers
description: Turn a local HTML file or PDF into a short shareable link via flingflyers.com. Use when the user has a file you or they just made — a report, chart, dashboard, mockup, slide deck export — and they want to send it to someone, get a URL for it, or open it in a browser without passing a local path around. No account or API key needed.
when_to_use: Use when the user asks to share, send, publish, or "get a link for" an HTML file or PDF, or asks where to put one so someone else can see it. Also use right after generating an HTML artifact when the user's goal was clearly to show it to someone. Do not use for deploying a website, for sharing source code as text, or for any file that is not HTML or PDF.
---

# Share an HTML file as a link

`flingflyers` turns a local HTML file (or PDF) into a short public URL. Nothing to
install — it runs through `npx` and needs Node 22+.

## Before you publish

**A flyer is readable by anyone who has the link.** There is no password and no access
control. Two rules follow:

1. **Confirm before uploading** unless the user has already asked you to share or
   publish. Do not upload a file just because it exists and looks shareable. Say what
   you are about to publish and roughly what is in it.
2. **Never publish content the user did not intend to make public** — credentials, API
   keys, tokens, internal hostnames, customer data, anything from a `.env`. If the HTML
   has embedded data and you are not sure it is safe to expose, ask.

## The command

```sh
npx -y flingflyers <file> --persist --json
```

`--persist` uploads the file, prints the result, and exits. The link keeps working
without anything left running. This is the right choice nearly every time.

`--json` prints exactly one JSON object on stdout and nothing else. Errors go to stderr
with exit code 1.

```json
{"id":"x7Kp2mQ","url":"https://flingflyers.com/p/x7Kp2mQ","mode":"blob",
 "encrypted":false,"sizeBytes":1204,"expiresAt":1752950000,
 "expiresAtIso":"2026-07-19T18:33:20.000Z","host":"https://flingflyers.com"}
```

Give the user the `url`. **Also tell them when it expires**, from `expiresAtIso` — a
link that quietly dies next week is a bad surprise, and they may want a longer TTL.

## Options

| Need | Flag |
|---|---|
| Different lifetime | `--ttl 24h` \| `7d` \| `30d` — default 7 days, 30 is the maximum |
| Server must never see the content in plaintext | `-e` |
| Content is on stdin rather than on disk | use `-` as the filename |

### `-e` (encryption)

The file is encrypted locally with AES-256-GCM and the key is appended to the URL as
`#k=…`. Browsers never send the fragment over the network, so the server stores only
ciphertext.

Be accurate about what this does when you explain it: anyone with the **full** link can
still read the page, so it is not access control. And because the server delivers the
JavaScript that decrypts, the honest claim is "an honest host can't read your content",
not "a malicious host can't".

**This only works from a local process.** If you are running somewhere the file would be
sent to a server before being encrypted, you cannot produce an encrypted flyer — publish
a plain one and tell the user to run the CLI on their own machine if they need it.

### Live mode (no `--persist`)

Without `--persist` the process stays in the foreground and serves the file from disk on
every request, so edits show up on refresh. The link dies when the process is killed.

**Only use this when the user explicitly wants a live/temporary link**, because it
occupies a running process and the link breaks the moment it stops. `--persist` is the
default choice.

## Managing flyers afterwards

```sh
npx -y flingflyers ls               # list flyers and their state
npx -y flingflyers revoke <id>      # kill a link immediately
npx -y flingflyers persist <id>     # re-upload after editing, and reset the expiry
```

Ownership is a token stored in `~/.config/flyer/pastes.json` — there are no accounts, so
these only work from the machine that created the flyer.

## Limits and failure modes

- **5 MB per file.** HTML and PDF only; this is not general file hosting.
- **Single file.** No bundles, no linked assets — inline CSS, JS, and images, or use a
  data URI. A flyer that references `./style.css` will render unstyled.
- Creation is rate limited per IP. Do not loop over a directory publishing files.
- Non-zero exit means it failed; the reason is on stderr. Common ones: file over the cap,
  file not found, or the host being unreachable.

## When not to use this

- Deploying an actual website or app — use real hosting.
- Sharing code as text — use a gist or paste the code.
- Anything that needs to still resolve in a year. Maximum life is 30 days.
- Anything private. There is no access control.

Full docs, including the HTTP API for non-Node callers: <https://flingflyers.com/llms.txt>
