@easybits.cloud/cli 0.2.0 → 0.3.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/dist/index.js +37 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -329,6 +329,33 @@ Falta, una sola vez:
329
329
 
330
330
  Desde ah\xED, cada push a main despliega.`);
331
331
  }
332
+ async function sshProxy() {
333
+ const target = process.argv[3];
334
+ if (!target) {
335
+ console.error("uso: easybits ssh-proxy <sandboxId|caja.ghosty>");
336
+ process.exit(2);
337
+ }
338
+ const sandboxId = target.split(".")[0];
339
+ const eb = await createClientFromEnv();
340
+ const sb = await eb.sandboxes.get(sandboxId);
341
+ const { url } = await sb.sshTicket();
342
+ const ws = new WebSocket(url);
343
+ ws.binaryType = "arraybuffer";
344
+ ws.onerror = () => {
345
+ console.error("easybits ssh-proxy: no se pudo abrir el t\xFAnel");
346
+ process.exit(1);
347
+ };
348
+ ws.onclose = () => process.exit(0);
349
+ ws.onmessage = (ev) => {
350
+ const data = ev.data;
351
+ process.stdout.write(
352
+ typeof data === "string" ? Buffer.from(data) : Buffer.from(data)
353
+ );
354
+ };
355
+ await new Promise((resolve) => ws.onopen = () => resolve());
356
+ process.stdin.on("data", (chunk) => ws.send(chunk));
357
+ process.stdin.on("end", () => ws.close());
358
+ }
332
359
  var [cmd, sub] = [process.argv[2], process.argv[3]];
333
360
  switch (cmd) {
334
361
  case "login":
@@ -352,6 +379,9 @@ switch (cmd) {
352
379
  case "mcp":
353
380
  printMcpStdioConfig();
354
381
  break;
382
+ case "ssh-proxy":
383
+ sshProxy();
384
+ break;
355
385
  case "help":
356
386
  case void 0:
357
387
  console.log(`easybits CLI \u2014 @easybits.cloud/cli
@@ -365,7 +395,13 @@ Commands:
365
395
  files delete <id> Delete a file
366
396
  providers list Show storage providers
367
397
  config Print MCP config JSON (streamable HTTP)
368
- mcp Print MCP stdio config JSON`);
398
+ mcp Print MCP stdio config JSON
399
+ ssh-proxy <id> SSH tunnel over 443 (use as ssh ProxyCommand)
400
+
401
+ SSH to a box \u2014 add to ~/.ssh/config:
402
+ Host *.ghosty
403
+ ProxyCommand easybits ssh-proxy %h
404
+ User root`);
369
405
  break;
370
406
  default:
371
407
  console.error(`Unknown command: ${cmd}. Run 'easybits help'`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easybits.cloud/cli",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Official CLI for Easybits \u2014 manage files, storage, and MCP from your terminal",
5
5
  "type": "module",
6
6
  "bin": {
@@ -31,7 +31,7 @@
31
31
  "access": "public"
32
32
  },
33
33
  "dependencies": {
34
- "@easybits.cloud/sdk": "^0.28.0"
34
+ "@easybits.cloud/sdk": "^0.30.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "tsup": "^8.0.0",