aired 0.1.0 → 1.0.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.
Files changed (3) hide show
  1. package/SKILL.md +57 -128
  2. package/dist/cli.cjs +120 -67
  3. package/package.json +9 -7
package/SKILL.md CHANGED
@@ -1,127 +1,59 @@
1
- # aired — CLI for publishing HTML artifacts
1
+ ---
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. No auth required.
4
+ ---
2
5
 
3
- Publish HTML files to shareable URLs. Works with any AI tool (Claude Code, Cursor, ChatGPT).
6
+ # aired
4
7
 
5
- ## Setup
8
+ Publish HTML artifacts to shareable URLs. No signup, no auth, no deploy pipeline.
6
9
 
7
- No auth required. Anonymous by default.
10
+ ## Quick Start
8
11
 
9
12
  ```bash
10
- # Install globally
11
- npm install -g aired
13
+ # Publish a file → get a live URL
14
+ npx aired dashboard.html
12
15
 
13
- # Or use directly
14
- npx aired file.html
15
- ```
16
-
17
- Optional: set `AIRED_API_URL` env var for custom API endpoint.
18
-
19
- ## Commands
20
-
21
- ### publish (default)
22
-
23
- Publish an HTML file to a shareable URL.
24
-
25
- ```bash
26
- aired file.html
27
- aired file.html --json
28
- cat file.html | aired
29
- aired file.html --ttl 24h --pin secret123
30
- aired file.html --permanent
31
- ```
32
-
33
- **Flags:** `--title`, `--pin`, `--ttl <1h|24h|7d|30d>`, `--permanent`, `--reads <n>`
34
-
35
- **JSON output:**
36
- ```json
37
- {
38
- "id": "abc123",
39
- "url": "https://aired.sh/p/abc123",
40
- "update_token": "at_...",
41
- "expiresAt": "2026-04-04T12:00:00.000Z"
42
- }
43
- ```
44
-
45
- ### update
46
-
47
- Update an existing page.
48
-
49
- ```bash
50
- aired update <id> new-file.html
51
- aired update <id> new-file.html --json
52
- ```
53
-
54
- ### delete
55
-
56
- Delete a page.
57
-
58
- ```bash
59
- aired delete <id>
60
- aired delete <id> --json
61
- ```
62
-
63
- ### info
64
-
65
- Show page metadata.
16
+ # Publish a directory (bundles index.html + CSS + JS + images into one file)
17
+ npx aired ./my-project/
66
18
 
67
- ```bash
68
- aired info <id>
69
- aired info <id> --json
70
- ```
71
-
72
- **JSON output:**
73
- ```json
74
- {
75
- "id": "abc123",
76
- "title": "My Dashboard",
77
- "size": 4096,
78
- "readCount": 5,
79
- "expiresAt": "2026-04-04T12:00:00.000Z"
80
- }
81
- ```
82
-
83
- ### tokens
84
-
85
- List stored tokens.
19
+ # Pipe HTML from another command
20
+ echo "<h1>Hello</h1>" | npx aired --json | jq .url
86
21
 
87
- ```bash
88
- aired tokens
89
- aired tokens --json
90
- aired tokens prune
22
+ # PIN-protected, expires in 24h
23
+ npx aired report.html --ttl 24h --pin secret123
91
24
  ```
92
25
 
93
- ### doctor
26
+ ## Commands
94
27
 
95
- Run diagnostic checks.
28
+ | Command | Description |
29
+ |---------|-------------|
30
+ | `aired [file]` | Publish HTML file, directory, or stdin (default command) |
31
+ | `aired update <id> <file>` | Update an existing page |
32
+ | `aired delete <id>` | Delete a page |
33
+ | `aired info <id>` | Show page metadata |
34
+ | `aired tokens` | List stored update tokens |
35
+ | `aired tokens prune` | Remove tokens for expired pages |
36
+ | `aired doctor` | Diagnostics (Node.js, API, token store) |
96
37
 
97
- ```bash
98
- aired doctor
99
- aired doctor --json
100
- ```
38
+ ## Publish Flags
101
39
 
