memex-cli 1.0.1
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/bin.js +59 -0
- package/package.json +33 -0
package/bin.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const { join } = require("path");
|
|
5
|
+
|
|
6
|
+
const PLATFORMS = {
|
|
7
|
+
"darwin-arm64": "@memex-cli/darwin-arm64",
|
|
8
|
+
"darwin-x64": "@memex-cli/darwin-x64",
|
|
9
|
+
"linux-x64": "@memex-cli/linux-x64",
|
|
10
|
+
"win32-x64": "@memex-cli/win32-x64",
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function getPlatformPackage() {
|
|
14
|
+
const platform = process.platform;
|
|
15
|
+
const arch = process.arch;
|
|
16
|
+
const key = `${platform}-${arch}`;
|
|
17
|
+
|
|
18
|
+
const pkg = PLATFORMS[key];
|
|
19
|
+
if (!pkg) {
|
|
20
|
+
console.error(`Unsupported platform: ${key}`);
|
|
21
|
+
console.error(`Supported platforms: ${Object.keys(PLATFORMS).join(", ")}`);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
return pkg;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getBinaryPath() {
|
|
28
|
+
const pkg = getPlatformPackage();
|
|
29
|
+
const binaryName = process.platform === "win32" ? "memex-cli.exe" : "memex-cli";
|
|
30
|
+
|
|
31
|
+
try {
|
|
32
|
+
const pkgPath = require.resolve(`${pkg}/package.json`);
|
|
33
|
+
return join(pkgPath, "..", binaryName);
|
|
34
|
+
} catch (e) {
|
|
35
|
+
console.error(`Failed to find package ${pkg}`);
|
|
36
|
+
console.error("Please ensure the package is installed correctly.");
|
|
37
|
+
console.error("Try running: npm install -g memex-cli");
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function main() {
|
|
43
|
+
const binaryPath = getBinaryPath();
|
|
44
|
+
const args = process.argv.slice(2);
|
|
45
|
+
|
|
46
|
+
try {
|
|
47
|
+
execFileSync(binaryPath, args, {
|
|
48
|
+
stdio: "inherit",
|
|
49
|
+
env: process.env,
|
|
50
|
+
});
|
|
51
|
+
} catch (e) {
|
|
52
|
+
if (e.status !== undefined) {
|
|
53
|
+
process.exit(e.status);
|
|
54
|
+
}
|
|
55
|
+
throw e;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
main();
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "memex-cli",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "CLI shell wrapper with memory, replay, and resume capabilities",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/chaorenex/memex-cli.git"
|
|
8
|
+
},
|
|
9
|
+
"license": "Apache-2.0",
|
|
10
|
+
"author": "chaorenex1",
|
|
11
|
+
"bin": {
|
|
12
|
+
"memex-cli": "bin.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin.js"
|
|
16
|
+
],
|
|
17
|
+
"optionalDependencies": {
|
|
18
|
+
"@memex-cli/darwin-arm64": "1.0.1",
|
|
19
|
+
"@memex-cli/darwin-x64": "1.0.1",
|
|
20
|
+
"@memex-cli/linux-x64": "1.0.1",
|
|
21
|
+
"@memex-cli/win32-x64": "1.0.1"
|
|
22
|
+
},
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": ">=14"
|
|
25
|
+
},
|
|
26
|
+
"keywords": [
|
|
27
|
+
"cli",
|
|
28
|
+
"memex",
|
|
29
|
+
"memory",
|
|
30
|
+
"replay",
|
|
31
|
+
"resume"
|
|
32
|
+
]
|
|
33
|
+
}
|