anywhere-ai 0.0.20 → 0.0.22

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/cli.js +24 -25
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -8,10 +8,10 @@ import path from "path";
8
8
  import crypto from "crypto";
9
9
  import { spawn, spawnSync, execSync } from "child_process";
10
10
  import readline from "readline";
11
- import qrcode from "qrcode-terminal";
11
+ import qrcode from "qrcode";
12
12
  var args = process.argv.slice(2);
13
13
  if (args.includes("--version") || args.includes("-v")) {
14
- console.log(`anywhere-ai v${"0.0.20"}`);
14
+ console.log(`anywhere-ai v${"0.0.22"}`);
15
15
  process.exit(0);
16
16
  }
17
17
  function ask(question, preserveCase = false) {
@@ -173,7 +173,7 @@ var isVPS = publicIP && localIP && publicIP !== localIP;
173
173
  await import("./server-SPM3PZ5G.js");
174
174
  var tunnelURL = null;
175
175
  var tunnelProcess = null;
176
- function printBanner(serverURL2) {
176
+ async function printBanner(serverURL2, localURL2) {
177
177
  const qrData = `${serverURL2}#${config.authToken}`;
178
178
  console.log(`
179
179
  ____ ____ ____ ____ ____ ____ ____ ____
@@ -182,23 +182,28 @@ function printBanner(serverURL2) {
182
182
  |/__\\|/__\\|/__\\|/__\\|/__\\|/__\\|/__\\|/__\\|
183
183
  `);
184
184
  console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
185
- console.log(" Server URL: " + serverURL2);
186
- console.log(" Auth Token: " + config.authToken);
185
+ console.log(" Tunnel: " + serverURL2);
186
+ if (localURL2 && localURL2 !== serverURL2) {
187
+ console.log(" Direct: " + localURL2);
188
+ }
189
+ console.log(" Token: " + config.authToken);
187
190
  console.log("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500");
188
191
  console.log();
189
192
  console.log(" Scan this QR code in the Anywhere app:");
190
193
  console.log();
191
- qrcode.generate(qrData, { small: true }, (code) => {
192
- for (const line of code.split("\n")) {
193
- console.log(" " + line);
194
- }
195
- console.log();
196
- console.log(" Or enter the URL and token manually in Settings.");
197
- if (isVPS) {
198
- console.log(" Make sure port " + port + " is open in your firewall.");
199
- }
200
- console.log();
201
- });
194
+ const code = await qrcode.toString(qrData, { type: "terminal", errorCorrectionLevel: "L", small: true });
195
+ for (const line of code.split("\n")) {
196
+ console.log(" " + line);
197
+ }
198
+ console.log();
199
+ console.log(" Or enter the URL and token manually in Settings.");
200
+ if (localURL2 && localURL2 !== serverURL2) {
201
+ console.log(" Tunnel URL changes on restart. Direct URL stays the same.");
202
+ }
203
+ if (isVPS) {
204
+ console.log(" Make sure port " + port + " is open in your firewall.");
205
+ }
206
+ console.log();
202
207
  }
203
208
  if (!args.includes("--no-tunnel")) {
204
209
  let cloudflaredBin = null;
@@ -249,15 +254,9 @@ if (!args.includes("--no-tunnel")) {
249
254
  }
250
255
  }
251
256
  }
252
- var serverURL;
253
- if (tunnelURL) {
254
- serverURL = tunnelURL;
255
- } else if (isVPS) {
256
- serverURL = "http://" + publicIP + ":" + port;
257
- } else {
258
- serverURL = "http://" + (localIP || "localhost") + ":" + port;
259
- }
260
- printBanner(serverURL);
257
+ var localURL = isVPS ? "http://" + publicIP + ":" + port : "http://" + (localIP || "localhost") + ":" + port;
258
+ var serverURL = tunnelURL || localURL;
259
+ await printBanner(serverURL, localURL);
261
260
  function cleanup() {
262
261
  if (tunnelProcess) {
263
262
  tunnelProcess.kill();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anywhere-ai",
3
- "version": "0.0.20",
3
+ "version": "0.0.22",
4
4
  "type": "module",
5
5
  "description": "Code on any repo from your phone",
6
6
  "bin": {
@@ -23,7 +23,7 @@
23
23
  "@hono/node-server": "^1.19.11",
24
24
  "dotenv": "^17.3.1",
25
25
  "hono": "^4.12.5",
26
- "qrcode-terminal": "^0.12.0"
26
+ "qrcode": "^1.5.4"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^25.3.3",