@rehpic/vcli 0.1.0-beta.38.1 → 0.1.0-beta.39.1

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/dist/index.js CHANGED
@@ -3536,9 +3536,26 @@ serviceCommand.command("install").description("Install the bridge as a system se
3536
3536
  console.error("On Linux, use systemd --user manually for now.");
3537
3537
  return;
3538
3538
  }
3539
+ let config = loadBridgeConfig();
3540
+ if (!config) {
3541
+ const runtime = await getRuntime(command);
3542
+ const session = requireSession(runtime);
3543
+ const client = await createConvexClient(
3544
+ session,
3545
+ runtime.appUrl,
3546
+ runtime.convexUrl
3547
+ );
3548
+ const user = await runQuery(client, api.users.currentUser);
3549
+ if (!user) throw new Error("Not logged in. Run `vcli auth login` first.");
3550
+ config = await setupBridgeDevice(runtime.convexUrl, user._id);
3551
+ console.log(
3552
+ `Device registered: ${config.displayName} (${config.deviceId})`
3553
+ );
3554
+ }
3539
3555
  const vcliPath = process.argv[1] ?? "vcli";
3540
3556
  installLaunchAgent(vcliPath);
3541
3557
  loadLaunchAgent();
3558
+ console.log("Bridge is now running and will start automatically on login.");
3542
3559
  });
3543
3560
  serviceCommand.command("uninstall").description("Uninstall the bridge system service").action(() => {
3544
3561
  uninstallLaunchAgent();