@clawcard/cli 3.0.21 → 3.0.22
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/package.json +1 -1
- package/src/commands/agent.js +22 -10
- package/src/commands/setup.js +27 -1
package/package.json
CHANGED
package/src/commands/agent.js
CHANGED
|
@@ -53,24 +53,36 @@ export async function agentInfoCmd(options) {
|
|
|
53
53
|
try {
|
|
54
54
|
wallet = await getWallet(me.keyId);
|
|
55
55
|
} catch {
|
|
56
|
-
// No wallet
|
|
56
|
+
// No wallet
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let identity = null;
|
|
60
|
+
try {
|
|
61
|
+
identity = await getOnChainIdentity(me.keyId);
|
|
62
|
+
} catch {
|
|
63
|
+
// No identity
|
|
57
64
|
}
|
|
58
65
|
|
|
59
66
|
console.log();
|
|
60
|
-
console.log(` Name:
|
|
61
|
-
console.log(` Email:
|
|
62
|
-
console.log(` Phone:
|
|
67
|
+
console.log(` Name: ${orange.bold(me.name || "unnamed")}`);
|
|
68
|
+
console.log(` Email: ${me.email || "-"}`);
|
|
69
|
+
console.log(` Phone: ${me.phone || "-"}`);
|
|
63
70
|
if (wallet) {
|
|
64
|
-
console.log(` Wallet:
|
|
65
|
-
console.log(` USDC:
|
|
71
|
+
console.log(` Wallet: ${orange(wallet.address)} ${chalk.dim("(Base)")}`);
|
|
72
|
+
console.log(` USDC: ${chalk.green(wallet.balanceUsdc + " USDC")}`);
|
|
66
73
|
if (wallet.balanceEth) {
|
|
67
|
-
console.log(` ETH:
|
|
74
|
+
console.log(` ETH: ${chalk.dim(wallet.balanceEth + " ETH (gas)")}`);
|
|
68
75
|
}
|
|
69
76
|
} else {
|
|
70
|
-
console.log(` Wallet:
|
|
77
|
+
console.log(` Wallet: ${chalk.dim("none — run: clawcard agent wallet")}`);
|
|
78
|
+
}
|
|
79
|
+
if (identity && identity.walletAddress) {
|
|
80
|
+
console.log(` Identity: ${chalk.green("verified")} ${chalk.dim("ERC-8004 on Base")}`);
|
|
81
|
+
} else {
|
|
82
|
+
console.log(` Identity: ${chalk.dim("not registered — run: clawcard agent identity")}`);
|
|
71
83
|
}
|
|
72
|
-
console.log(` Key ID:
|
|
73
|
-
console.log(` Budget:
|
|
84
|
+
console.log(` Key ID: ${chalk.dim(me.keyId)}`);
|
|
85
|
+
console.log(` Budget: ${chalk.green("$" + ((budget.budgetCents || 0) / 100).toFixed(2))}`);
|
|
74
86
|
console.log();
|
|
75
87
|
}
|
|
76
88
|
|
package/src/commands/setup.js
CHANGED
|
@@ -151,7 +151,33 @@ export async function setupCommand() {
|
|
|
151
151
|
s3.stop("Wallet setup skipped");
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
// Step 7:
|
|
154
|
+
// Step 7: Register on-chain identity (if doesn't exist)
|
|
155
|
+
const s5 = p.spinner();
|
|
156
|
+
s5.start("Setting up on-chain identity...");
|
|
157
|
+
|
|
158
|
+
try {
|
|
159
|
+
const { getOnChainIdentity, registerOnChainIdentity } = await import("../agent-api.js");
|
|
160
|
+
try {
|
|
161
|
+
const existing = await getOnChainIdentity(selectedKey.id);
|
|
162
|
+
if (existing && existing.walletAddress) {
|
|
163
|
+
s5.stop(`Identity ready: ${chalk.dim("ERC-8004 on Base")}`);
|
|
164
|
+
} else {
|
|
165
|
+
throw new Error("not found");
|
|
166
|
+
}
|
|
167
|
+
} catch {
|
|
168
|
+
// No identity — register one
|
|
169
|
+
try {
|
|
170
|
+
await registerOnChainIdentity(selectedKey.id, {});
|
|
171
|
+
s5.stop(`Identity registered: ${orange("ERC-8004 on Base")}`);
|
|
172
|
+
} catch {
|
|
173
|
+
s5.stop("Identity setup skipped (can register later with: clawcard agent identity)");
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
} catch {
|
|
177
|
+
s5.stop("Identity setup skipped");
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Step 8: Summary
|
|
155
181
|
p.log.success("Your agent is ready to use ClawCard!");
|
|
156
182
|
p.log.info(
|
|
157
183
|
[
|