@openfort/cli 0.1.2 → 0.1.4
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/bin.js +2 -1
- package/dist/{chunk-SZO4OB6U.js → chunk-QJGHQ7ID.js} +2 -0
- package/dist/cli.js +34 -38
- package/package.json +4 -3
package/dist/bin.js
CHANGED
package/dist/cli.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import {
|
|
2
3
|
CREDENTIALS_PATH,
|
|
3
4
|
ensureConfigDir
|
|
4
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-QJGHQ7ID.js";
|
|
5
6
|
|
|
6
7
|
// src/cli.ts
|
|
7
|
-
import { Cli as
|
|
8
|
+
import { Cli as Cli13, z as z15, Errors as Errors4 } from "incur";
|
|
8
9
|
import Openfort from "@openfort/openfort-node";
|
|
9
10
|
|
|
10
11
|
// src/vars.ts
|
|
@@ -396,35 +397,6 @@ evm.command("get", {
|
|
|
396
397
|
});
|
|
397
398
|
}
|
|
398
399
|
});
|
|
399
|
-
evm.command("sign", {
|
|
400
|
-
description: "Sign data with an EVM backend wallet.",
|
|
401
|
-
args: z3.object({
|
|
402
|
-
id: z3.string().describe("Account ID (acc_...)")
|
|
403
|
-
}),
|
|
404
|
-
options: z3.object({
|
|
405
|
-
data: z3.string().describe("Data to sign (hex-encoded)")
|
|
406
|
-
}),
|
|
407
|
-
alias: { data: "d" },
|
|
408
|
-
output: z3.object({
|
|
409
|
-
account: z3.string(),
|
|
410
|
-
signature: z3.string()
|
|
411
|
-
}),
|
|
412
|
-
examples: [
|
|
413
|
-
{
|
|
414
|
-
args: { id: "acc_abc123" },
|
|
415
|
-
options: { data: "0x1234abcd" },
|
|
416
|
-
description: "Sign a message hash with a backend wallet"
|
|
417
|
-
}
|
|
418
|
-
],
|
|
419
|
-
async run(c) {
|
|
420
|
-
requireWalletCredentials();
|
|
421
|
-
const signature = await c.var.openfort.accounts.evm.backend.sign({
|
|
422
|
-
id: c.args.id,
|
|
423
|
-
data: c.options.data
|
|
424
|
-
});
|
|
425
|
-
return c.ok({ account: c.args.id, signature });
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
400
|
evm.command("delete", {
|
|
429
401
|
description: "Delete an EVM backend wallet.",
|
|
430
402
|
args: z3.object({
|
|
@@ -2834,16 +2806,40 @@ ${publicKey}
|
|
|
2834
2806
|
}
|
|
2835
2807
|
});
|
|
2836
2808
|
|
|
2809
|
+
// src/commands/message.ts
|
|
2810
|
+
import { Cli as Cli12, z as z14 } from "incur";
|
|
2811
|
+
import { keccak256, toBytes } from "viem";
|
|
2812
|
+
var message = Cli12.create("message", {
|
|
2813
|
+
description: "Message utilities.",
|
|
2814
|
+
vars: varsSchema
|
|
2815
|
+
});
|
|
2816
|
+
message.command("hash", {
|
|
2817
|
+
description: "Hash a message using keccak256.",
|
|
2818
|
+
args: z14.object({
|
|
2819
|
+
message: z14.string().describe("The message to hash")
|
|
2820
|
+
}),
|
|
2821
|
+
examples: [
|
|
2822
|
+
{ args: { message: "Hello World" }, description: "Hash a message" }
|
|
2823
|
+
],
|
|
2824
|
+
output: z14.object({
|
|
2825
|
+
hash: z14.string()
|
|
2826
|
+
}),
|
|
2827
|
+
async run(c) {
|
|
2828
|
+
const hash = keccak256(toBytes(c.args.message));
|
|
2829
|
+
return c.ok({ hash });
|
|
2830
|
+
}
|
|
2831
|
+
});
|
|
2832
|
+
|
|
2837
2833
|
// src/cli.ts
|
|
2838
|
-
var cli =
|
|
2834
|
+
var cli = Cli13.create("openfort", {
|
|
2839
2835
|
version: "0.1.0",
|
|
2840
2836
|
description: "Openfort CLI \u2014 manage wallets, policies, and transactions. If you are LLM read this doc first https://www.openfort.io/docs/overview/building-with-cli",
|
|
2841
2837
|
vars: varsSchema,
|
|
2842
|
-
env:
|
|
2843
|
-
OPENFORT_API_KEY:
|
|
2844
|
-
OPENFORT_WALLET_SECRET:
|
|
2845
|
-
OPENFORT_PUBLISHABLE_KEY:
|
|
2846
|
-
OPENFORT_BASE_URL:
|
|
2838
|
+
env: z15.object({
|
|
2839
|
+
OPENFORT_API_KEY: z15.string().optional().describe("Openfort secret API key (sk_test_... or sk_live_...)"),
|
|
2840
|
+
OPENFORT_WALLET_SECRET: z15.string().optional().describe("Wallet encryption secret"),
|
|
2841
|
+
OPENFORT_PUBLISHABLE_KEY: z15.string().optional().describe("Publishable key for client-side ops"),
|
|
2842
|
+
OPENFORT_BASE_URL: z15.string().optional().describe("Custom API base URL")
|
|
2847
2843
|
}),
|
|
2848
2844
|
sync: {
|
|
2849
2845
|
depth: 2,
|
|
@@ -2879,7 +2875,7 @@ cli.use(async (c, next) => {
|
|
|
2879
2875
|
}));
|
|
2880
2876
|
await next();
|
|
2881
2877
|
});
|
|
2882
|
-
cli.command(accounts).command(contracts).command(paymasters).command(policies).command(shield).command(sponsorship).command(sessions).command(subscriptions).command(transactions).command(users).command(walletKeys);
|
|
2878
|
+
cli.command(accounts).command(contracts).command(paymasters).command(policies).command(shield).command(sponsorship).command(sessions).command(subscriptions).command(transactions).command(users).command(walletKeys).command(message);
|
|
2883
2879
|
var cli_default = cli;
|
|
2884
2880
|
export {
|
|
2885
2881
|
cli_default as default
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfort/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
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",
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"main": "./dist/cli.js",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@openfort/openfort-node": "^0.10.2",
|
|
20
|
-
"incur": "^0.3.2"
|
|
20
|
+
"incur": "^0.3.2",
|
|
21
|
+
"viem": "^2.47.2"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@changesets/changelog-github": "^0.5.1",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
},
|
|
30
31
|
"scripts": {
|
|
31
32
|
"dev": "node --import tsx src/bin.ts",
|
|
32
|
-
"build": "tsup
|
|
33
|
+
"build": "tsup",
|
|
33
34
|
"openfort": "node --import tsx src/bin.ts",
|
|
34
35
|
"skills": "pnpm openfort skills add",
|
|
35
36
|
"changeset": "changeset",
|