@nearform/fling 0.1.2 → 0.2.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 +36 -22
- package/dist/cli.js +945 -590
- package/dist/cli.js.map +4 -4
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -20,31 +20,45 @@ npm install -g @nearform/fling # then: fling …
|
|
|
20
20
|
npx @nearform/fling …
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
##
|
|
23
|
+
## Set up
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
fling
|
|
26
|
+
fling setup
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
This
|
|
30
|
-
|
|
29
|
+
This does everything a new machine needs:
|
|
30
|
+
|
|
31
|
+
1. **Signs you in.** Your browser opens for Nearform Google sign-in and an API key is stored in
|
|
32
|
+
`~/.fling/config.json` (mode 0600). This is skipped if you're already signed in.
|
|
33
|
+
2. **Adds Fling to Claude Code.** If `claude` is on your PATH, setup installs the Fling plugin
|
|
34
|
+
(skill + MCP server) from the `nearform/fling` marketplace, or updates it if it's already
|
|
35
|
+
installed. `--scope project|local` installs it for this project only (default `user`).
|
|
36
|
+
3. **Adds Fling to Claude Desktop.** If Claude Desktop is installed (macOS, Windows), setup
|
|
37
|
+
downloads `fling.mcpb` and opens it, and Claude Desktop asks you to confirm.
|
|
38
|
+
|
|
39
|
+
On a terminal it asks before steps 2 and 3. With `--yes` it does them without asking.
|
|
40
|
+
|
|
41
|
+
To sign in only, use `fling login`. `fling whoami` shows who you are, and `fling logout` removes the
|
|
31
42
|
key. For CI, set `FLING_API_KEY` instead.
|
|
32
43
|
|
|
33
44
|
## Deploy
|
|
34
45
|
|
|
35
46
|
```sh
|
|
36
47
|
npm run build
|
|
37
|
-
fling ./dist # name generated from the project, e.g. rocketpod-docs; you confirm it
|
|
38
|
-
fling ./dist --name my-app # → https://my-app.fling.labs.nearform.com
|
|
39
|
-
fling ./dist --name my-app --spa # client-side routing: unknown paths serve index.html
|
|
40
|
-
fling ./dist --public # no sign-in needed to view
|
|
41
|
-
fling ./dist --yes # never prompt (CI): use the generated name as is
|
|
42
|
-
fling # deploys the current folder
|
|
43
|
-
fling "Pitch Deck.html" # a single page, served as index.html → pitch-deck
|
|
44
|
-
fling site.zip # a zip of a site: extracted, a single top folder unwrapped
|
|
45
|
-
fling diagram.svg # any other file, next to a generated page that shows it
|
|
48
|
+
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.fling.labs.nearform.com
|
|
50
|
+
fling deploy ./dist --name my-app --spa # client-side routing: unknown paths serve index.html
|
|
51
|
+
fling deploy ./dist --public # no sign-in needed to view
|
|
52
|
+
fling deploy ./dist --yes # never prompt (CI): use the generated name as is
|
|
53
|
+
fling deploy # deploys the current folder
|
|
54
|
+
fling deploy "Pitch Deck.html" # a single page, served as index.html → pitch-deck
|
|
55
|
+
fling deploy site.zip # a zip of a site: extracted, a single top folder unwrapped
|
|
56
|
+
fling deploy diagram.svg # any other file, next to a generated page that shows it
|
|
46
57
|
```
|
|
47
58
|
|
|
59
|
+
`fling <path>` is short for `fling deploy <path>` when the path exists, so `fling ./dist` works.
|
|
60
|
+
An existing path wins over a command of the same name. Bare `fling` prints help.
|
|
61
|
+
|
|
48
62
|
What you can fling:
|
|
49
63
|
|
|
50
64
|
- **A folder**, as is.
|
|
@@ -57,14 +71,8 @@ What you can fling:
|
|
|
57
71
|
A file's default site name comes from its name, without the extension or a browser's ` (1)`
|
|
58
72
|
duplicate suffix: `Pitch Deck (1).html` → `pitch-deck`. Folders use the naming rules below.
|
|
59
73
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
`~/Documents/Claude`, `~/Claude` and Claude Desktop's output folders, and says where it found it:
|
|
63
|
-
|
|
64
|
-
```
|
|
65
|
-
$ fling Pitch-Deck.html
|
|
66
|
-
fling Found in Downloads: /Users/me/Downloads/Pitch-Deck.html
|
|
67
|
-
```
|
|
74
|
+
The path must exist where you give it. The CLI doesn't look for files elsewhere (the MCP server
|
|
75
|
+
does; see below).
|
|
68
76
|
|
|
69
77
|
- Re-fling to update. Identical content is a no-op, and content you deployed before is restored
|
|
70
78
|
instantly without uploading.
|
|
@@ -158,7 +166,7 @@ Global options: `--json` prints machine-readable output, and `--server <url>` po
|
|
|
158
166
|
server. Exit codes are `0` ok, `1` error, `2` not logged in and `3` forbidden.
|
|
159
167
|
|
|
160
168
|
Environment: `FLING_API_KEY`, `FLING_URL`, `FLING_CONFIG_DIR`, `FLING_DEBUG`, `FLING_DOWNLOADS_DIR`
|
|
161
|
-
(where files given by name
|
|
169
|
+
(where the MCP server looks for files given by name first), `FLING_NO_WAIT=1` (after a deploy or a new share
|
|
162
170
|
link, don't wait the few seconds it takes to reach every edge).
|
|
163
171
|
|
|
164
172
|
## Claude Code plugin and MCP
|
|
@@ -166,6 +174,12 @@ link, don't wait the few seconds it takes to reach every edge).
|
|
|
166
174
|
The Fling plugin gives Claude a `fling` skill plus an MCP server (`fling mcp`), so you can say
|
|
167
175
|
"fling the dist folder and give me a share link":
|
|
168
176
|
|
|
177
|
+
```sh
|
|
178
|
+
fling setup
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
Or install it by hand in Claude Code:
|
|
182
|
+
|
|
169
183
|
```
|
|
170
184
|
/plugin marketplace add nearform/fling
|
|
171
185
|
/plugin install fling@fling
|