@moredrive/cli 1.3.0 → 1.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/README.md +4 -2
- package/ai-tooling.md +60 -0
- package/bin/moredrive.mjs +57 -46
- package/bin/webp_enc.wasm +0 -0
- package/build-info.json +3 -3
- package/commands.md +119 -7
- package/docs/ai-tooling.md +60 -0
- package/docs/commands.md +119 -7
- package/docs/json-contract.md +6 -2
- package/docs/release-notes.md +27 -2
- package/docs/schemas/moredrive-cli-config-v1.schema.json +22 -0
- package/docs/schemas/moredrive-cli-jsonl-v2.1.schema.json +1087 -6
- package/docs/schemas/moredrive-cli-output-v2.1.schema.json +1053 -6
- package/docs/security.md +13 -3
- package/json-contract.md +6 -2
- package/package.json +1 -1
- package/release-notes.md +27 -2
- package/schemas/moredrive-cli-config-v1.schema.json +22 -0
- package/schemas/moredrive-cli-jsonl-v2.1.schema.json +1087 -6
- package/schemas/moredrive-cli-output-v2.1.schema.json +1053 -6
- package/security.md +13 -3
- package/skills/moredrive-cli/SKILL.md +24 -3
- package/skills/moredrive-cli/agents/openai.yaml +2 -2
- package/third-party/jsquash-webp-LICENSE +201 -0
- package/third-party/libwebp-LICENSE +29 -0
package/README.md
CHANGED
|
@@ -6,10 +6,12 @@ MoreDrive 的命令行客户端,适用于脚本、CI 和 AI 工具。需要 No
|
|
|
6
6
|
|
|
7
7
|
更新:`npm install -g @moredrive/cli@latest`
|
|
8
8
|
|
|
9
|
-
离线文件安装:`npm install -g ./moredrive-cli-1.
|
|
9
|
+
离线文件安装:`npm install -g ./moredrive-cli-1.5.0.tgz`
|
|
10
10
|
|
|
11
11
|
验证:`moredrive --version`、`moredrive --help`。默认 API 为 `https://moredrive-api.rdfstu.com/api`。
|
|
12
12
|
|
|
13
|
-
通过 `moredrive login --username alice --password-stdin --save --json` 登录;使用 `moredrive ls / --json` 查看文件。运行命令前请阅读 [命令说明](docs/commands.md)、[JSON 合同](docs/json-contract.md) 和 [
|
|
13
|
+
通过 `moredrive login --username alice --password-stdin --save --json` 登录;使用 `moredrive ls / --json` 查看文件。运行命令前请阅读 [命令说明](./docs/commands.md)、[JSON 合同](./docs/json-contract.md)、[安全说明](./docs/security.md) 和 [AI 工具指南](./docs/ai-tooling.md)。密码从标准输入提供,不放进命令历史。凭据保存在本机配置文件中;保存的会话支持自动续期。
|
|
14
|
+
|
|
15
|
+
支持目录递归下载、传输限速、`stream --jsonl` 本地播放器服务、显式离线媒体转换,以及生成本地缩略图包。v1.5 普通传输默认 auto,按目录策略自动处理弱媒体表示;需要原始存储字节时显式使用 raw。成功上传可从本批本地来源生成并发布兼容封面,封面结果独立于原件结果;显式 media thumbnails 仅生成本地包,仍需另行上传。封面生成需要显式提供兼容 FFmpeg,缺少解码器不影响已完成的原件上传。离线机器契约可通过 `moredrive schema output`、`moredrive schema jsonl` 查看,默认 revision 为 `2.1`。
|
|
14
16
|
|
|
15
17
|
程序不会自动替换自身。AI 工具可以读取随包附带的 `skills/moredrive-cli/SKILL.md`,`--help` 显示实际安装路径。依赖许可证随包保留。
|
package/ai-tooling.md
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# AI Tooling Guide
|
|
2
|
+
|
|
3
|
+
Recommended defaults for agents:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
moredrive <command> --json --quiet
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Use `MOREDRIVE_TOKEN` for ephemeral automation. Use `--config` and `--profile` when a persistent local profile is required.
|
|
10
|
+
|
|
11
|
+
Start with the bundled `skills/moredrive-cli/SKILL.md`; `moredrive --help` prints its installed path. The [command guide](./commands.md) is the maintained reference. For long-running `stream`, use `--jsonl --quiet` instead of `--json`, wait for `ready`, and keep draining both output pipes until a terminal event. Offline `schema output` and `schema jsonl` print the schema itself, without a command-result envelope.
|
|
12
|
+
|
|
13
|
+
Safe read pattern:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
moredrive stat /docs/spec.md --json
|
|
17
|
+
moredrive read /docs/spec.md --max-bytes 1048576 --json
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Safe write pattern:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
printf '%s' "$CONTENT" | moredrive write /docs/output.md --max-bytes 1048576 --json
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
This is create-only. Add `--overwrite` only when replacement is intended and authorized, after checking the target. Retain the reported idempotency key after an ambiguous write and retry the same content, path and flags with that key. Close stdin after supplying input; drain stdout and stderr concurrently.
|
|
27
|
+
|
|
28
|
+
Safe cleanup pattern:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
moredrive rm /tmp/agent-run --recursive --yes --json
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Recovery hints:
|
|
35
|
+
|
|
36
|
+
| `error.code` | Suggested action |
|
|
37
|
+
| --- | --- |
|
|
38
|
+
| `auth-required`, `auth-expired` | Ask user to log in or provide `MOREDRIVE_TOKEN`. |
|
|
39
|
+
| `not-found` | Re-list parent directory, then retry with the exact path. |
|
|
40
|
+
| `conflict` | Verify the local or remote target and obtain any missing replacement/destination-change authorization. |
|
|
41
|
+
| `invalid-argument` | Fix command arguments; do not retry unchanged. |
|
|
42
|
+
| `network-timeout`, `network-unreachable`, `upstream-error` | Retry with bounded backoff only when `error.retriable` is true; preserve the operation's recovery key. |
|
|
43
|
+
| `operation-submit-ambiguous` | Retry only the same intent with its reported idempotency key. |
|
|
44
|
+
| `unsupported` | Inspect the reason: direct-transfer capability, media decoder or file identity may be unavailable. |
|
|
45
|
+
|
|
46
|
+
Large outputs:
|
|
47
|
+
|
|
48
|
+
- `read` defaults to 1 MB.
|
|
49
|
+
- `write` defaults to 10 MB stdin limit.
|
|
50
|
+
- Use `download` for binary or large files.
|
|
51
|
+
|
|
52
|
+
Security:
|
|
53
|
+
|
|
54
|
+
- Never log `--token`, `MOREDRIVE_TOKEN`, share token, or raw dlink.
|
|
55
|
+
- Prefer `link` without `--raw`.
|
|
56
|
+
- Treat `link --raw`, `share access` token output and the `stream` session URL as sensitive output.
|
|
57
|
+
|
|
58
|
+
Saved profiles support automatic session refresh; explicit token/base-URL overrides disable profile refresh for that invocation. App tokens use argv > environment > profile precedence, while password and share-token input sources are mutually exclusive. See [authentication](./commands.md#auth) for details.
|
|
59
|
+
|
|
60
|
+
Use the command guide for [transfer limits](./commands.md#transfer-limits), [local playback](./commands.md#local-player-streaming), and explicit media conversion/thumbnail generation. A generated thumbnail pack remains local until separately uploaded. Ordinary transfers preserve file bytes.
|