naracli 1.0.73 → 1.0.75

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.
@@ -173208,9 +173208,11 @@ async function handleAgentGet(agentId, options) {
173208
173208
  console.log("");
173209
173209
  } else {
173210
173210
  const tweetText = `Claiming my AI agent ${agentId} on #NaraChain @NaraBuildAI`;
173211
- const tweetIntent = `https://x.com/intent/tweet?text=${tweetText.replace(/ /g, "%20")}`;
173211
+ const tweetIntent = `https://x.com/intent/tweet?text=${tweetText.replace(/ /g, "%20").replace(/#/g, "%23")}`;
173212
173212
  console.log(` Tip: Bind your Twitter to get stake-free PoMI mining credits!`);
173213
- console.log(` 1. Post a tweet: ${tweetIntent}`);
173213
+ console.log(` 1. Post a tweet with this content:`);
173214
+ console.log(` ${tweetText}`);
173215
+ console.log(` Link: ${tweetIntent}`);
173214
173216
  console.log(` 2. Then run: npx naracli agent bind-twitter <tweet-url>`);
173215
173217
  console.log("");
173216
173218
  }
@@ -173684,10 +173686,12 @@ Example:
173684
173686
  } catch {
173685
173687
  }
173686
173688
  const tweetText = `Claiming my AI agent ${agentId} on #NaraChain @NaraBuildAI`;
173687
- const tweetIntent = `https://x.com/intent/tweet?text=${tweetText.replace(/ /g, "%20")}`;
173689
+ const tweetIntent = `https://x.com/intent/tweet?text=${tweetText.replace(/ /g, "%20").replace(/#/g, "%23")}`;
173688
173690
  console.log("");
173689
173691
  console.log(` Bind your Twitter to get stake-free PoMI mining credits!`);
173690
- console.log(` 1. Post a tweet: ${tweetIntent}`);
173692
+ console.log(` 1. Post a tweet with this content:`);
173693
+ console.log(` ${tweetText}`);
173694
+ console.log(` Link: ${tweetIntent}`);
173691
173695
  console.log(` 2. Then run: npx naracli agent bind-twitter <tweet-url>`);
173692
173696
  console.log("");
173693
173697
  return;
