@nearform/fling 0.8.0 → 0.9.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 +64 -5
- package/dist/cli.js +1023 -175
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -38,13 +38,64 @@ This does everything a new machine needs:
|
|
|
38
38
|
sign-in providers, its login page, to choose one) and an API key is
|
|
39
39
|
stored in `~/.fling/config.json` (mode 0600). This is skipped if you're already signed in.
|
|
40
40
|
The server becomes your current one; logins to other Flings are kept.
|
|
41
|
+
When you are already signed in, it reads the server's `/.well-known/fling` again, so the CLI
|
|
42
|
+
knows the release it runs now.
|
|
41
43
|
2. **Adds Fling to Claude Code.** If `claude` is on your PATH, setup installs the Fling plugin
|
|
42
|
-
(skill + MCP server) from the `nearform/fling` marketplace
|
|
43
|
-
|
|
44
|
+
(skill + MCP server) from the `nearform/fling` marketplace. `--scope project|local` installs it
|
|
45
|
+
for this project only (default `user`). When the plugin is already installed, setup refreshes
|
|
46
|
+
it instead (`claude plugin marketplace update fling`, then `claude plugin update fling@fling`)
|
|
47
|
+
and says which version it went from and to; restart Claude Code (or run `/reload-plugins`)
|
|
48
|
+
after an update. A refresh that fails is reported and leaves the installed plugin as it was;
|
|
49
|
+
it doesn't fail setup.
|
|
44
50
|
3. **Adds Fling to Claude Desktop.** If Claude Desktop is installed (macOS, Windows), setup
|
|
45
|
-
downloads `fling.mcpb` and opens it, and Claude Desktop asks you
|
|
51
|
+
downloads the `fling.mcpb` of the CLI's own version and opens it, and Claude Desktop asks you
|
|
52
|
+
to confirm. That is the server's copy when the server runs the same release, otherwise the one
|
|
53
|
+
attached to the CLI's GitHub Release (the server's copy if that download fails). Running setup
|
|
54
|
+
again updates an older extension in place.
|
|
46
55
|
|
|
47
|
-
On a terminal it asks before
|
|
56
|
+
On a terminal it asks before installing the plugin and before step 3. With `--yes` it does them
|
|
57
|
+
without asking. Refreshing an installed plugin needs no question.
|
|
58
|
+
|
|
59
|
+
### Staying up to date
|
|
60
|
+
|
|
61
|
+
Every Fling publishes the release it runs (`release` in `/.well-known/fling`). After a command, when
|
|
62
|
+
the server it used runs a newer release than the CLI, the CLI prints one line on stderr:
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
▲ Fling 0.9.0 is out (this CLI is 0.8.0). Update: npm i -g @nearform/fling@latest && fling setup
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
It compares with the metadata the CLI already holds, so it never makes a request of its own. The
|
|
69
|
+
stored release stays current because every server response says which release the server runs (the
|
|
70
|
+
`Fling-Release` header): when it differs from the stored one, the CLI stores the new release. That
|
|
71
|
+
needs both the server and the CLI on a release after 0.8.0; with an older server, the stored release
|
|
72
|
+
changes only at sign-in, when `fling setup` reads the metadata again, and when a command needs a
|
|
73
|
+
feature the stored copy lacks. It says it at most once a day per server, remembering when in
|
|
74
|
+
`update-check.json` in the config directory. It says nothing under `--json`, when stderr isn't a
|
|
75
|
+
terminal, when `CI` is set, or when `FLING_NO_UPDATE_CHECK` is set (to anything). A server older
|
|
76
|
+
than the CLI says nothing either. The MCP server tells Claude instead (see [Claude Code plugin and
|
|
77
|
+
MCP](#claude-code-plugin-and-mcp)).
|
|
78
|
+
|
|
79
|
+
### When something doesn't work
|
|
80
|
+
|
|
81
|
+
`fling doctor` checks the setup and prints one line per check, `✔` ok, `▲` warning or `✖` problem,
|
|
82
|
+
each warning and problem with its fix:
|
|
83
|
+
|
|
84
|
+
- **CLI:** its version, Node.js against the versions it supports, the latest version on npm
|
|
85
|
+
(skipped when npm can't be reached), and whether `fling` on your PATH is this CLI.
|
|
86
|
+
- **Config:** where it lives (`FLING_CONFIG_DIR`), whether the config file is private (mode 0600:
|
|
87
|
+
it holds your API keys), and whether `FLING_URL` or `FLING_API_KEY` is in effect (named, never
|
|
88
|
+
shown).
|
|
89
|
+
- **Each Fling** you signed in to, the current one marked: whether its `/.well-known/fling`
|
|
90
|
+
answers, the release it runs against the CLI's, whether your API key is still accepted, and the
|
|
91
|
+
features it reports.
|
|
92
|
+
- **Claude Code:** `claude` on your PATH, the Fling plugin (installed, enabled, its version against
|
|
93
|
+
the CLI's) and the `fling` marketplace.
|
|
94
|
+
- **Claude Desktop:** whether the extension is installed, enabled, and its version.
|
|
95
|
+
|
|
96
|
+
It only reads: it changes nothing, and each request has a short timeout. `--json` prints
|
|
97
|
+
`{ ok, checks: [{ area, id, status, message, fix?, server? }] }`. The exit code is 1 when any check
|
|
98
|
+
is a problem.
|
|
48
99
|
|
|
49
100
|
To sign in only, use `fling login <url>` (the URL is remembered: later `fling login` needs none).
|
|
50
101
|
There is no default server: until you log in, commands say to run `fling login <url>`.
|
|
@@ -382,7 +433,8 @@ another server (a remembered one brings its key; see [Several Flings](#several-f
|
|
|
382
433
|
Environment: `FLING_API_KEY`, `FLING_URL`, `FLING_CONFIG_DIR`, `FLING_DEBUG`, `FLING_DOWNLOADS_DIR`
|
|
383
434
|
(where the MCP server looks for files given by name first), `FLING_ADD_SERVER` (a Fling the MCP
|
|
384
435
|
server adds to the remembered ones when it starts), `FLING_NO_WAIT=1` (after a deploy or a new share
|
|
385
|
-
link, don't wait the few seconds it takes to reach every edge)
|
|
436
|
+
link, don't wait the few seconds it takes to reach every edge), `FLING_NO_UPDATE_CHECK` (never say
|
|
437
|
+
that a newer Fling release is out; see [Staying up to date](#staying-up-to-date)).
|
|
386
438
|
|
|
387
439
|
## Claude Code plugin and MCP
|
|
388
440
|
|
|
@@ -439,6 +491,8 @@ The MCP tools:
|
|
|
439
491
|
Fling, including a new one, which becomes current only if none is.
|
|
440
492
|
- `fling_servers`: lists the Flings on this computer (address, name, who is signed in, which is
|
|
441
493
|
current), read when called. `{use: <server>}` makes one current, the same as `fling use`.
|
|
494
|
+
- `fling_doctor`: the checks of `fling doctor`, read-only, as lines and data. Claude calls it when
|
|
495
|
+
something about Fling doesn't work (sign-in, tools missing, versions) and tells you the fixes.
|
|
442
496
|
- `fling_check_name`, `fling_list`, `fling_info`, `fling_files`, `fling_share`,
|
|
443
497
|
`fling_set_visibility`, `fling_archive`, `fling_rollback`, `fling_delete` (needs
|
|
444
498
|
`confirm: true`), `fling_whoami`, the comment tools when a Fling has comments, the forms tools when it has forms
|
|
@@ -454,6 +508,11 @@ The MCP tools:
|
|
|
454
508
|
|
|
455
509
|
Results that give URLs (deploys, publishes, comments) end with the Fling they went to.
|
|
456
510
|
|
|
511
|
+
**Updates.** When a Fling the MCP server knows runs a newer release than it, its instructions say
|
|
512
|
+
so, and so does the first `fling_publish` or `fling_deploy` result of the session on that Fling.
|
|
513
|
+
Claude then suggests the update command (`npm i -g @nearform/fling@latest && fling setup`, then
|
|
514
|
+
restart Claude): inside Claude you never see the CLI's own update line.
|
|
515
|
+
|
|
457
516
|
The MCP server never prompts:
|
|
458
517
|
|
|
459
518
|
- **Names.** Without a `name`, `fling_deploy` uses the generated name and fails with suggestions if
|