naracli 1.0.58 → 1.0.59
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/nara-cli-bundle.cjs +18 -1
- package/package.json +1 -1
- package/src/cli/commands/agent.ts +22 -0
package/dist/nara-cli-bundle.cjs
CHANGED
|
@@ -133981,6 +133981,23 @@ function registerAgentCommands(program3) {
|
|
|
133981
133981
|
process.exit(1);
|
|
133982
133982
|
}
|
|
133983
133983
|
});
|
|
133984
|
+
agent.command("myid").description("Show your registered agent ID for the current network").action(async (_opts, cmd) => {
|
|
133985
|
+
try {
|
|
133986
|
+
const globalOpts = cmd.optsWithGlobals();
|
|
133987
|
+
const rpcUrl = getRpcUrl(globalOpts.rpcUrl);
|
|
133988
|
+
const networkConfig = loadNetworkConfig(rpcUrl);
|
|
133989
|
+
if (globalOpts.json) {
|
|
133990
|
+
formatOutput({ agentId: networkConfig.agent_id || null }, true);
|
|
133991
|
+
} else if (networkConfig.agent_id) {
|
|
133992
|
+
console.log(networkConfig.agent_id);
|
|
133993
|
+
} else {
|
|
133994
|
+
printWarning("No agent ID registered for this network. Run 'agent register <id>' to create one.");
|
|
133995
|
+
}
|
|
133996
|
+
} catch (error) {
|
|
133997
|
+
printError(error.message);
|
|
133998
|
+
process.exit(1);
|
|
133999
|
+
}
|
|
134000
|
+
});
|
|
133984
134001
|
agent.command("clear").description("Clear saved agent ID from local config (does not delete on-chain)").action(async (_opts, cmd) => {
|
|
133985
134002
|
try {
|
|
133986
134003
|
const globalOpts = cmd.optsWithGlobals();
|
|
@@ -134260,7 +134277,7 @@ function registerCommands(program3) {
|
|
|
134260
134277
|
}
|
|
134261
134278
|
|
|
134262
134279
|
// bin/nara-cli.ts
|
|
134263
|
-
var version2 = true ? "1.0.
|
|
134280
|
+
var version2 = true ? "1.0.59" : "dev";
|
|
134264
134281
|
var program2 = new Command();
|
|
134265
134282
|
program2.name("naracli").description("CLI for the Nara chain. Native coin is NARA (not SOL). Mine NARA for free via PoMI quests, manage wallets, register agents, and more. Run 'naracli <command> --help' for details on any command.").version(version2);
|
|
134266
134283
|
program2.option("-r, --rpc-url <url>", "RPC endpoint (default: https://mainnet-api.nara.build/)").option("-w, --wallet <path>", "Path to wallet keypair JSON file (default: ~/.config/nara/id.json)").option("-j, --json", "Output in JSON format");
|
package/package.json
CHANGED
|
@@ -433,6 +433,28 @@ export function registerAgentCommands(program: Command): void {
|
|
|
433
433
|
}
|
|
434
434
|
});
|
|
435
435
|
|
|
436
|
+
// agent myid
|
|
437
|
+
agent
|
|
438
|
+
.command("myid")
|
|
439
|
+
.description("Show your registered agent ID for the current network")
|
|
440
|
+
.action(async (_opts: any, cmd: Command) => {
|
|
441
|
+
try {
|
|
442
|
+
const globalOpts = cmd.optsWithGlobals() as GlobalOptions;
|
|
443
|
+
const rpcUrl = getRpcUrl(globalOpts.rpcUrl);
|
|
444
|
+
const networkConfig = loadNetworkConfig(rpcUrl);
|
|
445
|
+
if (globalOpts.json) {
|
|
446
|
+
formatOutput({ agentId: networkConfig.agent_id || null }, true);
|
|
447
|
+
} else if (networkConfig.agent_id) {
|
|
448
|
+
console.log(networkConfig.agent_id);
|
|
449
|
+
} else {
|
|
450
|
+
printWarning("No agent ID registered for this network. Run 'agent register <id>' to create one.");
|
|
451
|
+
}
|
|
452
|
+
} catch (error: any) {
|
|
453
|
+
printError(error.message);
|
|
454
|
+
process.exit(1);
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
|
|
436
458
|
// agent clear
|
|
437
459
|
agent
|
|
438
460
|
.command("clear")
|