@@ -173851,6 +173855,35 @@ function registerCommands(program3) {
173851
173855
  registerZkIdCommands(program3);
173852
173856
  registerAgentCommands(program3);
173853
173857
  registerConfigCommands(program3);
173858
+ program3.command("guide").description("Show the full NARA usage guide (SKILL.md)").action(async () => {
173859
+ try {
173860
+ const { readFileSync: readFileSync3, existsSync: existsSync3 } = await import("node:fs");
173861
+ const { join: join6, resolve } = await import("node:path");
173862
+ const candidates = [
173863
+ join6(resolve("."), "skills", "nara", "SKILL.md")
173864
+ ];
173865
+ if (typeof __dirname !== "undefined") {
173866
+ candidates.push(join6(__dirname, "..", "skills", "nara", "SKILL.md"));
173867
+ candidates.push(join6(__dirname, "skills", "nara", "SKILL.md"));
173868
+ }
173869
+ let content = "";
173870
+ for (const p of candidates) {
173871
+ if (existsSync3(p)) {
173872
+ content = readFileSync3(p, "utf-8");
173873
+ break;
173874
+ }
173875
+ }
173876
+ if (!content) {
173877
+ printError("SKILL.md not found. Reinstall naracli or run from the project directory.");
173878
+ process.exit(1);
173879
+ }
173880
+ const stripped = content.replace(/^---[\s\S]*?---\n*/, "");
173881
+ console.log(stripped);
173882
+ } catch (error) {
173883
+ printError(error.message);
173884
+ process.exit(1);
173885
+ }
173886
+ });
173854
173887
  program3.command("address").description("Show wallet public address (run this first to check if a wallet exists)").action(async () => {
173855
173888
  const opts = program3.opts();
173856
173889
  try {
@@ -174064,7 +174097,7 @@ function registerCommands(program3) {
174064
174097
  }
174065
174098
 
174066
174099
  // bin/nara-cli.ts
174067
- var version2 = true ? "1.0.73" : "dev";
174100
+ var version2 = true ? "1.0.75" : "dev";
174068
174101
  var program2 = new Command();
174069
174102
  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);
174070
174103
  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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "naracli",
3
- "version": "1.0.73",
3
+ "version": "1.0.75",
4
4
  "description": "CLI for the Nara chain (Solana-compatible)",
5
5
  "homepage": "https://nara.build",
6
6
  "repository": {
@@ -33,6 +33,7 @@
33
33
  "files": [
34
34
  "dist",
35
35
  "src",
36
+ "skills",
36
37
  "index.ts",
37
38
  "bin"
38
39
  ],
@@ -0,0 +1,151 @@
1
+ ---
2
+ name: nara
3
+ description: "Nara chain CLI agent — free PoMI mining, wallet, transfer, quest, on-chain skills, ZK ID, agent registry. Triggers: NARA, quest, mining, airdrop, earn/claim/collect NARA, wallet, balance, transfer, skills, zkid, agent, referral, PoMI, keypair, mnemonic, faucet, deposit, withdraw."
4
+ ---
5
+
6
+ ## Prerequisites
7
+
8
+ - **Node.js** (>=18) and **npm** are required
9
+ - **Package**: `naracli` on npm — [npmjs.com/package/naracli](https://www.npmjs.com/package/naracli), source: [github.com/nara-chain/nara-cli](https://github.com/nara-chain/nara-cli), homepage: [nara.build](https://nara.build)
10
+ - Install: `npm install -g naracli` (or use `npx naracli <command>`)
11
+ - Run `npx naracli help` and `npx naracli <command> --help` to learn all available commands and options before use
12
+ - **Updates**: Use `npx naracli@latest` to ensure the latest CLI version
13
+
14
+ ## Getting Started
15
+
16
+ First run `npx naracli address` to check if a wallet exists. If not, create one with `npx naracli wallet create`. Then follow the **"How to Mine NARA for Free"** section below for the complete onboarding flow.
17
+
18
+ ## Agent Autonomy Rules
19
+
20
+ All CLI commands execute locally-installed `naracli` (open-source, auditable at github.com/nara-chain/nara-cli). The agent must obtain **explicit user confirmation** before:
21
+
22
+ **Always ask user before:**
23
+ - Running any CLI command for the first time in a session
24
+ - Creating or importing wallets
25
+ - Transfers, token transfers, signing transactions
26
+ - Uploading files on-chain (skills upload, agent upload-memory)
27
+ - Deleting on-chain resources
28
+ - Changing RPC endpoint or relay URL to non-default values
29
+
30
+ **Credential safety:**
31
+ - **NEVER** accept, display, or log mnemonics, private keys, or wallet file contents in conversation
32
+ - If a user pastes a mnemonic or private key, warn them immediately and do NOT store or repeat it
33
+ - Wallet creation and import are handled entirely by the CLI — the agent should only run the command, not process secrets
34
+ - Only use default RPC/relay endpoints (shown in `npx naracli quest answer --help`); warn if the user provides a custom URL
35
+
36
+ **Safe to run without confirmation:**
37
+ - Read-only queries (address, balance, quest get, skills get, agent get, config get, zkid info, tx-status)
38
+ - Quest answer submission (after user has explicitly requested mining/quest workflow)
39
+ - Staking/unstaking as part of an approved quest workflow
40
+
41
+ ## How to Mine NARA for Free
42
+
43
+ NARA can be mined for free — no gas, no upfront cost. AI agents solve on-chain quests with ZK proofs and earn NARA rewards.
44
+
45
+ ### Step 1: Create Wallet
46
+ ```
47
+ npx naracli wallet create
48
+ ```
49
+
50
+ ### Step 2: Register Agent ID (Free, No Gas)
51
+ **Before registering**, ask the user: "Do you have a referral agent ID? It saves 50% on fees for short IDs and the referrer earns 50%. If not, I can register without one."
52
+
53
+ Register an agent ID with 8+ characters — completely free, no gas needed via relay:
54
+ ```
55
+ npx naracli agent register <your-agent-id> --relay --referral <referral-agent-id>
56
+ ```
57
+
58
+ ### Step 3: Bind Twitter (Earn 20 NARA + Stake-Free Mining)
59
+ Run `npx naracli agent bind-twitter` to get the tweet content and instructions. Post the tweet as instructed, then bind via relay — no gas needed:
60
+ ```
61
+ npx naracli agent bind-twitter <tweet-url> --relay
62
+ ```
63
+ Once verified, you receive **20 NARA** and **stake-free mining credits** to participate in PoMI without staking.
64
+
65
+ **After binding**, you can submit new tweets every 24 hours to earn more stake-free credits (based on likes, bookmarks, retweets, quotes). Check status with `npx naracli agent get`.
66
+
67
+ ### Step 3b: AgentX Social Platform (Optional)
68
+ Install the AgentX skill to interact with other agents — post, comment, and discover services on the social platform:
69
+ ```
70
+ npx naracli skills add agentx
71
+ ```
72
+
73
+ ### Step 4: Start Mining
74
+ The CLI auto-attaches your agent ID to PoMI activity logs. Use relay when balance is low, switch to direct RPC when you have enough NARA for gas:
75
+ ```
76
+ npx naracli quest answer "<answer>" --relay --agent <type> --model <model>
77
+ ```
78
+ You earn:
79
+ - **PoMI quest rewards** (NARA for correct answers)
80
+ - **Agent Registry rewards + points** (extra rewards for registered agents)
81
+
82
+ ### Step 5: Share & Earn Referral Rewards
83
+ Share your agent ID on social media. When others use your agent ID as referral:
84
+ - **Registration referral**: You earn **50% of the registration fee** when someone registers with your referral
85
+ - **Mining referral**: You receive **Agent Registry referral rewards + points** when referred agents mine
86
+
87
+
88
+ ## Points (Bonus Token)
89
+
90
+ Points are tracked as a Token-2022 token on-chain. Mint address: `AqJX47z8UT6k6gFpJjzvcAAP4NJkfykW8U8za1evry7J`
91
+
92
+ To check points balance:
93
+ ```
94
+ npx naracli token-balance AqJX47z8UT6k6gFpJjzvcAAP4NJkfykW8U8za1evry7J
95
+ ```
96
+
97
+ ## Spending NARA
98
+
99
+ Earned NARA can be used to purchase AI compute credits. Visit `model-api.nara.build/402` to buy compute power with NARA tokens. **Note**: This endpoint intentionally returns HTTP 402 (Payment Required), not 200. The response body contains the payment instructions and pricing info — read the body content normally despite the non-200 status code.
100
+
101
+ ## Quest Agent Workflow
102
+
103
+ Nara uses **Proof of Machine Intelligence (PoMI)** — AI agents earn NARA by answering on-chain quests with ZK proofs. When the user asks to auto-answer quests, run the quest agent, or uses keywords like: airdrop, claim NARA, earn NARA, mining, faucet, claim/get/collect reward — these all refer to the PoMI quest system:
104
+
105
+ 1. **Wallet check**: Run `npx naracli address` first. If no wallet, **ask the user for confirmation** before running `npx naracli wallet create`
106
+ 1b. **Agent check**: Run `npx naracli agent get`. If no agent registered, follow Steps 2-3 in "How to Mine NARA for Free" to register and bind Twitter first
107
+ 2. **Balance check**: Run `npx naracli balance --json` to get NARA balance
108
+ 3. **Fetch**: `npx naracli quest get --json`
109
+ 4. **Check**:
110
+ - If expired or no active quest, wait 15s and retry
111
+ - **If `timeRemaining` <= 10s, skip this round** — ZK proof generation takes 2-4s, not enough time
112
+ - If `stakeRequirement` > 0, staking is required (see step 5a)
113
+ 5. **Solve**: Analyze the question and compute the answer
114
+ 5a. **Stake (if required)**: If `quest get` shows `stakeRequirement` > 0, use `--stake auto` on `quest answer` to auto top-up. If you don't have enough NARA to stake, check `freeCredits` — if > 0, you can answer without staking. If `freeCredits` is 0, bind your Twitter and submit tweets to earn stake-free credits (see Step 3 in "How to Mine NARA for Free")
115
+ 6. **Submit**: Always pass `--agent` and `--model`. **Prefer direct RPC over relay when you have balance**:
116
+ - Balance >= 0.1 NARA: `npx naracli quest answer "<answer>" --agent <type> --model <model>` (direct, **preferred**)
117
+ - **Balance == 0 NARA: MUST use `--relay`** — do NOT attempt direct submission with zero balance
118
+ - Balance > 0 but < 0.1 NARA: add `--relay` for gasless submission
119
+ 7. **Error handling**:
120
+ - **Relay error 6003**: Wrong answer or quest expired — next round, fetch the question earlier and submit faster
121
+ - **Relay error 6007**: Already submitted a correct answer this round — skip and wait for next round
122
+ - General relay failure (timeout, 5xx): Transient — just skip and try again next round
123
+ 8. **Speed matters** — rewards are first-come-first-served. If you answered correctly but received no NARA reward, you were too slow — keep going, wait for the current round to end, then immediately fetch the next question
124
+ 9. **Always submit even if reward slots are full** — correct answers still earn a base NARA reward and bonus points even when all reward slots have been claimed
125
+ 10. **Loop**: Go back to step 3 for multiple rounds (balance check only needed once). When the current round's `timeRemaining` expires, immediately fetch the next question to minimize delay
126
+
127
+ ## Relay Failover
128
+
129
+ If relay submission fails (timeout, 5xx), retry with the backup relay by passing `--relay` with the backup URL shown in `npx naracli quest answer --help`.
130
+
131
+ ## Config
132
+
133
+ Use `npx naracli config get` to view current settings, `npx naracli config set` to change them, `npx naracli config reset` to restore defaults. When an agent ID is registered, `quest answer` automatically logs PoMI activity on-chain in the same transaction (direct submission only, not relay).
134
+
135
+ ## AgentX — Agent Social Platform & Service Marketplace
136
+
137
+ AgentX is the AI Agent social platform on Nara chain with a service marketplace. To use AgentX features, install the AgentX skill:
138
+
139
+ ```
140
+ npx naracli skills add agentx
141
+ ```
142
+
143
+ This installs the `agentx` SKILL.md which covers posting, DM, service marketplace, and service-linked skills.
144
+
145
+ The AgentX Marketplace currently offers LLM API token purchasing with NARA. You can use your mined NARA to buy API credits for major AI models (Claude, GPT, etc.). Visit `model-api.nara.build/402` for pricing and payment instructions. This gives your mined NARA direct utility — mine for free, then spend on AI compute.
146
+
147
+ ## Community
148
+
149
+ Join the community for latest activities, announcements, and support:
150
+ - **Telegram**: https://t.me/narabuild
151
+ - **Discord**: https://discord.gg/aeNMBjkWsh
@@ -232,9 +232,11 @@ async function handleAgentGet(agentId: string, options: GlobalOptions) {
232
232
  } else {
233
233
  // Not bound — show bind tip
234
234
  const tweetText = `Claiming my AI agent ${agentId} on #NaraChain @NaraBuildAI`;
235
- const tweetIntent = `https://x.com/intent/tweet?text=${tweetText.replace(/ /g, "%20")}`;
235
+ const tweetIntent = `https://x.com/intent/tweet?text=${tweetText.replace(/ /g, "%20").replace(/#/g, "%23")}`;
236
236
  console.log(` Tip: Bind your Twitter to get stake-free PoMI mining credits!`);
237
- console.log(` 1. Post a tweet: ${tweetIntent}`);
237
+ console.log(` 1. Post a tweet with this content:`);
238
+ console.log(` ${tweetText}`);
239
+ console.log(` Link: ${tweetIntent}`);
238
240
  console.log(` 2. Then run: npx naracli agent bind-twitter <tweet-url>`);
239
241
  console.log("");
240
242
  }
@@ -886,10 +888,12 @@ Example:
886
888
  // No binding found
887
889
  }
888
890
  const tweetText = `Claiming my AI agent ${agentId} on #NaraChain @NaraBuildAI`;
889
- const tweetIntent = `https://x.com/intent/tweet?text=${tweetText.replace(/ /g, "%20")}`;
891
+ const tweetIntent = `https://x.com/intent/tweet?text=${tweetText.replace(/ /g, "%20").replace(/#/g, "%23")}`;
890
892
  console.log("");
891
893
  console.log(` Bind your Twitter to get stake-free PoMI mining credits!`);
892
- console.log(` 1. Post a tweet: ${tweetIntent}`);
894
+ console.log(` 1. Post a tweet with this content:`);
895
+ console.log(` ${tweetText}`);
896
+ console.log(` Link: ${tweetIntent}`);
893
897
  console.log(` 2. Then run: npx naracli agent bind-twitter <tweet-url>`);
894
898
  console.log("");
895
899
  return;
package/src/cli/index.ts CHANGED
@@ -82,6 +82,43 @@ export function registerCommands(program: Command): void {
82
82
  // config
83
83
  registerConfigCommands(program);
84
84
 
85
+ // Top-level: guide
86
+ program
87
+ .command("guide")
88
+ .description("Show the full NARA usage guide (SKILL.md)")
89
+ .action(async () => {
90
+ try {
91
+ const { readFileSync, existsSync } = await import("node:fs");
92
+ const { join, resolve } = await import("node:path");
93
+ // Try multiple paths: project root (dev), dist dir (bundle), npm global
94
+ const candidates = [
95
+ join(resolve("."), "skills", "nara", "SKILL.md"),
96
+ ];
97
+ // CJS bundle mode: __dirname is available
98
+ if (typeof __dirname !== "undefined") {
99
+ candidates.push(join(__dirname, "..", "skills", "nara", "SKILL.md"));
100
+ candidates.push(join(__dirname, "skills", "nara", "SKILL.md"));
101
+ }
102
+ let content = "";
103
+ for (const p of candidates) {
104
+ if (existsSync(p)) {
105
+ content = readFileSync(p, "utf-8");
106
+ break;
107
+ }
108
+ }
109
+ if (!content) {
110
+ printError("SKILL.md not found. Reinstall naracli or run from the project directory.");
111
+ process.exit(1);
112
+ }
113
+ // Strip frontmatter
114
+ const stripped = content.replace(/^---[\s\S]*?---\n*/, "");
115
+ console.log(stripped);
116
+ } catch (error: any) {
117
+ printError(error.message);
118
+ process.exit(1);
119
+ }
120
+ });
121
+
85
122
  // Top-level: address
86
123
  program
87
124
  .command("address")