@1memory/cli 0.2.20 → 0.2.41
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 +57 -6
- package/bin/cli.js +14 -9
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -1,13 +1,64 @@
|
|
|
1
1
|
# @1memory/cli
|
|
2
2
|
|
|
3
|
-
1memory CLI
|
|
3
|
+
1memory 记忆 CLI(Rust 二进制分发)——跨设备跨软件统一 AI 记忆系统,端到端加密,服务器只见密文。
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
## 安装
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm i -g @1memory/cli
|
|
9
|
+
1memory doctor # 首次自动安装 BGE 模型
|
|
7
10
|
1memory --help
|
|
8
|
-
1memory --version
|
|
9
11
|
```
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
安装即得 `1memory` 命令:npm/pnpm 按平台自动装对应二进制子包。也可用 `pnpm add -g @1memory/cli`。BGE 模型由 `1memory doctor` 自动安装(国内可先设 `ONEMEMORY_MIRROR=https://hf-mirror.com`)。
|
|
14
|
+
|
|
15
|
+
纯离线:`1memory keygen --pass <密码>`。要连服务器并自动同步:必须 CLI 登录——
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
1memory register --addr <url> --user U --pass P --super <超级密码>
|
|
19
|
+
1memory login --addr <url> --user U --pass P --super <超级密码> [--secret-key A3-…]
|
|
20
|
+
1memory sync
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`ONEMEMORY_MODEL_DIR` 自定义模型目录后,后续 remember 必须设为同一路径。
|
|
24
|
+
|
|
25
|
+
## 客户端引入
|
|
26
|
+
|
|
27
|
+
1memory 桌面客户端安装/首次启动时,经本包装 CLI 到用户电脑:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npx @1memory/cli --version
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
客户端「账号与同步」页可检测并一键安装。
|
|
34
|
+
|
|
35
|
+
## 命令面(纯记忆核心)
|
|
36
|
+
|
|
37
|
+
register / login / keygen / remember / recall / list / show / forget / attach / promote / demote / tree / retitle / import / defrag / reembed / sync / status / inject
|
|
38
|
+
|
|
39
|
+
CLI **可以登录**:`1memory register` / `1memory login` 写 `session.json`(addr/token),之后 `sync` 和写后自动同步才能连服务器。纯离线用 `keygen`。注入:`1memory inject --id codex|pi|…`。
|
|
40
|
+
|
|
41
|
+
## 语义检索模型(BGE)
|
|
42
|
+
|
|
43
|
+
CLI 语义检索用 bge-base-zh-v1.5(约 407MB ONNX,本地推理零网络)。必要文件只有 `tokenizer.json` 与 `onnx/model.onnx`。查找序:
|
|
44
|
+
1. `ONEMEMORY_MODEL_DIR`(一旦设置即独占,缺失不回退)
|
|
45
|
+
2. CLI 同目录 `models/bge-base-zh-v1.5/`(桌面随包)
|
|
46
|
+
3. 跨平台用户数据目录(Linux `~/.local/share/yishi/…`,Windows `%LOCALAPPDATA%\yishi\…`)
|
|
47
|
+
4. 旧目录 `~/.local/share/yishi/models/bge-base-zh-v1.5/`
|
|
48
|
+
5. `/usr/lib/1memory/models/bge-base-zh-v1.5/`(deb 随包位)
|
|
49
|
+
|
|
50
|
+
来源:Hugging Face `Xenova/bge-base-zh-v1.5`(revision `71e50dc531959f9e04ebf190ea25b00261a0a186`)。模型安装由 doctor 兜底:缺模型时跑 `1memory doctor` 自动下载安装;不会在 remember 时自动下载。
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
1memory doctor
|
|
54
|
+
# 国内镜像(只替换下载 host):先设环境变量
|
|
55
|
+
# ONEMEMORY_MIRROR=https://hf-mirror.com
|
|
56
|
+
# 自定义目录后,remember/recall/doctor 必须:
|
|
57
|
+
# ONEMEMORY_MODEL_DIR=<同一目录>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
无模型时 remember/recall 失败并提示跑 `1memory doctor`,不落记忆、不降级为空向量。
|
|
61
|
+
|
|
62
|
+
## 仓库
|
|
12
63
|
|
|
13
|
-
|
|
64
|
+
https://github.com/one-memory/1memory
|
package/bin/cli.js
CHANGED
|
@@ -4,20 +4,25 @@
|
|
|
4
4
|
const { spawnSync } = require('child_process');
|
|
5
5
|
|
|
6
6
|
const PKGS = {
|
|
7
|
-
'linux-x64': '@
|
|
8
|
-
'linux-arm64': '@
|
|
9
|
-
'darwin-
|
|
10
|
-
'
|
|
11
|
-
'win32-
|
|
12
|
-
'win32-arm64': '@fslong520/1memory-cli-win32-arm64',
|
|
13
|
-
'linux-arm': '@fslong520/1memory-cli-linux-arm',
|
|
14
|
-
'linux-loong64': '@fslong520/1memory-cli-linux-loong64',
|
|
7
|
+
'linux-x64': '@1memory/cli-linux-x64',
|
|
8
|
+
'linux-arm64': '@1memory/cli-linux-arm64',
|
|
9
|
+
'darwin-arm64': '@1memory/cli-darwin-arm64',
|
|
10
|
+
'win32-x64': '@1memory/cli-win32-x64',
|
|
11
|
+
'win32-arm64': '@1memory/cli-win32-arm64',
|
|
15
12
|
};
|
|
16
13
|
|
|
17
14
|
const key = `${process.platform}-${process.arch}`;
|
|
18
15
|
const pkg = PKGS[key];
|
|
19
16
|
if (!pkg) {
|
|
20
|
-
|
|
17
|
+
if (key === 'darwin-x64') {
|
|
18
|
+
console.error(
|
|
19
|
+
'1memory: 不再支持 Intel 芯片的 Mac。\n' +
|
|
20
|
+
' 请使用 Apple 芯片(arm64)的 Mac,或 Linux / Windows。\n' +
|
|
21
|
+
' 详见 https://github.com/one-memory/1memory#平台支持'
|
|
22
|
+
);
|
|
23
|
+
} else {
|
|
24
|
+
console.error(`1memory: 暂不支持平台 ${key}(支持:${Object.keys(PKGS).join(' ')})`);
|
|
25
|
+
}
|
|
21
26
|
process.exit(1);
|
|
22
27
|
}
|
|
23
28
|
|
package/package.json
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1memory/cli",
|
|
3
|
-
"version": "0.2.
|
|
4
|
-
"description": "1memory CLI — 跨设备跨软件统一 AI
|
|
3
|
+
"version": "0.2.41",
|
|
4
|
+
"description": "1memory 记忆 CLI — 跨设备跨软件统一 AI 记忆系统(纯记忆核心,二进制分发)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/one-memory/1memory.git"
|
|
9
9
|
},
|
|
10
10
|
"bin": {
|
|
11
|
-
"1memory": "bin/cli.js"
|
|
11
|
+
"1memory": "./bin/cli.js"
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
|
-
"bin
|
|
14
|
+
"bin",
|
|
15
15
|
"README.md"
|
|
16
16
|
],
|
|
17
17
|
"engines": {
|
|
18
18
|
"node": ">=16"
|
|
19
19
|
},
|
|
20
20
|
"optionalDependencies": {
|
|
21
|
-
"@
|
|
22
|
-
"@
|
|
23
|
-
"@
|
|
24
|
-
"@
|
|
21
|
+
"@1memory/cli-linux-x64": "0.2.41",
|
|
22
|
+
"@1memory/cli-linux-arm64": "0.2.41",
|
|
23
|
+
"@1memory/cli-darwin-arm64": "0.2.41",
|
|
24
|
+
"@1memory/cli-win32-x64": "0.2.41",
|
|
25
|
+
"@1memory/cli-win32-arm64": "0.2.41"
|
|
25
26
|
}
|
|
26
27
|
}
|