mobygate 0.5.1 → 0.5.2

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/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ All notable changes to mobygate are documented here. Format loosely follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); version numbers are
5
5
  [Semantic Versioning](https://semver.org/).
6
6
 
7
+ ## [0.5.2] — 2026-04-19
8
+
9
+ ### Added
10
+
11
+ - **`mobygate init` auto-opens the dashboard** in the user's default
12
+ browser after the smoke test passes. Closes the last "copy this
13
+ URL to your browser" step of the install flow. Opt out with
14
+ `--no-browser` or `MOBYGATE_NO_BROWSER=1` for headless / CI /
15
+ nested-script contexts. Also auto-skipped when stdout isn't a TTY.
16
+ - macOS: `open`
17
+ - Linux: `xdg-open`
18
+ - Windows: `cmd /c start`
19
+ - Silent no-op if the OS call fails — init never errors out
20
+ because a browser couldn't launch.
21
+
7
22
  ## [0.5.1] — 2026-04-19
8
23
 
9
24
  ### Fixed
package/bin/mobygate.js CHANGED
@@ -35,7 +35,7 @@ import {
35
35
  installLinuxServices, uninstallLinuxServices,
36
36
  queryLinuxUnit, startLinuxUnit, stopLinuxUnit, LINUX_UNITS,
37
37
  nonMacInstallInstructions,
38
- cleanupLegacyServices, killPort,
38
+ cleanupLegacyServices, killPort, openBrowser,
39
39
  } from '../lib/platform.js';
40
40
  import { getAuthStatus, forceRefresh } from '../scripts/auth-helper.js';
41
41
  import { banner, compactBanner } from '../lib/ascii.js';
@@ -287,6 +287,17 @@ async function cmdInit() {
287
287
  print(`Dashboard: ${c.cyan(`http://localhost:${port}`)}`);
288
288
  print(`Configure: ${c.cyan(CONFIG_PATH)}`);
289
289
  print(`Try: ${c.cyan('mobygate status')} | ${c.cyan('mobygate logs')} | ${c.cyan('mobygate auth')}`);
290
+
291
+ // Auto-open the dashboard unless explicitly suppressed (headless / CI /
292
+ // nested scripts). Silent no-op if the OS call fails — we never want init
293
+ // to error out because a browser couldn't launch.
294
+ const noBrowser = process.argv.includes('--no-browser')
295
+ || process.env.MOBYGATE_NO_BROWSER === '1'
296
+ || !process.stdout.isTTY;
297
+ if (!noBrowser) {
298
+ const opened = openBrowser(`http://localhost:${port}`);
299
+ if (opened) print(c.dim(`\nOpening dashboard in your browser…`));
300
+ }
290
301
  }
291
302
 
292
303
  function cmdStart() {
@@ -605,7 +616,8 @@ function usage() {
605
616
  print(`mobygate — OpenAI → Claude Max local gateway
606
617
 
607
618
  Usage:
608
- mobygate init Interactive setup (add --yes to skip prompts)
619
+ mobygate init Interactive setup (add --yes to skip prompts,
620
+ --no-browser to not auto-open the dashboard)
609
621
  mobygate update Upgrade to the latest version + restart service
610
622
  mobygate doctor Diagnose version mismatches, zombie services, port conflicts
611
623
  mobygate start Start the proxy service
package/lib/platform.js CHANGED
@@ -401,6 +401,24 @@ export function cleanupLegacyServices() {
401
401
  * Kill whatever currently owns the given port. Best-effort across platforms.
402
402
  * Returns the list of PIDs killed (empty if nothing was bound).
403
403
  */
404
+ /**
405
+ * Open a URL in the user's default browser. No-op on failure — we never
406
+ * want an init to error out because a browser couldn't launch.
407
+ * - macOS: `open <url>`
408
+ * - Linux: `xdg-open <url>` (falls back to sensible-browser)
409
+ * - Windows: `cmd /c start "" <url>`
410
+ */
411
+ export function openBrowser(url) {
412
+ try {
413
+ if (IS_MAC) spawnSync('open', [url], { stdio: 'ignore', detached: true });
414
+ else if (IS_LINUX) spawnSync('xdg-open', [url], { stdio: 'ignore', detached: true });
415
+ else if (IS_WIN) spawnSync('cmd', ['/c', 'start', '""', url], { stdio: 'ignore', detached: true, windowsHide: true });
416
+ return true;
417
+ } catch {
418
+ return false;
419
+ }
420
+ }
421
+
404
422
  export function killPort(port) {
405
423
  const killed = [];
406
424
  if (IS_MAC || IS_LINUX) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobygate",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "OpenAI-compatible local proxy for Claude Max. The Möbius-strip gateway: OpenAI shape in, Claude Max out.",
5
5
  "type": "module",
6
6
  "main": "server.js",