@openfort/cli 0.1.5 → 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 +14 -7
  2. package/package.json +3 -2
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);
@@ -1942,7 +1949,7 @@ sessions.command("create", {
1942
1949
  player: z9.string().optional().describe("Player ID (pla_...)"),
1943
1950
  account: z9.string().optional().describe("Account ID (acc_...)"),
1944
1951
  limit: z9.number().optional().describe("Max session uses"),
1945
- policy: z9.string().optional().describe("Policy ID (ply_...) for gas sponsorship"),
1952
+ policy: z9.string().optional().describe("Fee sponsorship ID (pol_...)"),
1946
1953
  whitelist: z9.string().optional().describe("Whitelisted contract addresses as JSON array")
1947
1954
  }),
1948
1955
  examples: [
@@ -2023,7 +2030,7 @@ sessions.command("revoke", {
2023
2030
  address: z9.string().describe("Session key address to revoke"),
2024
2031
  chainId: z9.number().describe("Chain ID"),
2025
2032
  player: z9.string().optional().describe("Player ID (pla_...)"),
2026
- policy: z9.string().optional().describe("Policy ID (ply_...) for gas sponsorship")
2033
+ policy: z9.string().optional().describe("Fee sponsorship ID (pol_...)")
2027
2034
  }),
2028
2035
  examples: [
2029
2036
  { options: { address: "0x1234...", chainId: 137 }, description: "Revoke a session key" }
@@ -2158,7 +2165,7 @@ transactions.command("create", {
2158
2165
  account: z10.string().describe("Account ID (acc_...)"),
2159
2166
  chainId: z10.number().describe("Chain ID"),
2160
2167
  interactions: z10.string().describe('Interactions as JSON: [{"to":"0x...","data":"0x...","value":"0"}]'),
2161
- policy: z10.string().optional().describe("Policy ID (ply_...) for gas sponsorship"),
2168
+ policy: z10.string().optional().describe("Fee sponsorship ID (pol_...)."),
2162
2169
  signedAuthorization: z10.string().optional().describe("Signed EIP-7702 authorization hex (for delegated accounts)")
2163
2170
  }),
2164
2171
  output: transactionIntentItem,
@@ -2285,7 +2292,7 @@ transactions.command("estimate", {
2285
2292
  account: z10.string().describe("Account ID (acc_...)"),
2286
2293
  chainId: z10.number().describe("Chain ID"),
2287
2294
  interactions: z10.string().describe("Interactions as JSON"),
2288
- policy: z10.string().optional().describe("Fee sponsorship ID (pol_...) for gas sponsorship")
2295
+ policy: z10.string().optional().describe("Fee sponsorship ID (pol_...)")
2289
2296
  }),
2290
2297
  examples: [
2291
2298
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openfort/cli",
3
- "version": "0.1.5",
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",
@@ -20,7 +20,8 @@
20
20
  "main": "./dist/cli.js",
21
21
  "dependencies": {
22
22
  "@openfort/openfort-node": "^0.10.2",
23
- "incur": "^0.3.2",
23
+ "incur": "^0.3.4",
24
+ "open": "^11.0.0",
24
25
  "viem": "^2.47.2"
25
26
  },
26
27
  "devDependencies": {