@nearform/fling 0.5.1 → 0.7.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 +164 -9
- package/dist/cli.js +2837 -480
- package/package.json +3 -4
- package/CHANGELOG.md +0 -80
- package/dist/cli.js.map +0 -7
package/README.md
CHANGED
|
@@ -12,7 +12,8 @@ link.
|
|
|
12
12
|
|
|
13
13
|
> **Upgrading from 0.2?** The CLI no longer has a built-in server. If you were logged in with 0.2
|
|
14
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
|
|
15
|
+
> `fling login <url>` once with your Fling's address. See the
|
|
16
|
+
> [changelog](https://github.com/nearform/fling/blob/main/CHANGELOG.md).
|
|
16
17
|
|
|
17
18
|
## Install
|
|
18
19
|
|
|
@@ -33,7 +34,8 @@ fling setup https://fling.example.com # your Fling's address; later runs can l
|
|
|
33
34
|
This does everything a new machine needs:
|
|
34
35
|
|
|
35
36
|
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
|
|
37
|
+
live, how people sign in) and remembers it. Your browser opens for sign-in (on a Fling with two
|
|
38
|
+
sign-in providers, its login page, to choose one) and an API key is
|
|
37
39
|
stored in `~/.fling/config.json` (mode 0600). This is skipped if you're already signed in.
|
|
38
40
|
The server becomes your current one; logins to other Flings are kept.
|
|
39
41
|
2. **Adds Fling to Claude Code.** If `claude` is on your PATH, setup installs the Fling plugin
|
|
@@ -73,7 +75,9 @@ npm run build
|
|
|
73
75
|
fling deploy ./dist # name generated from the project, e.g. rocketpod-docs; you confirm it
|
|
74
76
|
fling deploy ./dist --name my-app # → https://my-app.<your sites domain>
|
|
75
77
|
fling deploy ./dist --name my-app --spa # client-side routing: unknown paths serve index.html
|
|
76
|
-
fling deploy ./dist --
|
|
78
|
+
fling deploy ./dist --access members # a new site everyone signed in can open
|
|
79
|
+
fling deploy ./dist --access people --add bob@example.com # only you and Bob
|
|
80
|
+
fling deploy ./dist --access public # no sign-in needed to view
|
|
77
81
|
fling deploy ./dist --yes # never prompt (CI): use the generated name as is
|
|
78
82
|
fling deploy # deploys the current folder
|
|
79
83
|
fling deploy "Pitch Deck.html" # a single page, served as index.html → pitch-deck
|
|
@@ -101,6 +105,23 @@ does; see below).
|
|
|
101
105
|
|
|
102
106
|
- Re-fling to update. Identical content is a no-op, and content you deployed before is restored
|
|
103
107
|
instantly without uploading.
|
|
108
|
+
- **Publish one folder of a site** with `--path` (and `--name`): `fling deploy ./report --name
|
|
109
|
+
changelog --path 30-10-26` serves the report at `https://changelog.<sites domain>/30-10-26/` and
|
|
110
|
+
keeps every other file of the site. Only the folder's files are uploaded; the server copies the
|
|
111
|
+
rest into the new version (at most 1,000 files, else `too_large`: deploy the whole site). If
|
|
112
|
+
someone else publishes the site in between, the deploy runs once more on top of theirs. `fling
|
|
113
|
+
versions` shows where each one went (PATH), and rolling back removes it. On a Fling without path
|
|
114
|
+
publishing (`pathPublish`) the CLI refuses rather than replace the whole site.
|
|
115
|
+
- **Change a site you can open** with `fling pull <name> [dir]`: it downloads the current version
|
|
116
|
+
into `dir` (default `./<name>`) with a site link, `.fling-site.json`, naming the server, the site
|
|
117
|
+
and the version pulled. `fling deploy <dir>` then publishes to that site on that version and
|
|
118
|
+
uploads only what changed (`3 changed, 1 removed`). If someone published the site since you
|
|
119
|
+
pulled, it stops (`base_changed`) rather than overwrite their work: pull again into another
|
|
120
|
+
folder and redo your change, or `fling deploy <dir> --force` to replace what they published.
|
|
121
|
+
`--path <folder>` pulls one folder of the site; `--version-id <id>` another version (owners and
|
|
122
|
+
publishers). Anyone signed in who can open the site may pull it; only its owners and publishers
|
|
123
|
+
may deploy. A folder that isn't empty needs `--force`. On a Fling without the `pull` capability
|
|
124
|
+
the CLI says so.
|
|
104
125
|
- **Fling never publishes dotfiles, gitignored files, secret files (keys, certs, credentials) or
|
|
105
126
|
files that contain secrets; it stops and tells you which file and line.** There is no flag to
|
|
106
127
|
override this, and the server enforces it too.
|
|
@@ -178,15 +199,118 @@ and a taken name fails (exit 1) with suggestions rather than picking another nam
|
|
|
178
199
|
|
|
179
200
|
| Command | |
|
|
180
201
|
|---|---|
|
|
181
|
-
| `fling ls [--archived]` | your sites |
|
|
182
|
-
| `fling
|
|
202
|
+
| `fling ls [--archived] [--sort updated\|created\|name]` | your sites, last updated first (`created`: newest first; `name`: A–Z) |
|
|
203
|
+
| `fling ls --shared [--sort …]` | the restricted sites others have shared with you: owner, and how (your address or a group) |
|
|
204
|
+
| `fling info <name>` / `fling versions <name>` | details and version history, with who published each version and, for a path publish, the folder (PATH) |
|
|
205
|
+
| `fling pull <name> [dir] [--path <folder>] [--version-id <id>] [--force]` | download a site's files to change them; `fling deploy <dir>` publishes on the version pulled |
|
|
183
206
|
| `fling files <name> [versionId]` | the files in the live version (or an earlier one) |
|
|
184
207
|
| `fling rollback <name> <versionId>` | serve an earlier version |
|
|
185
208
|
| `fling share <name> [--refresh] [--revoke]` | public share link: print or create it, rotate it, or remove it |
|
|
186
|
-
| `fling visibility <name> private\|public` | require sign-in, or not |
|
|
209
|
+
| `fling visibility <name> private\|public` | require sign-in, or not (private again: the access it had) |
|
|
210
|
+
| `fling access <name> [--only-me \| --members \| --public] [--add <emails>] [--remove <emails>] [--group <slugs>] [--remove-group <slugs>] [--clear]` | who can open a site: only you, listed people and groups, everyone signed in, or anyone |
|
|
211
|
+
| `fling owners <name> [--add <emails>] [--remove <emails>] [--set <emails>] [--group <slugs>] [--remove-group <slugs>]` | who owns a site, or change it |
|
|
212
|
+
| `fling publishers <name> [--add …] [--remove …] [--set …] [--group …] [--remove-group …]` | who publishes a site without owning it, or change it |
|
|
187
213
|
| `fling archive <name>` / `fling unarchive <name>` | take offline and keep the files, or bring back |
|
|
188
214
|
| `fling rm <name> [--yes]` | delete permanently |
|
|
189
215
|
|
|
216
|
+
An admin of the instance can read anyone's site with these commands (`fling info`, `fling files`,
|
|
217
|
+
the comments). Changing someone else's site needs the admin's browser session: open it from All
|
|
218
|
+
sites in the web app.
|
|
219
|
+
|
|
220
|
+
### Who can open a site
|
|
221
|
+
|
|
222
|
+
Each site has an access level: **only you**, **teams** (groups), **specific people**, **everyone
|
|
223
|
+
signed in** to your Fling, or **public**. A new site gets the one you give with `deploy --access
|
|
224
|
+
only_me|members|groups|people|public` (with `--add <emails>` and `--group <slugs>` for people and
|
|
225
|
+
teams); without it, your Fling's default, which is only you unless it is set up otherwise, and the
|
|
226
|
+
deploy says who can open it. A re-deploy never changes it. `fling ls` shows each site's level in
|
|
227
|
+
its ACCESS column and `fling info` on its Access line.
|
|
228
|
+
|
|
229
|
+
`fling access` shows and changes it. `--only-me`, `--members` and `--public` set the level; the
|
|
230
|
+
audience options limit the site to listed people and groups (its audience); you, the owner, can
|
|
231
|
+
always open it:
|
|
232
|
+
|
|
233
|
+
```sh
|
|
234
|
+
fling access my-app # who can open it now
|
|
235
|
+
fling access my-app --only-me # nobody else
|
|
236
|
+
fling access my-app --members # everyone signed in
|
|
237
|
+
fling access my-app --add bob@example.com,cat@example.com
|
|
238
|
+
fling access my-app --remove bob@example.com
|
|
239
|
+
fling access my-app --group design # everyone in the design group too
|
|
240
|
+
fling access my-app --remove-group design
|
|
241
|
+
fling access my-app --clear # empty the audience: everyone signed in
|
|
242
|
+
fling access my-app --public # anyone, no sign-in
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Addresses are comma-separated or given after `--add` one by one, and each must be one that can sign
|
|
246
|
+
in to the Fling. Where the Fling invites people from outside (its `invites` capability), an outside
|
|
247
|
+
address is invited as a **guest**: a reviewer who signs in with a link emailed to them and sees only
|
|
248
|
+
what is shared with them, marked `(guest)`. You can invite a few new outside addresses a day; past
|
|
249
|
+
that, nothing changes and the CLI says so (`too_many_invites`). The same goes for `fling groups
|
|
250
|
+
create` and `fling groups add`. Someone who hasn't signed in yet is marked `(hasn't signed in yet)`;
|
|
251
|
+
they can open the site once they do. The audience only applies while the site is private: on a public site it is
|
|
252
|
+
kept for later and `fling access` says so. A share link still opens a restricted site to anyone who
|
|
253
|
+
has it, and `fling access` warns while one exists. Removing someone shuts them out within 5
|
|
254
|
+
minutes. `--json` prints the site with its `audience` (`{ emails: [{ email, known, guest? }], groups:
|
|
255
|
+
[{ slug, name, size }] }`) and `warnings`; `fling info` shows the same line, and `fling ls --json`
|
|
256
|
+
gives each site's `access`, `restricted`, `audienceSize` and `audienceGroups` (how many of those
|
|
257
|
+
are groups). A share link opens a site only you can see as well: it is your choice to hand it out.
|
|
258
|
+
|
|
259
|
+
`fling ls --shared` lists the other side: the restricted sites whose audience names you, or a group
|
|
260
|
+
you are in, with their owner and how they reached you. With `--json`, each is `{ name, url,
|
|
261
|
+
reviewUrl?, owner, via: { direct, groups }, createdAt, updatedAt }`. Your own sites, and private
|
|
262
|
+
sites open to everyone signed in, aren't listed.
|
|
263
|
+
|
|
264
|
+
### Owners and publishers
|
|
265
|
+
|
|
266
|
+
A site's **owners** are equal: each can publish it, roll it back, change who can open it and its
|
|
267
|
+
settings, its owners and publishers, archive and delete it. Its **publishers** can publish and roll
|
|
268
|
+
back, and nothing else. Both are people and groups, and only people who can sign in to your Fling
|
|
269
|
+
as members (never guests) can hold either:
|
|
270
|
+
|
|
271
|
+
```sh
|
|
272
|
+
fling owners my-app # who owns and publishes it, and your role
|
|
273
|
+
fling owners my-app --add cat@example.com # Cat owns it too
|
|
274
|
+
fling owners my-app --remove you@example.com # hand it over (someone else must own it)
|
|
275
|
+
fling publishers my-app --add bob@example.com --group design
|
|
276
|
+
fling publishers my-app --remove-group design
|
|
277
|
+
fling publishers my-app --set bob@example.com # exactly these addresses (groups stay)
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
A site always keeps at least one person as an owner, so `--remove` of the last one is refused
|
|
281
|
+
(`last_owner`); a group alone never counts. Someone in both lists is an owner. Naming a group
|
|
282
|
+
trusts whoever manages it: anyone they add owns or publishes the site too. People you add are told
|
|
283
|
+
by email where your Fling sends it. `fling ls` shows your ROLE on each site (owner, publisher, or
|
|
284
|
+
admin for an admin's view), and `fling info` its Owners, Publishers and You. As a publisher,
|
|
285
|
+
`fling deploy` publishes new content, but can't change the site's access or settings (`--access`,
|
|
286
|
+
`--public`, `--spa` that differ: `owner_only`) or bring an archived site back. With `--json`, the
|
|
287
|
+
commands print `{ name, role, owners, publishers }`, each list `{ emails: [{ email, known, guest?
|
|
288
|
+
}], groups: [{ slug, name, size }] }`.
|
|
289
|
+
|
|
290
|
+
### Groups
|
|
291
|
+
|
|
292
|
+
A group is a named list of people, such as a team, that anyone signed in can use in a site's
|
|
293
|
+
audience. Everyone can list groups and see who is in one; only the group's owner, who made it, can
|
|
294
|
+
change its members, rename it or delete it:
|
|
295
|
+
|
|
296
|
+
```sh
|
|
297
|
+
fling groups # every group (--mine: only yours)
|
|
298
|
+
fling groups --members bob@example.com,cat@example.com # the groups of exactly these people
|
|
299
|
+
fling groups show design # its members
|
|
300
|
+
fling groups create design --name "Design team" --add bob@example.com,cat@example.com
|
|
301
|
+
fling groups add design dan@example.com
|
|
302
|
+
fling groups remove design bob@example.com
|
|
303
|
+
fling groups rename design "Designers"
|
|
304
|
+
fling groups delete design # asks first unless --yes
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
A slug is lowercase letters, digits and single hyphens, unique on the Fling; a group holds up to 500
|
|
308
|
+
people, and an audience names up to 10 groups. Taking someone out of a group shuts them out of the
|
|
309
|
+
sites it opens within 5 minutes. Deleting a group never opens a site up: sites whose audience
|
|
310
|
+
names it keep their restriction, and anyone it let in loses access. Where it was the only entry,
|
|
311
|
+
`fling access` shows "a deleted group (#<id>)" and only you can open the site until you add
|
|
312
|
+
people or groups (`--remove-group '#<id>'` takes the reference out).
|
|
313
|
+
|
|
190
314
|
## Comments
|
|
191
315
|
|
|
192
316
|
People review a site on its review page (`<your Fling>/review/<name>`, the **Review** button on the
|
|
@@ -203,6 +327,23 @@ feedback (`reviewUrl` in `--json`); reviewers sign in to use it.
|
|
|
203
327
|
| `fling resolve <name> <id> [--reopen]` | resolve a thread, or reopen it |
|
|
204
328
|
| `fling uncomment <name> <id> [--yes]` | delete a comment (a thread with its replies): your own, or any on your site |
|
|
205
329
|
|
|
330
|
+
## Notifications
|
|
331
|
+
|
|
332
|
+
A Fling with email tells you when a site is shared with you (directly or through a group), when
|
|
333
|
+
you are added to a group, and when someone comments on your site or replies in your thread. You
|
|
334
|
+
choose what you hear about, per event and channel; the same settings are on the web app's
|
|
335
|
+
**Settings → Notifications** page, and every email has a link to stop that kind of email.
|
|
336
|
+
|
|
337
|
+
| Command | |
|
|
338
|
+
|---|---|
|
|
339
|
+
| `fling notifications` | a table of events × channels: on or off, `*` where you chose it rather than the default |
|
|
340
|
+
| `fling notifications set <event> <channel> on\|off\|default` | change one event on one channel (`default`: back to the Fling's default), e.g. `fling notifications set comment.created email off` |
|
|
341
|
+
| `fling notifications mute` / `unmute` | stop everything, or start again (your choices are kept) |
|
|
342
|
+
| `fling notifications sent` | what was sent to you in the last 30 days: when, the subject and its events |
|
|
343
|
+
|
|
344
|
+
On a Fling without notifications they say so. `--json` prints the settings as the API returns them
|
|
345
|
+
(`{ channels, events, muted, cells, overrides }`) or `{ sent: [...] }`.
|
|
346
|
+
|
|
206
347
|
Global options: `--json` prints machine-readable output, and `--server <url>` points one command at
|
|
207
348
|
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.
|
|
208
349
|
|
|
@@ -249,9 +390,16 @@ accepts).
|
|
|
249
390
|
The MCP tools:
|
|
250
391
|
|
|
251
392
|
- `fling_deploy`: a folder, `.html`, `.zip` or other file on this computer, by path or just its
|
|
252
|
-
name (looked up like the CLI does).
|
|
393
|
+
name (looked up like the CLI does). `sitePath` (with `name`) publishes it into that folder of the
|
|
394
|
+
site and keeps the rest, like `--path`. A folder pulled with `fling pull` or `fling_pull` deploys
|
|
395
|
+
on the version pulled, like the CLI; `force: true` publishes over whatever is live.
|
|
396
|
+
- `fling_pull`: downloads a site into a folder on this computer (default
|
|
397
|
+
`~/Documents/Claude/fling/<name>`) to change it and deploy it again with `fling_deploy`.
|
|
398
|
+
- `fling_read_files`: a site's files inline, a page at a time, for reading without a download.
|
|
253
399
|
- `fling_publish`: files passed inline, for content Claude wrote in the conversation. It has the same
|
|
254
|
-
definition as the remote connector's tool
|
|
400
|
+
definition as the remote connector's tool; `path` publishes them into that folder of the site;
|
|
401
|
+
`base` (a version from `fling_read_files`) sends only the files that changed, and `remove` names
|
|
402
|
+
files to delete.
|
|
255
403
|
- `fling_find_files`: recent `.html`/`.zip` files and folders with an `index.html` in those folders,
|
|
256
404
|
newest first (last 14 days by default).
|
|
257
405
|
- `fling_login`: opens the browser sign-in. If you haven't finished after about 30 seconds it returns
|
|
@@ -261,7 +409,14 @@ The MCP tools:
|
|
|
261
409
|
current), read when called. `{use: <server>}` makes one current, the same as `fling use`.
|
|
262
410
|
- `fling_check_name`, `fling_list`, `fling_info`, `fling_files`, `fling_share`,
|
|
263
411
|
`fling_set_visibility`, `fling_archive`, `fling_rollback`, `fling_delete` (needs
|
|
264
|
-
`confirm: true`), `fling_whoami`,
|
|
412
|
+
`confirm: true`), `fling_whoami`, the comment tools when a Fling has comments, and
|
|
413
|
+
`fling_set_audience` (`add`, `remove`, `set` or `clear` the people who can open a private site,
|
|
414
|
+
and `addGroups`, `removeGroups`, `setGroups` for groups) when it can limit sites to listed
|
|
415
|
+
people, `fling_set_owners` and `fling_set_publishers` (the same changes, to a site's owners or
|
|
416
|
+
publishers) where it has site roles, and the group tools (`fling_groups`, `fling_group_show`, `fling_group_create`,
|
|
417
|
+
`fling_group_members`, `fling_group_rename`, `fling_group_delete`) when it has groups, and
|
|
418
|
+
`fling_notifications` and `fling_notifications_set` (`muted`, and `cells` of
|
|
419
|
+
`{ event, channel, value: on|off|default }`) when it has notifications.
|
|
265
420
|
|
|
266
421
|
Results that give URLs (deploys, publishes, comments) end with the Fling they went to.
|
|
267
422
|
|