@fslong520/1memory-cli 0.1.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.
Files changed (3) hide show
  1. package/README.md +32 -0
  2. package/bin/cli.js +35 -0
  3. package/package.json +23 -0
package/README.md ADDED
@@ -0,0 +1,32 @@
1
+ # @fslong520/1memory-cli
2
+
3
+ 1memory 记忆 CLI(Rust 二进制分发)——跨设备跨软件统一 AI 记忆系统,端到端加密,服务器只见密文。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ npm i -g @fslong520/1memory-cli
9
+ 1memory --help
10
+ ```
11
+
12
+ 安装即得 `1memory` 命令:npm 按平台自动装对应二进制子包(linux/mac/win,x64/arm64)。
13
+
14
+ ## 客户端引入
15
+
16
+ 1memory 桌面客户端安装/首次启动时,经本包装 CLI 到用户电脑:
17
+
18
+ ```bash
19
+ npx @fslong520/1memory-cli --version
20
+ ```
21
+
22
+ 客户端「账号与同步」页可检测并一键安装。
23
+
24
+ ## 命令面(纯记忆核心)
25
+
26
+ keygen / remember / recall / list / show / forget / attach / promote / demote / tree / retitle / import / defrag / reembed / sync / status
27
+
28
+ 登录鉴权、服务器、注入分发不在 CLI 内——由客户端(`client/`)与服务器(`service/`)负责。
29
+
30
+ ## 仓库
31
+
32
+ https://github.com/fslong520/1memory
package/bin/cli.js ADDED
@@ -0,0 +1,35 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+ // 1memory CLI npm 包装器:定位平台子包中的二进制并转发执行。
4
+ const { spawnSync } = require('child_process');
5
+
6
+ const PKGS = {
7
+ 'linux-x64': '@fslong520/1memory-cli-linux-x64',
8
+ 'linux-arm64': '@fslong520/1memory-cli-linux-arm64',
9
+ 'darwin-x64': '@fslong520/1memory-cli-darwin-x64',
10
+ 'darwin-arm64': '@fslong520/1memory-cli-darwin-arm64',
11
+ 'win32-x64': '@fslong520/1memory-cli-win32-x64',
12
+ };
13
+
14
+ const key = `${process.platform}-${process.arch}`;
15
+ const pkg = PKGS[key];
16
+ if (!pkg) {
17
+ console.error(`1memory: 暂不支持平台 ${key}(支持:${Object.keys(PKGS).join(' ')})`);
18
+ process.exit(1);
19
+ }
20
+
21
+ const exe = process.platform === 'win32' ? '1memory.exe' : '1memory';
22
+ let bin;
23
+ try {
24
+ bin = require.resolve(`${pkg}/bin/${exe}`);
25
+ } catch (e) {
26
+ console.error(`1memory: 平台二进制包 ${pkg} 未安装。修复:npm i -g ${pkg}`);
27
+ process.exit(1);
28
+ }
29
+
30
+ const r = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' });
31
+ if (r.error) {
32
+ console.error(`1memory: ${r.error.message}`);
33
+ process.exit(1);
34
+ }
35
+ process.exit(r.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@fslong520/1memory-cli",
3
+ "version": "0.1.0",
4
+ "description": "1memory 记忆 CLI — 跨设备跨软件统一 AI 记忆系统(纯记忆核心,二进制分发)",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/fslong520/1memory.git"
9
+ },
10
+ "bin": {
11
+ "1memory": "./bin/cli.js"
12
+ },
13
+ "files": [
14
+ "bin",
15
+ "README.md"
16
+ ],
17
+ "engines": {
18
+ "node": ">=16"
19
+ },
20
+ "optionalDependencies": {
21
+ "@fslong520/1memory-cli-linux-x64": "0.1.0"
22
+ }
23
+ }