@nearform/fling 0.3.0 → 0.5.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 +43 -0
- package/README.md +61 -15
- package/dist/cli.js +638 -199
- package/dist/cli.js.map +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 0.5.0
|
|
6
|
+
|
|
7
|
+
- **One MCP server for every Fling.** The local MCP server (`fling mcp` and the Claude Desktop
|
|
8
|
+
extension) knows every Fling the CLI remembers. Every tool that talks to a Fling takes an
|
|
9
|
+
optional `server` (an address, host or unique part of it), and calls use that Fling's own key.
|
|
10
|
+
An unknown or ambiguous `server` fails with the list of Flings.
|
|
11
|
+
- **The server is chosen explicitly when there are several.** With one Fling (or none) nothing
|
|
12
|
+
changes: calls go to it. With several, the instructions and tool descriptions list them by host
|
|
13
|
+
and mark the current one, and tell Claude to settle at the start of a conversation which Fling it
|
|
14
|
+
uses (from your words, or by asking you, suggesting your current one), say so, and pass it as
|
|
15
|
+
`server` on every call. A call without `server`, reads included, doesn't run: it answers with the
|
|
16
|
+
list so Claude can ask. `fling mcp --server` and `FLING_URL` still pin one. The CLI's commands
|
|
17
|
+
are unchanged and follow `fling use`.
|
|
18
|
+
- `fling_servers` lists the Flings on this computer (address, name, who is signed in, which is
|
|
19
|
+
current), read when called; `{use: <server>}` makes one current, as `fling use` does.
|
|
20
|
+
- `fling_login` takes `server` to sign in to another Fling, including a new one. It becomes the
|
|
21
|
+
current Fling only when none is.
|
|
22
|
+
- Deploy, publish and comment results end with the Fling they went to.
|
|
23
|
+
- **One extension.** The extension has the same identity whichever Fling serves it, so installing
|
|
24
|
+
it from another Fling updates it in place. The address a Fling bakes in (`FLING_MCPB_SERVER_URL`
|
|
25
|
+
at build time, `FLING_ADD_SERVER` in the extension) is added to the remembered Flings when the
|
|
26
|
+
server starts, if it isn't there yet; it never replaces a stored key and becomes current only
|
|
27
|
+
when none is. The extension's **Fling server** setting is gone.
|
|
28
|
+
- Upgrading: remove older Fling extensions from Claude Desktop (Settings → Extensions), then
|
|
29
|
+
install it once from any of your Flings. Earlier extensions were each tied to one Fling.
|
|
30
|
+
|
|
31
|
+
## 0.4.0
|
|
32
|
+
|
|
33
|
+
- **Several Flings.** The CLI remembers every Fling you sign in to, each with its own API key, and
|
|
34
|
+
uses the current one. `fling login <url>` and `fling setup <url>` add a Fling (or refresh its
|
|
35
|
+
login) and make it current without signing you out of the others. `fling use` lists them, with
|
|
36
|
+
each one's name and your email; `fling use <url>` switches (a full address, its host or the start
|
|
37
|
+
of it). `fling logout <url>` signs out of another Fling and forgets it; a bare `fling logout`
|
|
38
|
+
still removes the current Fling's key and keeps the Fling. `fling whoami` shows which Fling is
|
|
39
|
+
current.
|
|
40
|
+
- `--server` and `FLING_URL` pick a remembered Fling for one command and use its stored key (an
|
|
41
|
+
address you haven't signed in to has no key; `FLING_API_KEY` still overrides). The local MCP
|
|
42
|
+
server uses the current Fling unless `FLING_URL` (the Claude Desktop extension's **Fling server**)
|
|
43
|
+
names one, and signing in from it makes that Fling current only when no other is.
|
|
44
|
+
- Upgrading: `~/.fling/config.json` from 0.3 is read as-is, as one remembered Fling that is
|
|
45
|
+
current. It is rewritten in the new shape (`current` plus `servers`, keyed by address) the next
|
|
46
|
+
time the CLI saves it, so an older CLI can no longer read it after that.
|
|
47
|
+
|
|
5
48
|
## 0.3.0
|
|
6
49
|
|
|
7
50
|
**Breaking: no default server.** The CLI works with any Fling deployment, so it no longer has one
|
package/README.md
CHANGED
|
@@ -35,6 +35,7 @@ This does everything a new machine needs:
|
|
|
35
35
|
1. **Signs you in.** The CLI reads the server's `/.well-known/fling` (its name, where its sites
|
|
36
36
|
live, how people sign in) and remembers it. Your browser opens for sign-in and an API key is
|
|
37
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.
|
|
38
39
|
2. **Adds Fling to Claude Code.** If `claude` is on your PATH, setup installs the Fling plugin
|
|
39
40
|
(skill + MCP server) from the `nearform/fling` marketplace, or updates it if it's already
|
|
40
41
|
installed. `--scope project|local` installs it for this project only (default `user`).
|
|
@@ -45,8 +46,25 @@ On a terminal it asks before steps 2 and 3. With `--yes` it does them without as
|
|
|
45
46
|
|
|
46
47
|
To sign in only, use `fling login <url>` (the URL is remembered: later `fling login` needs none).
|
|
47
48
|
There is no default server: until you log in, commands say to run `fling login <url>`.
|
|
48
|
-
`fling whoami` shows who you are
|
|
49
|
-
|
|
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.
|
|
50
68
|
|
|
51
69
|
## Deploy
|
|
52
70
|
|
|
@@ -186,10 +204,11 @@ feedback (`reviewUrl` in `--json`); reviewers sign in to use it.
|
|
|
186
204
|
| `fling uncomment <name> <id> [--yes]` | delete a comment (a thread with its replies): your own, or any on your site |
|
|
187
205
|
|
|
188
206
|
Global options: `--json` prints machine-readable output, and `--server <url>` points one command at
|
|
189
|
-
another server. Exit codes are `0` ok, `1` error, `2` not logged in and `3` forbidden.
|
|
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.
|
|
190
208
|
|
|
191
209
|
Environment: `FLING_API_KEY`, `FLING_URL`, `FLING_CONFIG_DIR`, `FLING_DEBUG`, `FLING_DOWNLOADS_DIR`
|
|
192
|
-
(where the MCP server looks for files given by name first), `
|
|
210
|
+
(where the MCP server looks for files given by name first), `FLING_ADD_SERVER` (a Fling the MCP
|
|
211
|
+
server adds to the remembered ones when it starts), `FLING_NO_WAIT=1` (after a deploy or a new share
|
|
193
212
|
link, don't wait the few seconds it takes to reach every edge).
|
|
194
213
|
|
|
195
214
|
## Claude Code plugin and MCP
|
|
@@ -209,8 +228,23 @@ Or install it by hand in Claude Code:
|
|
|
209
228
|
```
|
|
210
229
|
|
|
211
230
|
Log in once with `fling login <url>` (or `npx @nearform/fling login <url>` if it is not installed).
|
|
212
|
-
The MCP server reuses
|
|
213
|
-
|
|
231
|
+
The MCP server reuses your logins. It re-reads the config on every call, so a `fling login` or
|
|
232
|
+
`fling use` in a terminal takes effect without a restart.
|
|
233
|
+
|
|
234
|
+
**Several Flings.** The MCP server knows every Fling the CLI remembers, and every tool that talks to
|
|
235
|
+
a Fling takes an optional `server`: its address, host or a unique part of it (as `fling use`
|
|
236
|
+
accepts).
|
|
237
|
+
|
|
238
|
+
- With one Fling (or none), calls go to it and `server` can be left out. The tool descriptions
|
|
239
|
+
name that Fling and where its sites live.
|
|
240
|
+
- With several, the server is chosen explicitly. The instructions and descriptions list the Flings
|
|
241
|
+
by host and mark the current one. Claude settles which Fling the conversation uses at the start,
|
|
242
|
+
from your words ("on the other one", "on fling.example.com") or by asking you, with your current
|
|
243
|
+
Fling as the suggestion. It says which one it is using and passes it as `server` on every call,
|
|
244
|
+
switching only when you ask. A call without `server` (reads included) does not run: it answers
|
|
245
|
+
with the list of Flings so Claude can ask.
|
|
246
|
+
- `fling mcp --server <url>` (or `FLING_URL`) pins the server: calls without `server` go there.
|
|
247
|
+
- The CLI itself is unchanged: `fling use` and the current Fling govern CLI commands.
|
|
214
248
|
|
|
215
249
|
The MCP tools:
|
|
216
250
|
|
|
@@ -221,9 +255,15 @@ The MCP tools:
|
|
|
221
255
|
- `fling_find_files`: recent `.html`/`.zip` files and folders with an `index.html` in those folders,
|
|
222
256
|
newest first (last 14 days by default).
|
|
223
257
|
- `fling_login`: opens the browser sign-in. If you haven't finished after about 30 seconds it returns
|
|
224
|
-
and keeps waiting in the background for up to 5 minutes.
|
|
225
|
-
|
|
226
|
-
|
|
258
|
+
and keeps waiting in the background for up to 5 minutes. With `server` it signs in to another
|
|
259
|
+
Fling, including a new one, which becomes current only if none is.
|
|
260
|
+
- `fling_servers`: lists the Flings on this computer (address, name, who is signed in, which is
|
|
261
|
+
current), read when called. `{use: <server>}` makes one current, the same as `fling use`.
|
|
262
|
+
- `fling_check_name`, `fling_list`, `fling_info`, `fling_files`, `fling_share`,
|
|
263
|
+
`fling_set_visibility`, `fling_archive`, `fling_rollback`, `fling_delete` (needs
|
|
264
|
+
`confirm: true`), `fling_whoami`, and the comment tools when a Fling has comments.
|
|
265
|
+
|
|
266
|
+
Results that give URLs (deploys, publishes, comments) end with the Fling they went to.
|
|
227
267
|
|
|
228
268
|
The MCP server never prompts:
|
|
229
269
|
|
|
@@ -240,21 +280,27 @@ For Claude Desktop (including Cowork), install the one-click extension. It runs
|
|
|
240
280
|
on your computer, so Claude can fling files you downloaded or that Claude Desktop saved, by name,
|
|
241
281
|
without uploading anything from Claude's sandbox.
|
|
242
282
|
|
|
243
|
-
1. Download `fling.mcpb` from
|
|
283
|
+
1. Download `fling.mcpb` from any Fling (Get started → Download, or `https://<your Fling>/downloads/fling.mcpb`).
|
|
244
284
|
2. Double-click it, or drag it into Claude Desktop, or go to **Settings → Extensions → Advanced
|
|
245
285
|
settings → Install Extension…** and pick the file.
|
|
246
|
-
3. Optional
|
|
247
|
-
the one the CLI is logged in to) and **Downloads folder** (default `~/Downloads`).
|
|
286
|
+
3. Optional setting: **Downloads folder** (default `~/Downloads`).
|
|
248
287
|
4. Ask Claude to "fling Pitch Deck.html from my Downloads". If you're not signed in, Claude calls
|
|
249
|
-
`fling_login` and your browser opens. The extension and the CLI share the
|
|
288
|
+
`fling_login` and your browser opens. The extension and the CLI share the logins in
|
|
250
289
|
`~/.fling/config.json`.
|
|
251
290
|
|
|
291
|
+
There is one extension for every Fling. When it starts, it adds the Fling you downloaded it from to
|
|
292
|
+
the ones this computer knows (if it isn't there yet) without changing the current one, unless none
|
|
293
|
+
is current. Installing a copy from another Fling updates the same extension in place. To use
|
|
294
|
+
another Fling, ask Claude to sign in to it (`fling_login` with its address) or run
|
|
295
|
+
`fling login <url>`. With several Flings, Claude agrees with you which one to use, as described in
|
|
296
|
+
[Several Flings](#claude-code-plugin-and-mcp) above.
|
|
297
|
+
|
|
252
298
|
It needs Node.js 20 or later, which Claude Desktop provides, on macOS or Windows.
|
|
253
299
|
|
|
254
300
|
Build it with `pnpm --filter ./apps/cli build:mcpb`. That bundles `src/mcp-entry.ts` and every
|
|
255
301
|
dependency into one file, then validates and packs `mcpb/manifest.json` into `dist/fling.mcpb`
|
|
256
|
-
(`FLING_MCPB_SERVER_URL`
|
|
257
|
-
`/downloads/fling.mcpb`.
|
|
302
|
+
(with `FLING_MCPB_SERVER_URL` set, its origin is baked into the extension's env as
|
|
303
|
+
`FLING_ADD_SERVER`, the Fling added on start). A deploy publishes it at `/downloads/fling.mcpb`.
|
|
258
304
|
|
|
259
305
|
To use the MCP server in another client, run it over stdio:
|
|
260
306
|
|