@nearform/fling 0.2.0 → 0.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/CHANGELOG.md +49 -0
- package/LICENSE +1 -1
- package/README.md +73 -26
- package/dist/cli.js +1271 -452
- package/dist/cli.js.map +4 -4
- package/package.json +4 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.4.0
|
|
6
|
+
|
|
7
|
+
- **Several Flings.** The CLI remembers every Fling you sign in to, each with its own API key, and
|
|
8
|
+
uses the current one. `fling login <url>` and `fling setup <url>` add a Fling (or refresh its
|
|
9
|
+
login) and make it current without signing you out of the others. `fling use` lists them, with
|
|
10
|
+
each one's name and your email; `fling use <url>` switches (a full address, its host or the start
|
|
11
|
+
of it). `fling logout <url>` signs out of another Fling and forgets it; a bare `fling logout`
|
|
12
|
+
still removes the current Fling's key and keeps the Fling. `fling whoami` shows which Fling is
|
|
13
|
+
current.
|
|
14
|
+
- `--server` and `FLING_URL` pick a remembered Fling for one command and use its stored key (an
|
|
15
|
+
address you haven't signed in to has no key; `FLING_API_KEY` still overrides). The local MCP
|
|
16
|
+
server uses the current Fling unless `FLING_URL` (the Claude Desktop extension's **Fling server**)
|
|
17
|
+
names one, and signing in from it makes that Fling current only when no other is.
|
|
18
|
+
- Upgrading: `~/.fling/config.json` from 0.3 is read as-is, as one remembered Fling that is
|
|
19
|
+
current. It is rewritten in the new shape (`current` plus `servers`, keyed by address) the next
|
|
20
|
+
time the CLI saves it, so an older CLI can no longer read it after that.
|
|
21
|
+
|
|
22
|
+
## 0.3.0
|
|
23
|
+
|
|
24
|
+
**Breaking: no default server.** The CLI works with any Fling deployment, so it no longer has one
|
|
25
|
+
built in.
|
|
26
|
+
|
|
27
|
+
- `fling login <url>` (or `fling setup <url>`) signs in to the Fling at that address. The CLI
|
|
28
|
+
reads the server's `/.well-known/fling` (its name, sites domain, sign-in method) and remembers
|
|
29
|
+
both in `~/.fling/config.json`; later commands, and `fling login` without a URL, use them.
|
|
30
|
+
`FLING_URL` and `--server` still override it.
|
|
31
|
+
- Upgrading from 0.2: if you logged in with 0.2, nothing changes; the server you logged in to is
|
|
32
|
+
kept, and its metadata is fetched the first time it is needed. A config without a server (a new
|
|
33
|
+
machine, or a key set by hand) fails with `No Fling server set — run fling login <url> …`
|
|
34
|
+
instead of assuming a server.
|
|
35
|
+
- Site URLs shown before a deploy come from the server's metadata instead of being guessed from
|
|
36
|
+
the server URL.
|
|
37
|
+
- The local MCP server (`fling mcp`, the Claude Desktop extension) names your Fling and its sites
|
|
38
|
+
domain in its tool descriptions. The extension's **Fling server** setting has no built-in
|
|
39
|
+
default; the copy a Fling serves at `/downloads/fling.mcpb` has its address filled in.
|
|
40
|
+
- Comments: `fling comments`, `fling comment` (and `--reply`), `fling resolve`, `fling uncomment`;
|
|
41
|
+
the local MCP server gains `fling_comments_list`, `fling_comment_add`, `fling_comment_resolve`
|
|
42
|
+
and `fling_comment_delete` on an instance with the `comments` capability.
|
|
43
|
+
- On an instance with comments, a deploy (`fling deploy`, and the MCP server's `fling_deploy` and
|
|
44
|
+
`fling_publish`) also gives the review page, the link to share for feedback: in the output box,
|
|
45
|
+
as `reviewUrl` in `--json` and in the MCP result, where it leads.
|
|
46
|
+
|
|
47
|
+
## 0.2.0
|
|
48
|
+
|
|
49
|
+
`fling setup`, a new look, and help by default.
|
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
# @nearform/fling
|
|
2
2
|
|
|
3
|
-
Fling a folder of static files at
|
|
4
|
-
get a stable link back:
|
|
3
|
+
Fling a folder of static files at your Fling server and get a stable link back:
|
|
5
4
|
|
|
6
5
|
```
|
|
7
|
-
https://<name
|
|
6
|
+
https://<name>.<your sites domain>
|
|
8
7
|
```
|
|
9
8
|
|
|
10
|
-
Site names are one global namespace, first come first served. Sites are private to
|
|
11
|
-
who has the
|
|
9
|
+
Site names are one global namespace per server, first come first served. Sites are private to
|
|
10
|
+
people signed in to that Fling by default. Share links make them viewable by anyone who has the
|
|
11
|
+
link.
|
|
12
|
+
|
|
13
|
+
> **Upgrading from 0.2?** The CLI no longer has a built-in server. If you were logged in with 0.2
|
|
14
|
+
> it carries on with the server you logged in to. Otherwise (or on a new machine) run
|
|
15
|
+
> `fling login <url>` once with your Fling's address. See [CHANGELOG.md](CHANGELOG.md).
|
|
12
16
|
|
|
13
17
|
## Install
|
|
14
18
|
|
|
@@ -23,13 +27,15 @@ npx @nearform/fling …
|
|
|
23
27
|
## Set up
|
|
24
28
|
|
|
25
29
|
```sh
|
|
26
|
-
fling setup
|
|
30
|
+
fling setup https://fling.example.com # your Fling's address; later runs can leave it out
|
|
27
31
|
```
|
|
28
32
|
|
|
29
33
|
This does everything a new machine needs:
|
|
30
34
|
|
|
31
|
-
1. **Signs you in.**
|
|
32
|
-
|
|
35
|
+
1. **Signs you in.** The CLI reads the server's `/.well-known/fling` (its name, where its sites
|
|
36
|
+
live, how people sign in) and remembers it. Your browser opens for sign-in and an API key is
|
|
37
|
+
stored in `~/.fling/config.json` (mode 0600). This is skipped if you're already signed in.
|
|
38
|
+
The server becomes your current one; logins to other Flings are kept.
|
|
33
39
|
2. **Adds Fling to Claude Code.** If `claude` is on your PATH, setup installs the Fling plugin
|
|
34
40
|
(skill + MCP server) from the `nearform/fling` marketplace, or updates it if it's already
|
|
35
41
|
installed. `--scope project|local` installs it for this project only (default `user`).
|
|
@@ -38,15 +44,34 @@ This does everything a new machine needs:
|
|
|
38
44
|
|
|
39
45
|
On a terminal it asks before steps 2 and 3. With `--yes` it does them without asking.
|
|
40
46
|
|
|
41
|
-
To sign in only, use `fling login
|
|
42
|
-
|
|
47
|
+
To sign in only, use `fling login <url>` (the URL is remembered: later `fling login` needs none).
|
|
48
|
+
There is no default server: until you log in, commands say to run `fling login <url>`.
|
|
49
|
+
`fling whoami` shows who you are and which server is current. For CI, set `FLING_URL` and
|
|
50
|
+
`FLING_API_KEY` instead.
|
|
51
|
+
|
|
52
|
+
### Several Flings
|
|
53
|
+
|
|
54
|
+
The CLI remembers every Fling you sign in to, each with its own key, and uses the current one.
|
|
55
|
+
`fling login <url>` or `fling setup <url>` adds a Fling (or signs in to it again) and makes it
|
|
56
|
+
current; the others stay signed in.
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
fling use # list them: * marks the current one, with its name and your email
|
|
60
|
+
fling use other.example.com # switch: a full address, its host, or the start of it
|
|
61
|
+
fling --server other.example.com ls # one command against another Fling, with its own key
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`FLING_URL` picks a Fling the same way for every command run with it, and `FLING_API_KEY`
|
|
65
|
+
overrides the stored key. `fling logout` removes the current Fling's key and keeps it current (a
|
|
66
|
+
bare `fling login` signs in again); `fling logout <url>` signs out of another Fling and forgets
|
|
67
|
+
it.
|
|
43
68
|
|
|
44
69
|
## Deploy
|
|
45
70
|
|
|
46
71
|
```sh
|
|
47
72
|
npm run build
|
|
48
73
|
fling deploy ./dist # name generated from the project, e.g. rocketpod-docs; you confirm it
|
|
49
|
-
fling deploy ./dist --name my-app # → https://my-app
|
|
74
|
+
fling deploy ./dist --name my-app # → https://my-app.<your sites domain>
|
|
50
75
|
fling deploy ./dist --name my-app --spa # client-side routing: unknown paths serve index.html
|
|
51
76
|
fling deploy ./dist --public # no sign-in needed to view
|
|
52
77
|
fling deploy ./dist --yes # never prompt (CI): use the generated name as is
|
|
@@ -126,7 +151,7 @@ Without `--name`, the name is generated from the folder, never from your user na
|
|
|
126
151
|
In a terminal, Fling checks the generated name and asks before deploying:
|
|
127
152
|
|
|
128
153
|
```
|
|
129
|
-
fling Site name: rocketpod-docs → https://rocketpod-docs.
|
|
154
|
+
fling Site name: rocketpod-docs → https://rocketpod-docs.sites.example.com/ (new)
|
|
130
155
|
Use "rocketpod-docs"? [Y/n or type another name]
|
|
131
156
|
```
|
|
132
157
|
|
|
@@ -162,8 +187,24 @@ and a taken name fails (exit 1) with suggestions rather than picking another nam
|
|
|
162
187
|
| `fling archive <name>` / `fling unarchive <name>` | take offline and keep the files, or bring back |
|
|
163
188
|
| `fling rm <name> [--yes]` | delete permanently |
|
|
164
189
|
|
|
165
|
-
|
|
166
|
-
|
|
190
|
+
## Comments
|
|
191
|
+
|
|
192
|
+
People review a site on its review page (`<your Fling>/review/<name>`, the **Review** button on the
|
|
193
|
+
sites page): the site beside its comments. Anyone signed in who can open the site can comment; the
|
|
194
|
+
CLI reads and writes the same threads. On a Fling with comments, `fling deploy` (and the MCP
|
|
195
|
+
server's `fling_deploy` / `fling_publish`) also prints the review page as the link to share for
|
|
196
|
+
feedback (`reviewUrl` in `--json`); reviewers sign in to use it.
|
|
197
|
+
|
|
198
|
+
| Command | |
|
|
199
|
+
|---|---|
|
|
200
|
+
| `fling comments <name> [--path <page>] [--all]` | open threads (with replies) by page; `--all` adds resolved ones |
|
|
201
|
+
| `fling comment <name> "text" [--path <page>]` | comment on a page (default `/`) |
|
|
202
|
+
| `fling comment <name> "text" --reply <id>` | reply to a thread |
|
|
203
|
+
| `fling resolve <name> <id> [--reopen]` | resolve a thread, or reopen it |
|
|
204
|
+
| `fling uncomment <name> <id> [--yes]` | delete a comment (a thread with its replies): your own, or any on your site |
|
|
205
|
+
|
|
206
|
+
Global options: `--json` prints machine-readable output, and `--server <url>` points one command at
|
|
207
|
+
another server (a remembered one brings its key; see [Several Flings](#several-flings)). Exit codes are `0` ok, `1` error, `2` not logged in and `3` forbidden.
|
|
167
208
|
|
|
168
209
|
Environment: `FLING_API_KEY`, `FLING_URL`, `FLING_CONFIG_DIR`, `FLING_DEBUG`, `FLING_DOWNLOADS_DIR`
|
|
169
210
|
(where the MCP server looks for files given by name first), `FLING_NO_WAIT=1` (after a deploy or a new share
|
|
@@ -185,7 +226,10 @@ Or install it by hand in Claude Code:
|
|
|
185
226
|
/plugin install fling@fling
|
|
186
227
|
```
|
|
187
228
|
|
|
188
|
-
Log in once with `fling login
|
|
229
|
+
Log in once with `fling login <url>` (or `npx @nearform/fling login <url>` if it is not installed).
|
|
230
|
+
The MCP server reuses that login, and its tool descriptions name your Fling and where its sites
|
|
231
|
+
live. It re-reads the config on every call, so after `fling use <url>` it talks to the new current
|
|
232
|
+
Fling without a restart.
|
|
189
233
|
|
|
190
234
|
The MCP tools:
|
|
191
235
|
|
|
@@ -215,20 +259,23 @@ For Claude Desktop (including Cowork), install the one-click extension. It runs
|
|
|
215
259
|
on your computer, so Claude can fling files you downloaded or that Claude Desktop saved, by name,
|
|
216
260
|
without uploading anything from Claude's sandbox.
|
|
217
261
|
|
|
218
|
-
1. Download
|
|
262
|
+
1. Download `fling.mcpb` from your Fling (Get started → Download, or `https://<your Fling>/downloads/fling.mcpb`).
|
|
219
263
|
2. Double-click it, or drag it into Claude Desktop, or go to **Settings → Extensions → Advanced
|
|
220
264
|
settings → Install Extension…** and pick the file.
|
|
221
|
-
3. Optional settings: **Fling server** (
|
|
222
|
-
folder** (default `~/Downloads`).
|
|
265
|
+
3. Optional settings: **Fling server** (filled in with the Fling you downloaded it from; empty means
|
|
266
|
+
the one the CLI is logged in to) and **Downloads folder** (default `~/Downloads`).
|
|
223
267
|
4. Ask Claude to "fling Pitch Deck.html from my Downloads". If you're not signed in, Claude calls
|
|
224
|
-
`fling_login` and your browser opens. The extension and the CLI share the
|
|
225
|
-
`~/.fling/config.json`.
|
|
268
|
+
`fling_login` and your browser opens. The extension and the CLI share the logins in
|
|
269
|
+
`~/.fling/config.json`. With **Fling server** set, the extension always uses that Fling (and its
|
|
270
|
+
stored key), whichever one the CLI is using; signing in from the extension doesn't change the
|
|
271
|
+
CLI's current Fling.
|
|
226
272
|
|
|
227
273
|
It needs Node.js 20 or later, which Claude Desktop provides, on macOS or Windows.
|
|
228
274
|
|
|
229
|
-
Build it with `pnpm --filter
|
|
230
|
-
dependency into one file, then validates and packs `mcpb/manifest.json` into `dist/fling.mcpb
|
|
231
|
-
|
|
275
|
+
Build it with `pnpm --filter ./apps/cli build:mcpb`. That bundles `src/mcp-entry.ts` and every
|
|
276
|
+
dependency into one file, then validates and packs `mcpb/manifest.json` into `dist/fling.mcpb`
|
|
277
|
+
(`FLING_MCPB_SERVER_URL` sets the **Fling server** default). A deploy publishes it at
|
|
278
|
+
`/downloads/fling.mcpb`.
|
|
232
279
|
|
|
233
280
|
To use the MCP server in another client, run it over stdio:
|
|
234
281
|
|
|
@@ -241,7 +288,7 @@ To use the MCP server in another client, run it over stdio:
|
|
|
241
288
|
From the repo root:
|
|
242
289
|
|
|
243
290
|
```sh
|
|
244
|
-
pnpm cli
|
|
245
|
-
pnpm --filter
|
|
246
|
-
pnpm --filter
|
|
291
|
+
pnpm cli login http://localhost:47101 # against `pnpm dev`
|
|
292
|
+
pnpm --filter ./apps/cli test
|
|
293
|
+
pnpm --filter ./apps/cli build # → dist/cli.js
|
|
247
294
|
```
|