aired 1.1.1 → 1.3.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 +31 -9
- package/bin/aired +12 -0
- package/bin/node-pick.sh +17 -0
- package/dist/cli.cjs +94 -89
- package/dist/mcp.cjs +96 -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. 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
|
|
|
@@ -34,6 +34,10 @@ npx aired report.html --ttl 24h --pin secret123
|
|
|
34
34
|
| `aired tokens` | List stored update tokens |
|
|
35
35
|
| `aired tokens prune` | Remove tokens for expired pages |
|
|
36
36
|
| `aired doctor` | Diagnostics (Node.js, API, token store) |
|
|
37
|
+
| `aired login` | Sign in (browser; `--device` for SSH) |
|
|
38
|
+
| `aired whoami` | Show the signed-in account |
|
|
39
|
+
| `aired claim --all` | Add pages published from this machine to your account |
|
|
40
|
+
| `aired logout` | Sign out |
|
|
37
41
|
|
|
38
42
|
## Publish Flags
|
|
39
43
|
|
|
@@ -43,7 +47,7 @@ npx aired report.html --ttl 24h --pin secret123
|
|
|
43
47
|
| `-p, --pin <pin>` | PIN-protect the page |
|
|
44
48
|
| `--ttl <duration>` | Expiry: `1h`, `24h`, `7d`, `30d` |
|
|
45
49
|
| `--permanent` | No expiry |
|
|
46
|
-
| `--reads <n>` |
|
|
50
|
+
| `--reads <n>` | Stop opening after N views |
|
|
47
51
|
|
|
48
52
|
## Global Flags
|
|
49
53
|
|
|
@@ -62,7 +66,19 @@ JSON output is automatic when stdout is piped — no flag needed.
|
|
|
62
66
|
| 0 | Success |
|
|
63
67
|
| 1 | API error |
|
|
64
68
|
| 2 | Validation error (bad input, missing file, no token) |
|
|
65
|
-
| 3 | Rate limited (
|
|
69
|
+
| 3 | Rate limited (see Limits) |
|
|
70
|
+
|
|
71
|
+
## Accounts, API keys and limits
|
|
72
|
+
|
|
73
|
+
| How you publish | Limit | Max page | Default expiry |
|
|
74
|
+
|---|---|---|---|
|
|
75
|
+
| Anonymous | 5 publishes / hour per IP | 2 MB | 7 days |
|
|
76
|
+
| Signed in (Free) | 30 publishes / hour | 2 MB | Never, unless you set `--ttl` |
|
|
77
|
+
| Pro | 500 publishes / day | 10 MB | Never, unless you set `--ttl`; no aired badge |
|
|
78
|
+
|
|
79
|
+
- **Humans:** `aired login` opens the browser (email code, Google or GitHub). Then publishes belong to the account and show in https://aired.sh/dashboard.
|
|
80
|
+
- **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.
|
|
81
|
+
- A free-plan limit returns HTTP 402 with `code: "plan_limit"` and an `upgrade_url` for a person to open.
|
|
66
82
|
|
|
67
83
|
## Update Flow
|
|
68
84
|
|
|
@@ -91,17 +107,23 @@ https://aired.sh/mcp
|
|
|
91
107
|
claude mcp add aired --transport http https://aired.sh/mcp
|
|
92
108
|
```
|
|
93
109
|
|
|
94
|
-
|
|
110
|
+
**Signed-in remote** (works as your account, sign in when the client asks):
|
|
111
|
+
```
|
|
112
|
+
https://aired.sh/mcp/account
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
`publish_html` accepts `html` (string), `file_path` (STDIO only), `title`, `pin`, `ttl_seconds`, `permanent`, `update_token`, and `id`. With an API key (`AIRED_API_KEY` for STDIO, or an `Authorization: Bearer` header on `https://aired.sh/mcp`) or on `/mcp/account`, four more tools work: `list_pages`, `update_page` (by id, no token), `delete_page` and `get_account`.
|
|
95
116
|
|
|
96
117
|
## Gotchas
|
|
97
118
|
|
|
98
|
-
- **
|
|
119
|
+
- **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
120
|
- **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
121
|
- **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
|
|
122
|
+
- **Max page size is 2 MB (10 MB on Pro).** The API rejects anything larger.
|
|
102
123
|
- **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
124
|
- **Directory requires index.html.** `npx aired ./dir/` looks for `index.html` in the directory root. No other entry point is supported.
|
|
125
|
+
- **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
126
|
- **PIN is not encryption.** Content is stored in plaintext on R2. PIN just gates browser access. Don't use aired for sensitive data.
|
|
105
|
-
- **
|
|
127
|
+
- **Anonymous pages expire after 7 days by default.** Use `--ttl` or `--permanent`. The TTL resets on update.
|
|
106
128
|
|
|
107
|
-
|
|
129
|
+
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
|