@hugomrdias/fil 0.0.0 → 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 +2 -2
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/skills/fil/SKILL.md +24 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hugomrdias/fil",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Command-line interface for Filecoin storage",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Hugo Dias <hugomrdias@gmail.com>",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@filoz/synapse-core": "^0.10.0",
|
|
28
28
|
"@ipld/car": "^5.4.7",
|
|
29
29
|
"@types/node": "26.5.1",
|
|
30
|
-
"clipact": "0.
|
|
30
|
+
"clipact": "0.1.0",
|
|
31
31
|
"env-paths": "^4.0.0",
|
|
32
32
|
"esbuild": "0.28.2",
|
|
33
33
|
"ipfs-unixfs-exporter": "^16.2.3",
|
package/skills/fil/SKILL.md
CHANGED
|
@@ -1,28 +1,41 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: fil
|
|
3
|
-
description: Store files and folders on Filecoin with the fil CLI
|
|
3
|
+
description: Store files and folders on Filecoin with the fil CLI, return links to share them, and retrieve and verify them later. Use when the user asks to publish, store, share, back up, retrieve, or verify content on Filecoin.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# fil
|
|
7
7
|
|
|
8
|
-
`fil` stores a file (exact bytes) or a folder (a UnixFS CAR served over IPFS) on Filecoin and returns
|
|
8
|
+
`fil` stores a file (its exact bytes) or a folder (a UnixFS CAR served over IPFS) on Filecoin and returns links to share it. A person owns the wallet and approves what you may do. You never hold the wallet key.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## Run it
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
Run `fil` when it is on the PATH. Otherwise run `npx -y @hugomrdias/fil` in its place, which needs Node.js 24 or newer.
|
|
13
|
+
|
|
14
|
+
Every command writes one JSON object to stdout: `data` on success or `error` on failure, then optional `next` steps. Branch on `error.code`, never on stderr text.
|
|
15
|
+
|
|
16
|
+
Don't guess flags or fields. The installed CLI describes itself:
|
|
17
|
+
|
|
18
|
+
- `fil --help` lists the commands, and `fil <command> --help` shows examples and flags.
|
|
19
|
+
- `fil schema <command>` gives the input and output JSON Schemas, and what each error code means.
|
|
14
20
|
|
|
15
21
|
## Workflow
|
|
16
22
|
|
|
17
|
-
1. `fil status` shows whether a session key is
|
|
18
|
-
2. `fil put <path> --dry-run`
|
|
19
|
-
3. `fil put <path>`
|
|
20
|
-
4. `fil get <ref>` downloads and verifies
|
|
23
|
+
1. `fil status` shows whether a session key is approved and the account is funded.
|
|
24
|
+
2. `fil put <path> --dry-run` reports the size, provider, cost, and missing authorization without storing anything.
|
|
25
|
+
3. `fil put <path>` stores it. Give the user `data.urls.browser` exactly as returned, with `data.resource.ref`.
|
|
26
|
+
4. `fil get <ref>` downloads the content and verifies it. `fil ls` and `fil inspect <ref>` find what was stored.
|
|
21
27
|
|
|
22
28
|
## Rules
|
|
23
29
|
|
|
24
30
|
- Never ask for or pass a private key. Logging in needs the user: `auth_required` or `login_pending` means relay the `by: "user"` step (the fil-app approval link) and stop. After the user approves, run `fil login` once to confirm.
|
|
25
|
-
- `insufficient_funds` and `session_expired` also need the user
|
|
31
|
+
- `insufficient_funds` and `session_expired` also need the user. Relay their `next` steps.
|
|
26
32
|
- `fil delete <ref>` needs `--yes`. On `confirmation_required`, relay the reason and rerun with `--yes` only after the user agrees.
|
|
27
|
-
- Never repeat a failed or interrupted `put` or `delete`: that starts a new paid operation. Run the `fil operations resume <id>` command from `next` instead
|
|
33
|
+
- Never repeat a failed or interrupted `put` or `delete`: that starts a new paid operation. Run the `fil operations resume <id>` command from `next` instead. Errors with a fil code also carry the ID in `error.details.operationId`. Find lost operation IDs with `fil operations ls --incomplete`.
|
|
28
34
|
- Retry only when `error.retryable` is `true`, after `retryAfterSeconds` when present.
|
|
35
|
+
|
|
36
|
+
## Read more only when you need it
|
|
37
|
+
|
|
38
|
+
Fetch these pages; each is Markdown:
|
|
39
|
+
|
|
40
|
+
- No browser to open, or a disk that is gone when the session ends, such as a cloud sandbox: read [Cloud agents](https://fil-app.hugomrdias.dev/agents.md#cloud-agents) before `fil login`.
|
|
41
|
+
- A link returns 404, the user wants proof the content is intact, or `fil ls` is missing content stored elsewhere: read [Retrieve and verify](https://fil-app.hugomrdias.dev/docs/retrieve.md).
|