@snowrabbit/cli 0.0.0-stage → 1.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.
package/README.md CHANGED
@@ -1,3 +1,11 @@
1
- # Temporary Holding Version
1
+ # SnowRabbit CLI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Connect this computer to your SnowRabbit workspace, then work with your agents from a phone, a laptop or any browser at https://app.snowrabbit.co. Your files never leave your machine.
4
+
5
+ ```sh
6
+ npm i -g @snowrabbit/cli
7
+ snowrabbit login
8
+ snowrabbit session run
9
+ ```
10
+
11
+ `snowrabbit login` shows a code to approve in your browser. Windows, macOS (Apple silicon and Intel) and Linux (x64 and arm64). Prefer an app? Download SnowRabbit for desktop at https://snowrabbit.co/download.
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+ // snowrabbit — the npm entry point. It runs the Go binary for this computer:
3
+ //
4
+ // 1. the platform package npm installed beside @snowrabbit/cli
5
+ // (@snowrabbit/cli-<platform>-<arch>, holding bin/snowrabbit and
6
+ // bin/agentd/snowrabbit-agentd — the CLI finds the agentd beside itself);
7
+ // 2. otherwise a local dev build at ../dist/snowrabbit (make cli).
8
+ //
9
+ // Arguments, stdio and the exit code pass straight through.
10
+
11
+ import { spawn } from "node:child_process";
12
+ import { existsSync } from "node:fs";
13
+ import { createRequire } from "node:module";
14
+ import { arch, platform } from "node:process";
15
+ import { dirname, join } from "node:path";
16
+ import { fileURLToPath } from "node:url";
17
+
18
+ const ext = platform === "win32" ? ".exe" : "";
19
+ const pkg = `@snowrabbit/cli-${platform}-${arch}`;
20
+ const SUPPORTED = ["win32-x64", "darwin-arm64", "darwin-x64", "linux-x64", "linux-arm64"];
21
+
22
+ function platformBinary() {
23
+ try {
24
+ const require = createRequire(import.meta.url);
25
+ const dir = dirname(require.resolve(`${pkg}/package.json`));
26
+ const bin = join(dir, "bin", `snowrabbit${ext}`);
27
+ return existsSync(bin) ? bin : null;
28
+ } catch {
29
+ return null;
30
+ }
31
+ }
32
+
33
+ function devBinary() {
34
+ const bin = join(dirname(fileURLToPath(import.meta.url)), "..", "dist", `snowrabbit${ext}`);
35
+ return existsSync(bin) ? bin : null;
36
+ }
37
+
38
+ const binary = platformBinary() ?? devBinary();
39
+ if (!binary) {
40
+ const here = `${platform}-${arch}`;
41
+ console.error(
42
+ SUPPORTED.includes(here)
43
+ ? `snowrabbit: the ${pkg} package is missing. Reinstall with: npm i -g @snowrabbit/cli`
44
+ : `snowrabbit: ${here} isn't supported yet (supported: ${SUPPORTED.join(", ")}).`
45
+ );
46
+ process.exit(1);
47
+ }
48
+
49
+ const child = spawn(binary, process.argv.slice(2), { stdio: "inherit", env: process.env });
50
+ child.on("error", (err) => {
51
+ console.error(`snowrabbit: couldn't start ${binary}: ${err.message}`);
52
+ process.exit(1);
53
+ });
54
+ child.on("exit", (code, signal) => {
55
+ if (signal) {
56
+ process.kill(process.pid, signal);
57
+ return;
58
+ }
59
+ process.exit(code ?? 1);
60
+ });
package/package.json CHANGED
@@ -1,6 +1,25 @@
1
1
  {
2
2
  "name": "@snowrabbit/cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.0",
4
+ "license": "UNLICENSED",
5
+ "homepage": "https://snowrabbit.co",
6
+ "author": "SnowRabbit",
7
+ "description": "Connect this computer to your SnowRabbit workspace and work with your agents from anywhere.",
8
+ "type": "module",
9
+ "bin": {
10
+ "snowrabbit": "bin/snowrabbit.js"
11
+ },
12
+ "files": [
13
+ "bin/"
14
+ ],
15
+ "engines": {
16
+ "node": ">=18"
17
+ },
18
+ "optionalDependencies": {
19
+ "@snowrabbit/cli-win32-x64": "1.1.0",
20
+ "@snowrabbit/cli-darwin-arm64": "1.1.0",
21
+ "@snowrabbit/cli-darwin-x64": "1.1.0",
22
+ "@snowrabbit/cli-linux-x64": "1.1.0",
23
+ "@snowrabbit/cli-linux-arm64": "1.1.0"
24
+ }
25
+ }