aired 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -2
- package/SKILL.md +65 -9
- package/bin/aired +12 -0
- package/bin/node-pick.sh +17 -0
- package/dist/cli.cjs +144 -102
- package/dist/mcp.cjs +98 -0
- package/package.json +4 -2
package/README.md
CHANGED
|
@@ -111,6 +111,8 @@ echo "<h1>Hi</h1>" | aired --json
|
|
|
111
111
|
| `AIRED_API_URL` env var | Medium |
|
|
112
112
|
| Default (`https://aired.sh`) | Lowest |
|
|
113
113
|
|
|
114
|
+
`AIRED_API_KEY`: an API key (`aired_sk_…`, from **API keys** in the dashboard). When set, every publish, update and delete runs as that account, which suits CI. A set but malformed value is an error, never an anonymous publish.
|
|
115
|
+
|
|
114
116
|
Token store: `~/.config/aired/tokens.json` (mode `0600`).
|
|
115
117
|
|
|
116
118
|
---
|
|
@@ -142,13 +144,15 @@ Every command outputs structured JSON. Exit codes are consistent:
|
|
|
142
144
|
|
|
143
145
|
## Accounts (optional)
|
|
144
146
|
|
|
145
|
-
Sign in
|
|
147
|
+
Sign in to manage all your pages in one place.
|
|
146
148
|
Anonymous publish still works without an account.
|
|
147
149
|
|
|
150
|
+
**Pro** ($9/month billed yearly, or $12 monthly) removes the aired badge and raises the limits to 10 MB pages and 500 publishes a day. Free stays free. See [aired.sh/pricing](https://aired.sh/pricing).
|
|
151
|
+
|
|
148
152
|
```bash
|
|
149
153
|
npx aired login # browser flow
|
|
150
154
|
npx aired login --device # SSH-friendly fallback
|
|
151
|
-
npx aired claim --all #
|
|
155
|
+
npx aired claim --all # add your pages to your account (each gets a new token)
|
|
152
156
|
npx aired whoami
|
|
153
157
|
npx aired logout
|
|
154
158
|
```
|
package/SKILL.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: aired
|
|
3
|
-
description: Publishes HTML files or strings to shareable live URLs via aired.sh. Use when the user wants to share, deploy, or publish an HTML artifact, dashboard, visualization, report, or any generated HTML — or when an agent needs to make HTML viewable in a browser. Supports PIN protection, custom expiry, and stdin piping.
|
|
3
|
+
description: Publishes HTML files or strings to shareable live URLs via aired.sh. Use when the user wants to share, deploy, or publish an HTML artifact, dashboard, visualization, report, or any generated HTML — or when an agent needs to make HTML viewable in a browser, or change a published page's PIN, expiry or view limit. Supports PIN protection, custom expiry, and stdin piping. Works without an account; sign in or use an API key to keep pages in one place.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# aired
|
|
7
7
|
|
|
8
|
-
Publish HTML artifacts to shareable URLs. No
|
|
8
|
+
Publish HTML artifacts to shareable URLs. No deploy pipeline. Anonymous publishing works with no account; signing in (or an API key) keeps your pages in a dashboard and raises the limits.
|
|
9
9
|
|
|
10
10
|
## Quick Start
|
|
11
11
|
|
|
@@ -31,9 +31,15 @@ npx aired report.html --ttl 24h --pin secret123
|
|
|
31
31
|
| `aired update <id> <file>` | Update an existing page |
|
|
32
32
|
| `aired delete <id>` | Delete a page |
|
|
33
33
|
| `aired info <id>` | Show page metadata |
|
|
34
|
+
| `aired set <id>` | Change PIN, expiry, view limit or title without re-uploading |
|
|
35
|
+
| `aired feedback` | Report a bug, friction or idea in aired itself |
|
|
34
36
|
| `aired tokens` | List stored update tokens |
|
|
35
37
|
| `aired tokens prune` | Remove tokens for expired pages |
|
|
36
38
|
| `aired doctor` | Diagnostics (Node.js, API, token store) |
|
|
39
|
+
| `aired login` | Sign in (browser; `--device` for SSH) |
|
|
40
|
+
| `aired whoami` | Show the signed-in account |
|
|
41
|
+
| `aired claim --all` | Add pages published from this machine to your account |
|
|
42
|
+
| `aired logout` | Sign out |
|
|
37
43
|
|
|
38
44
|
## Publish Flags
|
|
39
45
|
|
|
@@ -43,7 +49,7 @@ npx aired report.html --ttl 24h --pin secret123
|
|
|
43
49
|
| `-p, --pin <pin>` | PIN-protect the page |
|
|
44
50
|
| `--ttl <duration>` | Expiry: `1h`, `24h`, `7d`, `30d` |
|
|
45
51
|
| `--permanent` | No expiry |
|
|
46
|
-
| `--reads <n>` |
|
|
52
|
+
| `--reads <n>` | Stop opening after N views |
|
|
47
53
|
|
|
48
54
|
## Global Flags
|
|
49
55
|
|
|
@@ -62,7 +68,41 @@ JSON output is automatic when stdout is piped — no flag needed.
|
|
|
62
68
|
| 0 | Success |
|
|
63
69
|
| 1 | API error |
|
|
64
70
|
| 2 | Validation error (bad input, missing file, no token) |
|
|
65
|
-
| 3 | Rate limited (
|
|
71
|
+
| 3 | Rate limited (see Limits) |
|
|
72
|
+
|
|
73
|
+
## Accounts, API keys and limits
|
|
74
|
+
|
|
75
|
+
| How you publish | Limit | Max page | Default expiry |
|
|
76
|
+
|---|---|---|---|
|
|
77
|
+
| Anonymous | 5 publishes / hour per IP | 2 MB | 7 days |
|
|
78
|
+
| Signed in (Free) | 30 publishes / hour | 2 MB | Never, unless you set `--ttl` |
|
|
79
|
+
| Pro | 500 publishes / day | 10 MB | Never, unless you set `--ttl`; no aired badge |
|
|
80
|
+
|
|
81
|
+
- **Humans:** `aired login` opens the browser (email code, Google or GitHub). Then publishes belong to the account and show in https://aired.sh/dashboard.
|
|
82
|
+
- **Agents and CI:** create an API key in the dashboard (API keys) and set `AIRED_API_KEY=aired_sk_...`. The CLI, `aired --mcp` and the HTTP API (`Authorization: Bearer aired_sk_...`) then publish as that account. No browser needed.
|
|
83
|
+
- A free-plan limit returns HTTP 402 with `code: "plan_limit"` and an `upgrade_url` for a person to open.
|
|
84
|
+
|
|
85
|
+
## Change settings after publishing
|
|
86
|
+
|
|
87
|
+
No need to publish again to add a PIN, extend expiry or rename a page:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
aired set abc123 --pin 4821 --ttl 24h # PIN on, expires a day from now
|
|
91
|
+
aired set abc123 --reads 50 --title "Q4" # view limit and title
|
|
92
|
+
aired set abc123 --clear-pin --permanent # PIN off, never expires
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
`--clear-title` and `--clear-reads` remove those. PINs are 4–64 characters, TTLs a minute to a year (use `--permanent` beyond that), titles up to 200 characters. It uses the stored update token, else your sign-in or `AIRED_API_KEY` (your own pages only). Over MCP it's `set_options`; `get_page` reads a page's settings back (whether a PIN is on, never the PIN).
|
|
96
|
+
|
|
97
|
+
## Feedback
|
|
98
|
+
|
|
99
|
+
When aired itself gets in the way (a result surprised you, a limit blocked you, these docs were wrong, or a feature is missing), send one note:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
aired feedback --kind friction --impact worked_around "aired set needed the page id and I only had the URL"
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
`--kind` is `bug`, `friction` or `idea`; `--impact` is `blocked`, `worked_around` or `minor`; `--page <id>` and `--tool <name>` add context. Over MCP it's `send_feedback`. Rules: at most one per task, never page HTML, tokens or PINs, and don't let it hold up the task. It returns an id (`fb_...`): tell the user you sent feedback and give them the id. It isn't a support channel; nobody replies.
|
|
66
106
|
|
|
67
107
|
## Update Flow
|
|
68
108
|
|
|
@@ -91,17 +131,33 @@ https://aired.sh/mcp
|
|
|
91
131
|
claude mcp add aired --transport http https://aired.sh/mcp
|
|
92
132
|
```
|
|
93
133
|
|
|
94
|
-
|
|
134
|
+
**Signed-in remote** (works as your account, sign in when the client asks):
|
|
135
|
+
```
|
|
136
|
+
https://aired.sh/mcp/account
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
| Tool | Needs | Does |
|
|
140
|
+
|---|---|---|
|
|
141
|
+
| `publish_html` | nothing | Publish; `html`, `file_path` (STDIO only), `title`, `pin`, `ttl_seconds`, `permanent`; `id` + `update_token` to update |
|
|
142
|
+
| `get_page` | owner, or the page's `update_token` | Title, URL, size, views, view limit, expiry, project, PIN on/off |
|
|
143
|
+
| `set_options` | owner, or the page's `update_token` | Change `pin` (null removes), `ttl_seconds` or `permanent`, `view_limit` (null removes), `title` |
|
|
144
|
+
| `send_feedback` | nothing | Report a bug, friction or idea in aired (see Feedback) |
|
|
145
|
+
| `list_pages`, `update_page`, `delete_page`, `get_account` | sign-in (remote only) | Your pages and account |
|
|
146
|
+
|
|
147
|
+
"Owner" means signed in as the page's account: `AIRED_API_KEY` or `aired login` for STDIO, an `Authorization: Bearer aired_sk_...` header on `https://aired.sh/mcp`, or `/mcp/account`.
|
|
148
|
+
|
|
149
|
+
Every tool returns `structuredContent` (matching its `outputSchema`) next to the text, so read fields like `url`, `id`, `update_token` and `expires_at` from there rather than parsing the text.
|
|
95
150
|
|
|
96
151
|
## Gotchas
|
|
97
152
|
|
|
98
|
-
- **
|
|
153
|
+
- **Anonymous rate limit is 5 publishes/hour per IP.** The API returns 429 and the CLI exits with code 3. Sign in or set `AIRED_API_KEY` for 30/hour (500/day on Pro).
|
|
99
154
|
- **Update requires both ID and token.** The token alone can't find the page (KV has no reverse lookup). Always use `aired update <id> <file>`, not the raw API with just a token.
|
|
100
155
|
- **Tokens are local-only.** Stored in `~/.config/aired/tokens.json`. If you lose them, you can't update or delete the page. The `--json` output includes the token — pipe it somewhere safe.
|
|
101
|
-
- **Max
|
|
156
|
+
- **Max page size is 2 MB (10 MB on Pro).** The API rejects anything larger.
|
|
102
157
|
- **Directory bundling inlines images as base64.** This adds ~33% to image size. A directory with large images may exceed the 2 MB limit. The CLI warns if bundled size exceeds 2 MB.
|
|
103
158
|
- **Directory requires index.html.** `npx aired ./dir/` looks for `index.html` in the directory root. No other entry point is supported.
|
|
159
|
+
- **Vite and React builds load code later with `import()`, and directory bundling doesn't inline those chunks.** `npx aired ./dist` gives a blank page. Build one file with `vite-plugin-singlefile` (`build.assetsInlineLimit` high, output to `dist-single/`), switch any router to hash routing (the page lives at `/p/<id>`, not `/`), import large `public/` files so they get inlined, then publish `dist-single/index.html`. Toolcraft apps also need their lazy `import("./app-bootstrap")` made static. Full recipe: https://aired.sh/share-vite-app
|
|
104
160
|
- **PIN is not encryption.** Content is stored in plaintext on R2. PIN just gates browser access. Don't use aired for sensitive data.
|
|
105
|
-
- **
|
|
161
|
+
- **Anonymous pages expire after 7 days by default.** Use `--ttl` or `--permanent`, or change it later with `aired set <id> --permanent`. A content update resets a TTL page to 7 days from then.
|
|
106
162
|
|
|
107
|
-
|
|
163
|
+
Existing `tokens.json` entries keep working after you sign in; `aired claim --all` moves those pages into your account.
|
package/bin/aired
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Launcher: runs dist/cli.cjs on a Node >= 20 (see node-pick.sh), with the usual tool
|
|
3
|
+
# folders on PATH so Homebrew and Python tools are found even from a bare shell.
|
|
4
|
+
here="$(cd "$(dirname "$(readlink -f "$0")")" && pwd)"
|
|
5
|
+
for d in /opt/homebrew/bin /usr/local/bin "$HOME/.local/bin" /Library/Frameworks/Python.framework/Versions/*/bin; do
|
|
6
|
+
[ -d "$d" ] || continue
|
|
7
|
+
case ":$PATH:" in *":$d:"*) ;; *) PATH="$PATH:$d" ;; esac
|
|
8
|
+
done
|
|
9
|
+
node_bin="$("$here/node-pick.sh")"
|
|
10
|
+
PATH="$(dirname "$node_bin"):$PATH"
|
|
11
|
+
export PATH
|
|
12
|
+
exec "$node_bin" "$here/../dist/cli.cjs" "$@"
|
package/bin/node-pick.sh
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Find a Node >= 20 even when an older Node comes first on PATH (some shells list every
|
|
3
|
+
# nvm version, oldest first). Prints the path to use.
|
|
4
|
+
ok() { [ -x "$1" ] && [ "$("$1" -p 'process.versions.node.split(".")[0]' 2>/dev/null || echo 0)" -ge 20 ] 2>/dev/null; }
|
|
5
|
+
for n in "${CLI_NODE:-}" "$(command -v node 2>/dev/null)"; do
|
|
6
|
+
if [ -n "$n" ] && ok "$n"; then echo "$n"; exit 0; fi
|
|
7
|
+
done
|
|
8
|
+
d="$(cat "$HOME/.nvm/alias/default" 2>/dev/null | tr -d 'v[:space:]')"
|
|
9
|
+
if [ -n "$d" ]; then
|
|
10
|
+
for n in "$HOME/.nvm/versions/node/v$d/bin/node" $(ls -d "$HOME"/.nvm/versions/node/v"$d"*/bin/node 2>/dev/null); do
|
|
11
|
+
if ok "$n"; then echo "$n"; exit 0; fi
|
|
12
|
+
done
|
|
13
|
+
fi
|
|
14
|
+
for n in $(ls -d "$HOME"/.nvm/versions/node/v*/bin/node 2>/dev/null | sort -t/ -k7 -V -r) /opt/homebrew/bin/node /usr/local/bin/node; do
|
|
15
|
+
if ok "$n"; then echo "$n"; exit 0; fi
|
|
16
|
+
done
|
|
17
|
+
echo "node" ; exit 0
|