@1memory/cli 0.2.20
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 +13 -0
- package/bin/cli.js +38 -0
- package/package.json +26 -0
package/README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# @1memory/cli
|
|
2
|
+
|
|
3
|
+
1memory CLI 的官方 npm 入口,使用已发布的 0.2.20 平台二进制。
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install -g @1memory/cli
|
|
7
|
+
1memory --help
|
|
8
|
+
1memory --version
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
启动脚本取自 https://github.com/one-memory/1memory 的 `npm/bin/cli.js`,提交 `39120eda1b28c587d10731ca70007911a9bafff9`。
|
|
12
|
+
|
|
13
|
+
支持 macOS ARM64、Linux x64/ARM64、Windows x64。语义检索模型由 `doctor` 单独安装。
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
'win32-arm64': '@fslong520/1memory-cli-win32-arm64',
|
|
13
|
+
'linux-arm': '@fslong520/1memory-cli-linux-arm',
|
|
14
|
+
'linux-loong64': '@fslong520/1memory-cli-linux-loong64',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const key = `${process.platform}-${process.arch}`;
|
|
18
|
+
const pkg = PKGS[key];
|
|
19
|
+
if (!pkg) {
|
|
20
|
+
console.error(`1memory: 暂不支持平台 ${key}(支持:${Object.keys(PKGS).join(' ')})`);
|
|
21
|
+
process.exit(1);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const exe = process.platform === 'win32' ? '1memory.exe' : '1memory';
|
|
25
|
+
let bin;
|
|
26
|
+
try {
|
|
27
|
+
bin = require.resolve(`${pkg}/bin/${exe}`);
|
|
28
|
+
} catch (e) {
|
|
29
|
+
console.error(`1memory: 平台二进制包 ${pkg} 未安装。修复:npm i -g ${pkg}`);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const r = spawnSync(bin, process.argv.slice(2), { stdio: 'inherit' });
|
|
34
|
+
if (r.error) {
|
|
35
|
+
console.error(`1memory: ${r.error.message}`);
|
|
36
|
+
process.exit(1);
|
|
37
|
+
}
|
|
38
|
+
process.exit(r.status ?? 1);
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@1memory/cli",
|
|
3
|
+
"version": "0.2.20",
|
|
4
|
+
"description": "1memory CLI — 跨设备跨软件统一 AI 记忆系统",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/one-memory/1memory.git"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"1memory": "bin/cli.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin/cli.js",
|
|
15
|
+
"README.md"
|
|
16
|
+
],
|
|
17
|
+
"engines": {
|
|
18
|
+
"node": ">=16"
|
|
19
|
+
},
|
|
20
|
+
"optionalDependencies": {
|
|
21
|
+
"@fslong520/1memory-cli-linux-x64": "0.2.20",
|
|
22
|
+
"@fslong520/1memory-cli-win32-x64": "0.2.20",
|
|
23
|
+
"@fslong520/1memory-cli-linux-arm64": "0.2.20",
|
|
24
|
+
"@fslong520/1memory-cli-darwin-arm64": "0.2.20"
|
|
25
|
+
}
|
|
26
|
+
}
|