@hasna/sandboxes 0.1.27 → 0.1.29

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
@@ -17,6 +17,29 @@ npm install -g @hasna/sandboxes
17
17
  sandboxes --help
18
18
  ```
19
19
 
20
+ ## SDK One-shot Commands
21
+
22
+ Use the SDK to create a sandbox, upload a local project, run a command, and clean up:
23
+
24
+ ```ts
25
+ import { createSandboxesSDK } from "@hasna/sandboxes";
26
+
27
+ const sandboxes = createSandboxesSDK();
28
+
29
+ await sandboxes.runCommandInSandbox({
30
+ provider: "e2b",
31
+ command: "bun test",
32
+ upload: {
33
+ localDir: process.cwd(),
34
+ remoteDir: "/workspace/app",
35
+ syncStrategy: "rsync",
36
+ },
37
+ cleanup: "delete",
38
+ });
39
+ ```
40
+
41
+ Set `E2B_API_KEY` for E2B-backed runs. `syncStrategy: "rsync"` mirrors the local directory into a temporary staging tree with `rsync` before uploading it through the provider file APIs.
42
+
20
43
  ## MCP Server
21
44
 
22
45
  ```bash
@@ -44,14 +67,19 @@ sandboxes-serve
44
67
 
45
68
  ## Cloud Sync
46
69
 
47
- This package supports cloud sync via `@hasna/cloud`:
70
+ Cloud sync is optional. By default sandboxes use local SQLite at `~/.hasna/sandboxes/`.
48
71
 
49
72
  ```bash
50
- cloud setup
51
- cloud sync push --service sandboxes
52
- cloud sync pull --service sandboxes
73
+ sandboxes cloud status
74
+ sandboxes cloud push
75
+ sandboxes cloud pull
76
+ sandboxes cloud sync
53
77
  ```
54
78
 
79
+ Set `HASNA_SANDBOXES_CLOUD_DATABASE_URL` or configure
80
+ `~/.hasna/sandboxes/cloud/config.json` to run in hybrid/cloud mode with
81
+ PostgreSQL.
82
+
55
83
  ## Data Directory
56
84
 
57
85
  Data is stored in `~/.hasna/sandboxes/`.
@@ -0,0 +1,2 @@
1
+ import type { Command } from "commander";
2
+ export declare function registerCloudCommands(program: Command): void;