@openfort/cli 0.1.6 → 0.1.7

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 +10 -3
  2. package/package.json +2 -1
package/dist/cli.js CHANGED
@@ -24,6 +24,7 @@ var CLI_CALLBACK_PORT = Number(process.env.OPENFORT_CLI_CALLBACK_PORT) || 8271;
24
24
  // src/commands/login.ts
25
25
  import { randomBytes } from "crypto";
26
26
  import { createServer } from "http";
27
+ import open from "open";
27
28
  import { z as z2 } from "incur";
28
29
 
29
30
  // src/env.ts
@@ -200,9 +201,15 @@ var loginConfig = {
200
201
  authUrl.searchParams.set("redirect_uri", redirectUri);
201
202
  authUrl.searchParams.set("state", state);
202
203
  if (!c.agent) {
203
- console.log("\nOpen this URL in your browser to log in:\n");
204
- console.log(` ${authUrl.toString()}
205
- `);
204
+ const url = authUrl.toString();
205
+ console.log(`
206
+ > Visit ${url}`);
207
+ try {
208
+ const browserProcess = await open(url);
209
+ browserProcess.on("error", () => {
210
+ });
211
+ } catch {
212
+ }
206
213
  console.log("Waiting for authentication...\n");
207
214
  }
208
215
  const { apiKey, publishableKey, projectId, project } = await waitForCallback(port, state);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfort/cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "Openfort CLI — manage wallets, policies, and transactions from the terminal.",
5
5
  "author": "Openfort (https://www.openfort.io)",
6
6
  "bugs": "https://github.com/openfort-xyz/cli/issues",
@@ -21,6 +21,7 @@
21
21
  "dependencies": {
22
22
  "@openfort/openfort-node": "^0.10.2",
23
23
  "incur": "^0.3.4",
24
+ "open": "^11.0.0",
24
25
  "viem": "^2.47.2"
25
26
  },
26
27
  "devDependencies": {