102
- **JSON output:**
103
- ```json
104
- {
105
- "ok": true,
106
- "checks": [
107
- { "name": "CLI Version", "status": "pass", "message": "v0.1.0" },
108
- { "name": "Node.js", "status": "pass", "message": "v22.19.0" },
109
- { "name": "Token Store", "status": "pass", "message": "2 tokens at ~/.config/aired/tokens.json" },
110
- { "name": "API", "status": "pass", "message": "https://aired.sh" }
111
- ]
112
- }
113
- ```
40
+ | Flag | Effect |
41
+ |------|--------|
42
+ | `-t, --title <title>` | Custom page title |
43
+ | `-p, --pin <pin>` | PIN-protect the page |
44
+ | `--ttl <duration>` | Expiry: `1h`, `24h`, `7d`, `30d` |
45
+ | `--permanent` | No expiry |
46
+ | `--reads <n>` | Auto-delete after N views |
114
47
 
115
48
  ## Global Flags
116
49
 
117
50
  | Flag | Effect |
118
51
  |------|--------|
119
- | `--json` | Force JSON output |
52
+ | `--json` | Structured JSON to stdout |
120
53
  | `--quiet` | Suppress stderr, implies --json |
121
- | `--verbose` | Extended output |
122
54
  | `--api-url <url>` | Custom API endpoint |
123
55
 
124
- When stdout is piped, JSON is automatic.
56
+ JSON output is automatic when stdout is piped — no flag needed.
125
57
 
126
58
  ## Exit Codes
127
59
 
@@ -129,44 +61,41 @@ When stdout is piped, JSON is automatic.
129
61
  |------|---------|
130
62
  | 0 | Success |
131
63
  | 1 | API error |
132
- | 2 | Validation error |
133
- | 3 | Rate limited |
64
+ | 2 | Validation error (bad input, missing file, no token) |
65
+ | 3 | Rate limited (5 uploads/hour) |
134
66
 
135
- ## MCP Server
67
+ ## Update Flow
136
68
 
137
- Spawn the MCP stdio server:
69
+ The first publish returns an `update_token` (saved to `~/.config/aired/tokens.json`). To update the same URL:
138
70
 
139
71
  ```bash
140
- aired --mcp
72
+ aired dashboard.html # → publishes, saves token
73
+ aired update abc123 v2.html # → updates same URL using stored token
141
74
  ```
142
75
 
143
- This starts the `@aired/mcp` package as a stdio MCP server with a `publish_html` tool.
76
+ Tokens are stored per page ID. `aired tokens` lists them. `aired tokens prune` removes expired ones.
144
77
 
145
- ## Common Workflows
78
+ ## MCP Server
146
79
 
147
- ### Publish and share
148
80
  ```bash
149
- aired dashboard.html
150
- # → https://aired.sh/p/abc123
81
+ aired --mcp
151
82
  ```
152
83
 
153
- ### Update same URL
154
- ```bash
155
- aired dashboard.html # first publish
156
- aired update abc123 v2.html # update same URL
157
- ```
84
+ Starts a stdio MCP server with a `publish_html` tool. Configure in Claude Code:
158
85
 
159
- ### Temporary with PIN
160
86
  ```bash
161
- aired report.html --ttl 24h --pin secret
87
+ claude mcp add aired -- npx aired --mcp
162
88
  ```
163
89
 
164
- ### Pipe from stdin
165
- ```bash
166
- echo "<h1>Hello</h1>" | aired --json | jq .url
167
- ```
90
+ The MCP tool accepts `html` (string), `file_path`, `title`, `pin`, `ttl_seconds`, `permanent`, `update_token`, and `id`.
168
91
 
169
- ### Clean up expired tokens
170
- ```bash
171
- aired tokens prune
172
- ```
92
+ ## Gotchas
93
+
94
+ - **Rate limit is 5 uploads/hour per IP.** The API returns 429 and the CLI exits with code 3. Wait an hour or use a different network.
95
+ - **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.
96
+ - **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.
97
+ - **Max file size is 2 MB.** The API rejects anything larger. For bigger artifacts, host them elsewhere.
98
+ - **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.
99
+ - **Directory requires index.html.** `npx aired ./dir/` looks for `index.html` in the directory root. No other entry point is supported.
100
+ - **PIN is not encryption.** Content is stored in plaintext on R2. PIN just gates browser access. Don't use aired for sensitive data.
101
+ - **Default expiry is 7 days.** Pages auto-delete unless `--permanent` is set. The TTL resets on update.