@usehoplite/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 (2) hide show
  1. package/bin/hoplite-cli.js +31 -0
  2. package/package.json +23 -0
@@ -0,0 +1,31 @@
1
+ #!/usr/bin/env node
2
+ // Launcher shim. The actual CLI is a Go binary shipped in a per-platform
3
+ // optional dependency (@usehoplite/cli-<platform>-<arch>); npm installs only the
4
+ // one matching this machine. We resolve it and exec it, passing args through.
5
+ "use strict";
6
+
7
+ const { spawnSync } = require("node:child_process");
8
+
9
+ const platform = process.platform; // darwin | linux | win32
10
+ const arch = process.arch; // x64 | arm64
11
+ const pkg = `@usehoplite/cli-${platform}-${arch}`;
12
+ const binName = platform === "win32" ? "hoplite-cli.exe" : "hoplite-cli";
13
+
14
+ let binPath;
15
+ try {
16
+ binPath = require.resolve(`${pkg}/bin/${binName}`);
17
+ } catch {
18
+ console.error(
19
+ `hoplite-cli: no prebuilt binary for ${platform}-${arch}.\n` +
20
+ `The optional dependency ${pkg} did not install — check your npm/pnpm\n` +
21
+ `optional-dependency settings, or build from source.`,
22
+ );
23
+ process.exit(1);
24
+ }
25
+
26
+ const result = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
27
+ if (result.error) {
28
+ console.error(`hoplite-cli: ${result.error.message}`);
29
+ process.exit(1);
30
+ }
31
+ process.exit(result.status === null ? 1 : result.status);
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@usehoplite/cli",
3
+ "version": "0.1.0",
4
+ "description": "Hoplite onboarding CLI — import your local Claude Code / Codex / OpenCode history into Hoplite. Run `npx -y @usehoplite/cli onboard`.",
5
+ "bin": {
6
+ "hoplite-cli": "bin/hoplite-cli.js"
7
+ },
8
+ "files": [
9
+ "bin/"
10
+ ],
11
+ "optionalDependencies": {
12
+ "@usehoplite/cli-darwin-arm64": "0.1.0",
13
+ "@usehoplite/cli-darwin-x64": "0.1.0",
14
+ "@usehoplite/cli-linux-arm64": "0.1.0",
15
+ "@usehoplite/cli-linux-x64": "0.1.0",
16
+ "@usehoplite/cli-win32-arm64": "0.1.0",
17
+ "@usehoplite/cli-win32-x64": "0.1.0"
18
+ },
19
+ "engines": {
20
+ "node": ">=18"
21
+ },
22
+ "license": "UNLICENSED"
23
+ }