@rehpic/vcli 0.1.0-beta.38.1 → 0.1.0-beta.40.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 +24 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3536,9 +3536,33 @@ 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("");
|
|
3559
|
+
console.log("Bridge is now running and will start automatically on login.");
|
|
3560
|
+
console.log("");
|
|
3561
|
+
console.log("To start the service manually:");
|
|
3562
|
+
console.log(" vcli service start");
|
|
3563
|
+
console.log("");
|
|
3564
|
+
console.log("To check status:");
|
|
3565
|
+
console.log(" vcli service status");
|
|
3542
3566
|
});
|
|
3543
3567
|
serviceCommand.command("uninstall").description("Uninstall the bridge system service").action(() => {
|
|
3544
3568
|
uninstallLaunchAgent();
|