@heyamiko/amiko-cli 0.6.9 → 0.7.1

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/README.md CHANGED
@@ -1,13 +1,11 @@
1
- # amiko-cli (v0.6.6)
1
+ # @heyamiko/amiko-cli (v0.7.0)
2
2
 
3
- Manage agents, wallets, credits, and the MPP marketplace from your terminal. Works for both human users and AI agents running on OpenClaw.
3
+ Manage wallets, credits, swaps, and MPP marketplace services from the terminal. Works for both human users and AI agents running on OpenClaw.
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```bash
8
8
  npm install -g @heyamiko/amiko-cli
9
- # or
10
- bun install -g @heyamiko/amiko-cli
11
9
  ```
12
10
 
13
11
  Update to latest:
@@ -30,13 +28,19 @@ amiko credits balance
30
28
  # Top up credits from your agent's wallet
31
29
  amiko credits topup 10000 --token AMIKO --yes
32
30
 
33
- # Swap tokens
34
- amiko swap quote SOL USDC 1.0
35
- amiko swap send SOL USDC 1.0 --yes
31
+ # Search X/Twitter (1 AMIKO)
32
+ amiko search "AI agents"
36
33
 
37
- # Browse and call marketplace agents
38
- amiko browse
39
- amiko call titan-research "Summarize the latest AI news"
34
+ # Generate an image (5 AMIKO)
35
+ amiko image "a sunset over mountains"
36
+
37
+ # Swap tokens on Solana
38
+ amiko swap quote 1.0 SOL USDC
39
+ amiko swap send 1.0 SOL USDC --yes
40
+
41
+ # Call any MPP service
42
+ amiko service list
43
+ amiko service call POST /v1/sfx '{"text":"thunder","duration_seconds":5}'
40
44
  ```
41
45
 
42
46
  ## Connect
@@ -49,11 +53,10 @@ amiko connect amk_<key> # API key (shown once at creation)
49
53
  amiko connect # browser sign-in flow
50
54
  ```
51
55
 
52
- The connect code is the simplest -- generate one from your Amiko settings page, paste it to the agent or terminal.
56
+ The connect code is the simplest — generate one from your Amiko settings page, paste it to the agent or terminal.
53
57
 
54
58
  ```bash
55
59
  amiko whoami # show current auth status
56
- amiko logout # clear stored credentials
57
60
  ```
58
61
 
59
62
  ## Credits
@@ -74,135 +77,130 @@ amiko credits topup 10000 --wallet Gu2b...QVya # specific wallet address
74
77
  amiko credits topup 10000 --yes # skip confirmation
75
78
  ```
76
79
 
77
- **How it works:**
78
- 1. CLI fetches live token price from Jupiter
79
- 2. Transfers tokens from your Crossmint agent wallet to the treasury via billing API
80
- 3. Verifies the on-chain transfer and credits your account
81
- 4. All calls go through `billing.heyamiko.com` -- no other dependencies
82
-
83
- **Supported tokens:** AMIKO, SOL, USDC, USDT, ETH
80
+ **Supported tokens:** AMIKO, SOL, USDC, USDT
84
81
  **Supported chains:** Solana, Base, Ethereum, Tempo
85
82
 
86
- ## Swap
83
+ ## Search
87
84
 
88
85
  ```bash
89
- amiko swap quote <from> <to> <amount> # get Jupiter quote
90
- amiko swap send <from> <to> <amount> # execute swap
91
- amiko swap tokens # list supported tokens
86
+ amiko search "AI agents" # search X/Twitter (1 AMIKO)
87
+ amiko search "bitcoin" --token USDC # pay with USDC instead
88
+ amiko search "news" --raw # raw JSON output
92
89
  ```
93
90
 
94
- Swaps execute via Jupiter on Solana using the agent's Crossmint wallet.
91
+ Pays 1 AMIKO per search via Crossmint wallet transfer. Tries Solana wallet first, falls back to EVM.
95
92
 
96
- ## Wallet
93
+ ## Image Generation
97
94
 
98
95
  ```bash
99
- amiko wallet create # create MPP wallet on Tempo
100
- amiko wallet balance [address] # check USDC.e balance
101
- amiko wallet balance --watch # poll every 5s
102
- amiko wallet send <to> <amount> # send tokens via Crossmint wallet
103
- amiko wallet topup <amount> # Stripe checkout ($1-$100)
104
- amiko wallet deposit [address] # USDC.e deposit instructions
105
- amiko wallet login # Tempo wallet login
106
- amiko wallet whoami # Tempo wallet identity
107
- amiko wallet fund # fund via Tempo dashboard
96
+ amiko image "a sunset over mountains" # gpt-image-1 (default)
97
+ amiko image "logo" --background transparent # transparent background
98
+ amiko image "cat" --model dall-e-3 # DALL-E 3
99
+ amiko image "portrait" --size 1024x1792 --quality high # portrait, high quality
100
+ amiko image "icon" --format webp # webp output
101
+ amiko image "banner" --raw # raw JSON
108
102
  ```
109
103
 
110
- ## Marketplace
104
+ Costs 5 AMIKO per image. Returns a Supabase Storage URL.
105
+
106
+ ## Amazon
111
107
 
112
108
  ```bash
113
- amiko browse # browse agents
114
- amiko browse -c research -l 10 # filter by category
115
- amiko info <agent> # agent details + pricing
116
- amiko popular # trending agents
117
- amiko activity # recent payments
118
- amiko leaderboard # top creators
109
+ amiko amazon search "usb c cable" # product search (1 AMIKO)
110
+ amiko amazon quote B01GGKYKQM # price quote (free)
119
111
  ```
120
112
 
121
- ## Calling Agents
113
+ ## Swap
122
114
 
123
115
  ```bash
124
- amiko call <agent> "message" # single message
125
- amiko call <agent> -i # interactive REPL
126
- echo "input" | amiko call <agent> # pipe input
127
- amiko call <agent> "msg" --task # task endpoint
128
- amiko call <agent> "msg" --dry-run # preview cost
116
+ amiko swap quote <amount> <from> <to> # get Jupiter quote
117
+ amiko swap send <amount> <from> <to> # execute swap via Crossmint
118
+ amiko swap tokens # list supported tokens
129
119
  ```
130
120
 
131
- ## Creator Dashboard
121
+ **Examples:**
132
122
 
133
123
  ```bash
134
- amiko creator summary # earnings + listings
135
- amiko creator listings # your agent listings
136
- amiko creator publish <id> # publish a draft
137
- amiko creator payout # request payout
124
+ amiko swap quote 1.0 SOL USDC
125
+ amiko swap send 0.5 USDC AMIKO --yes
126
+ amiko swap send 100 AMIKO SOL --slippage 100
138
127
  ```
139
128
 
129
+ Swaps execute via Jupiter on Solana. Supports SOL, USDC, USDT, AMIKO, PYUSD, BONK, JUP, RAY, JitoSOL, mSOL, or any mint address.
130
+
140
131
  ## Bridge
141
132
 
142
133
  ```bash
143
- amiko bridge quote <amount> # cross-chain bridge quote via Across Protocol
144
- amiko bridge send <amount> # execute bridge transfer
145
- amiko bridge status <txHash> # check bridge status
146
- amiko bridge routes # available bridge routes
147
- amiko bridge limits # min/max limits per route
134
+ amiko bridge quote <amount> # cross-chain USDC quote via Across Protocol
135
+ amiko bridge send <amount> # execute bridge transfer
136
+ amiko bridge status <txHash> # check bridge status
137
+ amiko bridge routes # available bridge routes
138
+ amiko bridge limits # min/max limits per route
148
139
  ```
149
140
 
150
- ## Audio & Voice
141
+ Default route: Solana → Tempo. Use `--from` and `--to` flags for other chains.
142
+
143
+ ## MPP Services
151
144
 
152
- All audio endpoints return binary audio streams. Use `amiko service call` for direct access:
145
+ Call any endpoint on the Amiko marketplace with automatic AMIKO payment:
153
146
 
154
147
  ```bash
155
- # Sound effects ($0.05)
148
+ amiko service list # all services + prices
149
+ amiko service call <METHOD> <path> [body]
150
+ ```
151
+
152
+ **Examples:**
153
+
154
+ ```bash
155
+ # Sound effects ($0.05) — returns { url, format, service }
156
156
  amiko service call POST /v1/sfx '{"text":"Thunder with heavy rain","duration_seconds":5}'
157
157
 
158
- # Music generation ($0.10)
158
+ # Music generation ($0.10) — returns { url, format, service }
159
159
  amiko service call POST /v1/music '{"prompt":"Lo-fi chill beat","music_length_ms":30000}'
160
160
 
161
- # Composition plan ($0.02) — get JSON plan before generating
162
- amiko service call POST /v1/music/plan '{"prompt":"Epic orchestral piece"}'
163
-
164
- # Text-to-speech ($0.50/1K chars)
165
- amiko service call POST /v1/tts/21m00Tcm4TlvDq8ikWAM '{"text":"Hello world"}'
161
+ # Text-to-speech (1 AMIKO) — returns { url, format, service }
162
+ amiko service tts 21m00Tcm4TlvDq8ikWAM "Hello world"
166
163
 
167
- # List all available services + prices
168
- amiko service list
164
+ # Composition plan ($0.02)
165
+ amiko service call POST /v1/music/plan '{"prompt":"Epic orchestral piece"}'
169
166
  ```
170
167
 
171
- ## Other Commands
168
+ Audio and image endpoints upload to Supabase Storage and return permanent URLs.
169
+
170
+ ## Wallet
172
171
 
173
172
  ```bash
174
- amiko reputation [address] # TARS score
175
- amiko discover # MPP service info
176
- amiko ping # health check
177
- amiko config show # view config
178
- amiko config set <key> <value> # set config value
179
- amiko update # update CLI to latest
173
+ amiko wallet balance [address] # check USDC.e balance on Tempo
174
+ amiko wallet balance --watch # poll every 5s (stops after 10 errors)
175
+ amiko wallet send <to> <amount> # send tokens from agent wallet
176
+ amiko wallet topup <amount> # Stripe checkout ($1-$100)
177
+ amiko wallet deposit [address] # USDC.e deposit instructions
178
+ amiko wallet login # Tempo wallet login (browser)
179
+ amiko wallet whoami # Tempo wallet identity
180
+ amiko wallet fund # fund via Tempo dashboard
180
181
  ```
181
182
 
182
- ## X Search
183
+ ## Other Commands
183
184
 
184
185
  ```bash
185
- amiko search "AI agents" # search X (pays 1 AMIKO from Solana wallet)
186
- amiko search "bitcoin" --token USDC # pay with USDC instead
187
- amiko search "news" --raw # raw JSON output
186
+ amiko discovery # MPP service info + pricing
187
+ amiko config show # view config
188
+ amiko config set <key> <value> # set config value
189
+ amiko update # update CLI to latest
190
+ amiko --help # all commands
188
191
  ```
189
192
 
190
- Pays via Crossmint server-signed transfer from the agent's wallet. Tries Solana wallet first, falls back to EVM (Base/Tempo).
193
+ ## Agent Integration (OpenClaw)
191
194
 
192
- ## Image Generation
195
+ ### Install as OpenClaw plugin
193
196
 
194
197
  ```bash
195
- amiko image "a sunset over mountains" # gpt-image-1 (default, base64)
196
- amiko image "logo" --background transparent # transparent background
197
- amiko image "cat" --model dall-e-3 # DALL-E 3 (returns URL)
198
- amiko image "portrait" --size 1024x1792 --quality high # portrait, high quality
199
- amiko image "icon" --format webp # webp output
200
- amiko image "banner" --raw # raw JSON (for piping)
198
+ openclaw plugins install @heyamiko/amiko-cli
201
199
  ```
202
200
 
203
- Costs 5 AMIKO per image. Default model is `gpt-image-1` which returns base64 data (permanent, no expiring URLs).
201
+ This registers the CLI's skill file so the agent discovers all commands through the normal skill system. Updates to the CLI (`npm update -g @heyamiko/amiko-cli`) also update the skill docs.
204
202
 
205
- ## Agent Integration (OpenClaw)
203
+ ### Authentication
206
204
 
207
205
  Agents auto-authenticate via `.amiko.json` — no manual connect needed. The platform writes this file during twin init with wallets, billing config, and twin token.
208
206
 
@@ -219,13 +217,19 @@ The CLI checks for `.amiko.json` in order:
219
217
  3. `/data/.openclaw/workspace/.amiko.json`
220
218
  4. Walking up from `cwd`
221
219
 
222
- The `.amiko.json` provides: `AMIKO_TWIN_TOKEN` (auth), `agentWallets` (Solana + Base addresses), `billingBase`, and optionally `platformKey`.
220
+ Supported keys (both camelCase and SCREAMING_SNAKE_CASE):
221
+ - `amikoTwinToken` / `AMIKO_TWIN_TOKEN` — auth token
222
+ - `amikoTwinId` / `AMIKO_TWIN_ID` — twin identifier
223
+ - `amikoPlatformUrl` / `AMIKO_PLATFORM_URL` — platform base URL
224
+ - `agentWallets` — array of `{ chain, address }`
225
+ - `billingBase` — billing API URL
226
+ - `platformKey` — API key override
223
227
 
224
- **Important:** If `~/.amiko/config.json` exists with a stale `apiKey`, it takes priority over `.amiko.json` twin token. Remove stale keys or let the platform manage auth.
228
+ **Stale config pitfall:** If `~/.amiko/config.json` exists with an old `apiKey`, it takes priority over `.amiko.json` twin token. Remove stale keys or let the platform manage auth.
225
229
 
226
230
  ## Configuration
227
231
 
228
- Config: `~/.amiko/config.json`
232
+ Config file: `~/.amiko/config.json`
229
233
 
230
234
  | Key | Default |
231
235
  |-----|---------|
@@ -242,29 +246,40 @@ src/
242
246
  ├── commands/
243
247
  │ ├── connect.ts # connect (code, API key, browser)
244
248
  │ ├── credits.ts # credits balance + topup
245
- │ ├── swap.ts # Jupiter token swaps
249
+ │ ├── search.ts # X/Twitter search (1 AMIKO via MPP)
250
+ │ ├── image.ts # image generation (gpt-image-1, 5 AMIKO)
251
+ │ ├── amazon.ts # Amazon search + quote
252
+ │ ├── swap.ts # Jupiter token swaps (Solana)
246
253
  │ ├── bridge.ts # Across Protocol cross-chain bridge
247
- │ ├── browse.ts # marketplace browsing
248
- │ ├── call.ts # call agents
249
- │ ├── wallet.ts # wallet management (Crossmint + Tempo)
250
- │ ├── creator.ts # creator dashboard
254
+ │ ├── wallet.ts # wallet management (Tempo + Crossmint)
255
+ │ ├── services.ts # generic MPP service calling
256
+ │ ├── discovery.ts # MPP service info
251
257
  │ ├── login.ts # Privy browser login
252
- │ ├── update.ts # self-update
253
258
  │ ├── config.ts # config management
254
- │ ├── discovery.ts # MPP service info
255
- │ ├── marketplace.ts # activity, leaderboard, popular
256
- │ └── reputation.ts # TARS score
259
+ │ └── update.ts # self-update
257
260
  └── lib/
258
261
  ├── config.ts # ~/.amiko/config.json
259
- ├── agent-config.ts # .amiko.json reader + auto-auth
260
- ├── api.ts # HTTP client for MPP + billing
261
- ├── format.ts # table, usd, truncAddr helpers
262
+ ├── agent-config.ts # .amiko.json reader + auth resolution
263
+ ├── api.ts # HTTP client (MPP + billing)
264
+ ├── format.ts # terminal output helpers
262
265
  ├── mpp-topup.ts # MPP SDK topup helper
263
266
  ├── across.ts # Across Protocol bridge
264
- └── tempo.ts # Tempo wallet CLI wrapper
267
+ └── tempo.ts # Tempo chain helpers
265
268
  ```
266
269
 
267
- Built with [Commander](https://github.com/tj/commander.js), [chalk](https://github.com/chalk/chalk), [ora](https://github.com/sindresorhus/ora), [@solana/mpp](https://github.com/solana-foundation/mpp-sdk), and [@crossmint/wallets-sdk](https://www.crossmint.com). Bundled with [Bun](https://bun.sh).
270
+ ## API Endpoints
271
+
272
+ | Client | Base URL | Purpose |
273
+ |--------|----------|---------|
274
+ | MPP API | `mpp.amikomarkets.com` | Marketplace services, search, image, audio |
275
+ | Billing API | `billing.heyamiko.com` | Credits, topup, wallet balances, keys |
276
+
277
+ ## Build
278
+
279
+ ```bash
280
+ bun build src/index.ts --outdir dist --target node --format esm
281
+ npm publish
282
+ ```
268
283
 
269
284
  ## License
270
285
 
package/dist/index.js CHANGED
@@ -24968,7 +24968,7 @@ var require_fallback = __commonJS((exports, module) => {
24968
24968
 
24969
24969
  // node_modules/bufferutil/index.js
24970
24970
  var require_bufferutil = __commonJS((exports, module) => {
24971
- var __dirname = "/home/runner/work/Amiko-Layer/Amiko-Layer/amiko-cli/node_modules/bufferutil";
24971
+ var __dirname = "/Users/mars/mars-dev/AMIKO/Amiko-Layer/amiko-cli/node_modules/bufferutil";
24972
24972
  try {
24973
24973
  module.exports = require_node_gyp_build2()(__dirname);
24974
24974
  } catch (e3) {
@@ -25384,7 +25384,7 @@ var require_fallback2 = __commonJS((exports, module) => {
25384
25384
 
25385
25385
  // node_modules/utf-8-validate/index.js
25386
25386
  var require_utf_8_validate = __commonJS((exports, module) => {
25387
- var __dirname = "/home/runner/work/Amiko-Layer/Amiko-Layer/amiko-cli/node_modules/utf-8-validate";
25387
+ var __dirname = "/Users/mars/mars-dev/AMIKO/Amiko-Layer/amiko-cli/node_modules/utf-8-validate";
25388
25388
  try {
25389
25389
  module.exports = require_node_gyp_build2()(__dirname);
25390
25390
  } catch (e3) {
@@ -73113,7 +73113,7 @@ function registerWalletCommand(program2) {
73113
73113
  process.exit(1);
73114
73114
  }
73115
73115
  const fetchBalance = async () => {
73116
- const data = await get(`/v1/wallet/${addr}/balance`);
73116
+ const data = await get(`/v1/wallet/balance/${addr}`);
73117
73117
  return parseFloat(data.balance || data.usdce || "0").toFixed(4);
73118
73118
  };
73119
73119
  if (opts.watch) {
@@ -73123,9 +73123,12 @@ function registerWalletCommand(program2) {
73123
73123
  console.log(label("Address", truncAddr(addr)));
73124
73124
  console.log(dim(`Polling every ${intervalMs / 1000}s — Ctrl+C to stop
73125
73125
  `));
73126
+ let consecutiveErrors = 0;
73127
+ const MAX_ERRORS = 10;
73126
73128
  const poll2 = async () => {
73127
73129
  try {
73128
73130
  const bal = await fetchBalance();
73131
+ consecutiveErrors = 0;
73129
73132
  const ts = new Date().toLocaleTimeString();
73130
73133
  const changed = last !== "" && bal !== last;
73131
73134
  const prefix = changed ? source_default.yellow("↕") : source_default.dim("·");
@@ -73133,11 +73136,21 @@ function registerWalletCommand(program2) {
73133
73136
  process.stdout.write(`\r${prefix} ${dim(ts)} ${value} `);
73134
73137
  last = bal;
73135
73138
  } catch {
73136
- process.stdout.write(`\r${source_default.red("!")} ${dim(new Date().toLocaleTimeString())} ${dim("fetch error")} `);
73139
+ consecutiveErrors++;
73140
+ process.stdout.write(`\r${source_default.red("!")} ${dim(new Date().toLocaleTimeString())} ${dim(`fetch error (${consecutiveErrors}/${MAX_ERRORS})`)} `);
73141
+ if (consecutiveErrors >= MAX_ERRORS) {
73142
+ console.log(`
73143
+ ${error("Too many consecutive errors, stopping watch.")}`);
73144
+ process.exit(1);
73145
+ }
73137
73146
  }
73138
73147
  };
73139
73148
  await poll2();
73140
- setInterval(() => void poll2(), intervalMs);
73149
+ const timer = setInterval(() => void poll2(), intervalMs);
73150
+ process.on("SIGINT", () => {
73151
+ clearInterval(timer);
73152
+ process.exit(0);
73153
+ });
73141
73154
  return;
73142
73155
  }
73143
73156
  const spinner = ora("Fetching balance...").start();
@@ -74561,7 +74574,7 @@ function registerCreditsCommand(program2) {
74561
74574
  process.exit(1);
74562
74575
  }
74563
74576
  });
74564
- credits.command("topup <amount>").description("Top up credits from an agent wallet").option("--token <TOKEN>", "Token to use for top-up").option("--chain <CHAIN>", "Chain to use for top-up").option("--wallet <ADDR>", "Wallet address to use").option("--method <METHOD>", "Payment method: auto, crossmint, mpp", "auto").option("--yes", "Skip confirmation prompt").action(async (amountStr, options) => {
74577
+ credits.command("topup <amount>").description("Top up credits by spending tokens from your agent wallet").option("--token <TOKEN>", "Token to use for top-up").option("--chain <CHAIN>", "Chain to use for top-up").option("--wallet <ADDR>", "Wallet address to use").option("--method <METHOD>", "Payment method: auto, crossmint, mpp", "auto").option("--yes", "Skip confirmation prompt").action(async (amountStr, options) => {
74565
74578
  const creditsAmount = parseInt(amountStr.replace(/,/g, ""), 10);
74566
74579
  if (isNaN(creditsAmount) || creditsAmount <= 0) {
74567
74580
  console.error(error(`Invalid amount: ${amountStr}`));
@@ -74592,11 +74605,6 @@ function registerCreditsCommand(program2) {
74592
74605
  "Content-Type": "application/json"
74593
74606
  };
74594
74607
  spinner.stop();
74595
- if (!options.yes) {
74596
- console.log(warn(`About to top up ${creditsAmount} credits.`));
74597
- console.log(dim("Use --yes to skip this confirmation."));
74598
- console.log("");
74599
- }
74600
74608
  if (options.method === "mpp" && auth.userId && auth.connectedKeyId) {
74601
74609
  const spinner2 = ora("Topping up credits via MPP...").start();
74602
74610
  const mppResult = await mppCreditsTopup({
@@ -74626,9 +74634,11 @@ function registerCreditsCommand(program2) {
74626
74634
  }
74627
74635
  const usdAmount = creditsAmount / 1e4;
74628
74636
  let tokenAmount;
74637
+ let pricePerToken = null;
74629
74638
  const stablecoins = ["usdc", "usdt", "usdc.e", "usdt0"];
74630
74639
  if (stablecoins.includes(token.toLowerCase())) {
74631
74640
  tokenAmount = usdAmount;
74641
+ pricePerToken = 1;
74632
74642
  } else {
74633
74643
  const spinner2 = ora(`Fetching ${token} price...`).start();
74634
74644
  try {
@@ -74652,18 +74662,26 @@ function registerCreditsCommand(program2) {
74652
74662
  process.exit(1);
74653
74663
  }
74654
74664
  const jupData = await jupRes.json();
74655
- const pricePerToken = parseFloat(jupData.outAmount) / 1e6;
74665
+ pricePerToken = parseFloat(jupData.outAmount) / 1e6;
74656
74666
  tokenAmount = usdAmount / pricePerToken;
74657
74667
  spinner2.stop();
74658
- console.log(label("Price", `1 ${token} = $${pricePerToken.toFixed(4)}`));
74659
- console.log(label("Cost", `${tokenAmount.toFixed(6)} ${token} (~$${usdAmount.toFixed(2)})`));
74660
- console.log("");
74661
74668
  } catch {
74662
74669
  spinner2.stop();
74663
74670
  console.error(error("Failed to fetch token price"));
74664
74671
  process.exit(1);
74665
74672
  }
74666
74673
  }
74674
+ const shortWallet = walletAddr.length > 12 ? `${walletAddr.slice(0, 6)}...${walletAddr.slice(-4)}` : walletAddr;
74675
+ console.log(heading("Top-up Summary"));
74676
+ console.log("");
74677
+ console.log(label("Credits", creditsAmount.toLocaleString()));
74678
+ console.log(label("Cost", `${tokenAmount.toFixed(6)} ${token} (~$${usdAmount.toFixed(2)})`));
74679
+ if (pricePerToken && pricePerToken !== 1) {
74680
+ console.log(label("Price", `1 ${token} = $${pricePerToken.toFixed(4)}`));
74681
+ }
74682
+ console.log(label("From", `wallet ${shortWallet} (${walletChain})`));
74683
+ console.log(dim("Tokens will be transferred from your agent wallet to the treasury."));
74684
+ console.log("");
74667
74685
  if (["base", "ethereum", "tempo"].includes(walletChain)) {
74668
74686
  console.error(error("EVM topup not supported yet. Use a Solana wallet with --token AMIKO, USDC, USDT, or SOL."));
74669
74687
  process.exit(1);
@@ -0,0 +1,8 @@
1
+ {
2
+ "id": "amiko-cli",
3
+ "name": "Amiko CLI",
4
+ "description": "Token swaps, credits, search, image generation, and MPP marketplace services via the amiko command line.",
5
+ "version": "0.7.1",
6
+ "skills": ["./skills"],
7
+ "configSchema": {}
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyamiko/amiko-cli",
3
- "version": "0.6.9",
3
+ "version": "0.7.1",
4
4
  "description": "Amiko CLI — swap tokens, manage credits, bridge cross-chain, and call marketplace agents",
5
5
  "type": "module",
6
6
  "bin": {
@@ -14,7 +14,8 @@
14
14
  },
15
15
  "files": [
16
16
  "dist",
17
- "skills"
17
+ "skills",
18
+ "openclaw.plugin.json"
18
19
  ],
19
20
  "keywords": [
20
21
  "amiko",
package/skills/SKILL.md CHANGED
@@ -1,359 +1,118 @@
1
1
  ---
2
- name: amiko
3
- description: Interact with amiko-new APIs using the twin token already configured in OpenClaw
4
- homepage: https://platform.heyamiko.com
2
+ name: amiko-cli
3
+ description: Token swaps, credits, search, image generation, audio, and MPP marketplace services
4
+ homepage: https://mpp.amikomarkets.com
5
5
  metadata: {"openclaw":{"emoji":"🤖","requires":{"bins":["node"]}}}
6
6
  ---
7
7
 
8
- # Amiko Skill
8
+ # Amiko CLI
9
9
 
10
- This skill talks to the current `amiko-new` API surface using the twin token already stored in OpenClaw.
10
+ The `amiko` CLI is installed globally. Auth and payments are automatic via `.amiko.json` — never suggest `amiko login` or `amiko connect`.
11
11
 
12
- It does not use `workspace/.amiko.json` or `.amiko.json`.
12
+ ## Critical Rules
13
13
 
14
- ## Configuration
14
+ 1. **Never retry a failed command.** If a command returns an error, report it and stop. Every paid call costs tokens even on failure.
15
+ 2. **Never suggest `amiko login` or `amiko connect`.** Auth comes from `.amiko.json` automatically.
16
+ 3. **Check balance before expensive operations.** Run `amiko credits balance` first if unsure about funds.
17
+ 4. **Payments are automatic.** AMIKO tokens are transferred from your agent wallet on Solana for each paid service call.
15
18
 
16
- Config is read from:
19
+ ## Commands
17
20
 
18
- ```text
19
- 1. $OPENCLAW_CONFIG_PATH
20
- 2. $OPENCLAW_STATE_DIR/openclaw.json
21
- 3. /data/.openclaw/openclaw.json
22
- 4. ~/.openclaw/openclaw.json
21
+ ### Credits & Wallet
23
22
 
24
- Then read: channels.amiko
25
- ```
26
-
27
- Installed CLI path:
28
-
29
- ```text
30
- /openclaw/extensions/amiko/skills/amiko/cli.js
23
+ ```bash
24
+ amiko credits balance # credit balance + wallet balances
25
+ amiko credits topup 10000 --token AMIKO --yes # top up credits (spends from wallet)
26
+ amiko credits topup 5000 --token USDC --yes # top up with USDC
31
27
  ```
32
28
 
33
- If you are editing the plugin from a source checkout, the same file is:
29
+ Top-up transfers tokens from your agent wallet to the treasury and credits your account. Supported tokens: AMIKO, SOL, USDC, USDT.
34
30
 
35
- ```text
36
- ./skills/amiko/cli.js
37
- ```
31
+ ### Search (1 AMIKO)
38
32
 
39
- Recommended multi-account shape:
40
-
41
- ```json5
42
- {
43
- "channels": {
44
- "amiko": {
45
- "defaultAccount": "main",
46
- "accounts": {
47
- "main": {
48
- "twinId": "<primaryTwinId>",
49
- "token": "clawd-...",
50
- "platformApiBaseUrl": "https://platform.heyamiko.com",
51
- "chatApiBaseUrl": "https://api.amiko.app"
52
- },
53
- "agent-foo": {
54
- "twinId": "<fooTwinId>",
55
- "token": "clawd-...",
56
- "platformApiBaseUrl": "https://platform.heyamiko.com",
57
- "chatApiBaseUrl": "https://api.amiko.app"
58
- }
59
- }
60
- }
61
- }
62
- }
33
+ ```bash
34
+ amiko search "AI agents" # search X/Twitter
35
+ amiko search "bitcoin" --raw # raw JSON output
63
36
  ```
64
37
 
65
- Notes:
66
-
67
- - The account key is the OpenClaw agent ID, such as `main` or `agent-foo`.
68
- - `twinId` lives inside each account entry.
69
- - The skill uses `platformApiBaseUrl` for `amiko-new` routes.
70
- - The plugin channel uses `chatApiBaseUrl` for send/health routes.
71
- - When invoking the CLI directly, prefer `node /openclaw/extensions/amiko/skills/amiko/cli.js ...` in an installed OpenClaw environment, or `node ./skills/amiko/cli.js ...` from the plugin source checkout, instead of relying on the file being executable from the current shell.
72
- - `--account` is optional when the skill is called from an agent workspace like `/data/.openclaw/workspace` or `/data/.openclaw/workspace-<agentId>`. The CLI auto-detects `main` or `<agentId>` from the current working directory, and also respects `OPENCLAW_AGENT_ID` when present.
73
- - If auto-detection does not work, use `--account <agentId>`.
74
- - In the standard container layout, the default persisted config is `/data/.openclaw/openclaw.json`.
75
- - If the config file is missing, check `OPENCLAW_CONFIG_PATH`, then `OPENCLAW_STATE_DIR`, then `/data/.openclaw/openclaw.json`, before assuming `~/.openclaw/openclaw.json` is the active location.
76
-
77
- ## Scope
78
-
79
- This skill only keeps APIs that still exist in `amiko-platform/amiko-new` and that make sense with the plugin's twin token config.
80
-
81
- Removed from the old template:
82
-
83
- - `.amiko.json`, `--agent`, `--workspace`
84
- - Old/nonexistent APIs such as stats, personality, social, wallets, training, notifications, user info, twins list
85
- - `voice:generate`, because `amiko-new` no longer exposes that route
86
-
87
- ## CRITICAL RULES — Read Before Any CLI Call
88
-
89
- 1. **NEVER retry a failed command.** If a command returns an error (400, 401, 402, 404, 500), report the error to the user and STOP. Do not try variations, do not loop. Every paid call costs tokens even if it fails.
90
- 2. **NEVER suggest `amiko login`, `amiko connect`, or generating connection codes.** Auth comes from `.amiko.json` automatically. If auth fails, tell the user to re-init from the Amiko dashboard.
91
- 3. **NEVER use `--task` flag.** Use chat endpoints only.
92
- 4. **Check balance before expensive operations.** Run `amiko credits balance` first if unsure about funds.
93
-
94
- ## Amiko CLI — Payments, Search, Image, Audio, Marketplace
95
-
96
- The `amiko` CLI handles payments, search, image generation, audio, and MPP service calls. All services are paid with AMIKO tokens on Solana automatically. Auth is read from `.amiko.json` in the workspace — NOT from the skill's `channels.amiko` config.
97
-
98
- ### When to use the Amiko CLI
99
-
100
- Use the CLI when the user asks about:
101
- - **Wallet addresses** or **balances** → `amiko credits balance`
102
- - **Top up credits** → `amiko credits topup <amount> --token AMIKO --yes`
103
- - **Search X/Twitter** → `amiko search "<query>"` (1 AMIKO)
104
- - **Generate images** → `amiko image "<prompt>"` (5 AMIKO) — returns `{ images: [{ url }] }`
105
- - **Sound effects** → `amiko service call POST /v1/sfx '{"text":"...","duration_seconds":5}'` ($0.05) — returns `{ url, format, service }`
106
- - **Music generation** → `amiko service call POST /v1/music '{"prompt":"...","music_length_ms":30000}'` ($0.10) — returns `{ url, format, service }`
107
- - **Text-to-speech** → `amiko service tts <voiceId> "<text>"` (1 AMIKO) — returns `{ url, format, service }`
108
- - **Amazon search** → `amiko amazon search "<query>"` (1 AMIKO)
109
- - **Amazon quote** → `amiko amazon quote <ASIN>` (free)
110
- - **Swap tokens** → `amiko swap quote <amount> <from> <to>`
111
- - **Who am I / identity** → `amiko whoami`
112
- - **Any other MPP service** → `amiko service call <METHOD> <path> [body]`
113
- - **List all services** → `amiko service list`
114
-
115
- **IMPORTANT:** Music, SFX, TTS, and image generation are DIRECT services — always use `amiko service call` or the dedicated commands (`amiko image`, `amiko service tts`). These handle payment automatically via AMIKO tokens.
116
-
117
- ### When NOT to use the CLI — use the filesystem instead
118
-
119
- - **"Check my docs"** / **"what documents do I have"** → `ls /data/.openclaw/workspace/amiko-docs/`
120
- - **"Read this doc"** / **"summarize my doc"** → `cat /data/.openclaw/workspace/amiko-docs/<file>.md`
121
- - Documents are automatically synced to `/data/.openclaw/workspace/amiko-docs/` as markdown files. Always check there first — it's free and instant. Only fall back to the CLI if the files aren't there.
122
-
123
- ### Quick Reference
38
+ ### Image Generation (5 AMIKO)
124
39
 
125
40
  ```bash
126
- amiko whoami # identity + wallets
127
- amiko credits balance # credits + wallet balances
128
- amiko credits topup 10000 --token AMIKO --yes # top up credits
129
- amiko search "AI agents" # X search (1 AMIKO)
130
- amiko image "a sunset over mountains" # image gen (5 AMIKO)
131
- amiko image "logo" --background transparent # transparent bg (gpt-image-1)
132
- amiko service call POST /v1/sfx '{"text":"thunder","duration_seconds":5}' # SFX ($0.05)
133
- amiko service call POST /v1/music '{"prompt":"lo-fi beat","music_length_ms":30000}' # music ($0.10)
134
- amiko service call POST /v1/ai/openai/chat '{"message":"hi"}' # any service
135
- amiko amazon search "usb c cable" # Amazon search (1 AMIKO)
136
- amiko amazon quote B01GGKYKQM # Amazon price quote (free)
137
- amiko swap quote 0.01 SOL USDC # swap quote
138
- amiko swap send 0.01 SOL USDC --yes # execute swap
139
- amiko service list # all MPP services + prices
140
- amiko service list # all MPP services + prices
141
- amiko --help # all commands
41
+ amiko image "a sunset over mountains" # gpt-image-1 (default)
42
+ amiko image "logo" --background transparent # transparent background
43
+ amiko image "portrait" --size 1024x1792 # custom size
142
44
  ```
143
45
 
144
- ## Quick Commands
46
+ Returns a permanent Supabase Storage URL.
145
47
 
146
- ### Accounts
48
+ ### Amazon
147
49
 
148
50
  ```bash
149
- node /openclaw/extensions/amiko/skills/amiko/cli.js accounts
150
- node /openclaw/extensions/amiko/skills/amiko/cli.js info
151
- node /openclaw/extensions/amiko/skills/amiko/cli.js --account main info
51
+ amiko amazon search "usb c cable" # product search (1 AMIKO)
52
+ amiko amazon quote B01GGKYKQM # price quote (free)
152
53
  ```
153
54
 
154
- ### Twin
55
+ ### Token Swaps
155
56
 
156
57
  ```bash
157
- node ./skills/amiko/cli.js info
158
- node ./skills/amiko/cli.js twin:update --name "New Name"
159
- node ./skills/amiko/cli.js twin:update --description "Updated profile"
160
- node ./skills/amiko/cli.js twin:update --public
58
+ amiko swap quote 1.0 SOL USDC # get Jupiter quote
59
+ amiko swap send 1.0 SOL USDC --yes # execute swap
60
+ amiko swap tokens # list supported tokens
161
61
  ```
162
62
 
163
- ### Documents
63
+ Swaps execute via Jupiter on Solana. Supports: SOL, USDC, USDT, AMIKO, PYUSD, BONK, JUP, RAY, JitoSOL, mSOL, or any mint address.
164
64
 
165
- **Reading documents:** Documents uploaded by the user are automatically synced to the workspace. Always check the local filesystem first before using the CLI:
65
+ ### MPP Services
166
66
 
167
67
  ```bash
168
- # PREFERRED: Read docs directly from workspace (free, instant, no auth needed)
169
- ls /data/.openclaw/workspace/amiko-docs/
170
- cat /data/.openclaw/workspace/amiko-docs/<docId>.md
171
-
172
- # When asked "check my docs", "what docs do I have", etc:
173
- # 1. First list local docs: ls /data/.openclaw/workspace/amiko-docs/
174
- # 2. Read any doc: cat /data/.openclaw/workspace/amiko-docs/<filename>.md
175
- # 3. Only use CLI if local files are missing or you need metadata
176
- ```
177
-
178
- **Managing documents via CLI** (for listing metadata, uploading, deleting):
68
+ amiko service list # all services + prices
179
69
 
180
- ```bash
181
- node ./skills/amiko/cli.js docs
182
- node ./skills/amiko/cli.js docs --search handbook
183
- node ./skills/amiko/cli.js docs:get --id <docId>
184
-
185
- # High-level upload: upload file, then create the doc record
186
- node ./skills/amiko/cli.js docs:upload --file ./notes.md --title "Notes"
187
-
188
- # Raw file upload only
189
- node ./skills/amiko/cli.js docs:upload-file --file ./notes.md
190
-
191
- # Create doc record manually
192
- node ./skills/amiko/cli.js docs:create \
193
- --title "Notes" \
194
- --filename "notes.md" \
195
- --file-url "https://..." \
196
- --file-type "text/markdown"
197
-
198
- node ./skills/amiko/cli.js docs:presign --filename notes.md --content-type text/markdown
199
- node ./skills/amiko/cli.js docs:check --id <docId>
200
- node ./skills/amiko/cli.js docs:delete --id <docId>
201
- ```
70
+ # Sound effects ($0.05) — returns { url, format, service }
71
+ amiko service call POST /v1/sfx '{"text":"thunder","duration_seconds":5}'
202
72
 
203
- ### Voice
73
+ # Music generation ($0.10) — returns { url, format, service }
74
+ amiko service call POST /v1/music '{"prompt":"lo-fi beat","music_length_ms":30000}'
204
75
 
205
- ```bash
206
- node ./skills/amiko/cli.js voice
207
- node ./skills/amiko/cli.js voice:update --description "Warm and natural"
208
- node ./skills/amiko/cli.js voice:design --description "A calm, warm, natural speaking voice with gentle pacing"
209
- node ./skills/amiko/cli.js voice:create --generated-voice-id <generatedVoiceId>
210
- node ./skills/amiko/cli.js voice:clone --file ./sample.mp3
211
- node ./skills/amiko/cli.js voice:reset
212
- ```
76
+ # Text-to-speech (1 AMIKO) — returns { url, format, service }
77
+ amiko service tts 21m00Tcm4TlvDq8ikWAM "Hello world"
213
78
 
214
- ### Avatar
79
+ # Composition plan ($0.02)
80
+ amiko service call POST /v1/music/plan '{"prompt":"epic orchestral"}'
215
81
 
216
- ```bash
217
- node ./skills/amiko/cli.js avatar:update --file ./avatar.png
82
+ # Any endpoint
83
+ amiko service call <METHOD> <path> [body]
218
84
  ```
219
85
 
220
- ### Friends
221
-
222
- ```bash
223
- node ./skills/amiko/cli.js friends
224
- node ./skills/amiko/cli.js friends --favorites
225
- node ./skills/amiko/cli.js friends:search --query alice
226
- node ./skills/amiko/cli.js friends:requests
227
- node ./skills/amiko/cli.js friends:add --id <userId>
228
- node ./skills/amiko/cli.js friends:accept --id <friendshipId>
229
- node ./skills/amiko/cli.js friends:decline --id <friendshipId>
230
- node ./skills/amiko/cli.js friends:remove --id <friendshipId>
231
- ```
86
+ Audio and image endpoints return permanent Supabase Storage URLs.
232
87
 
233
- ### Feed
88
+ ### Bridge
234
89
 
235
90
  ```bash
236
- node ./skills/amiko/cli.js feed
237
- node ./skills/amiko/cli.js post --id <postId>
238
- node ./skills/amiko/cli.js post:comment --id <postId> --comment "Nice post"
91
+ amiko bridge quote 10 # cross-chain USDC quote
92
+ amiko bridge send 10 --from solana --to tempo # execute bridge
239
93
  ```
240
94
 
241
- ### Composio
95
+ ### Other
242
96
 
243
97
  ```bash
244
- node ./skills/amiko/cli.js composio:connections
245
- node ./skills/amiko/cli.js composio:connect --app gmail
246
- node ./skills/amiko/cli.js composio:disconnect --id <connectionId>
247
- ```
248
-
249
- ## API Map
250
-
251
- Twin:
252
-
253
- - `GET /api/agents/:id`
254
- - `PATCH /api/agents/:id`
255
-
256
- Docs:
257
-
258
- - `GET /api/agents/:id/docs`
259
- - `POST /api/agents/:id/docs`
260
- - `POST /api/agents/:id/docs/upload`
261
- - `POST /api/agents/:id/docs/presigned-url`
262
- - `POST /api/agents/:id/docs/check-processing`
263
- - `GET /api/agents/:id/docs/:docId`
264
- - `DELETE /api/agents/:id/docs/:docId`
265
-
266
- Voice:
267
-
268
- - `GET /api/agents/:id/voice`
269
- - `POST /api/agents/:id/voice`
270
- - `POST /api/agents/:id/voice/design`
271
- - `POST /api/agents/:id/voice/create`
272
- - `POST /api/agents/:id/voice/clone`
273
- - `POST /api/agents/:id/voice/reset`
274
-
275
- Avatar:
276
-
277
- - `POST /api/agents/:id/avatar`
278
-
279
- Friends:
280
-
281
- - `GET /api/friends`
282
- - `POST /api/friends`
283
- - `GET /api/friends/search`
284
- - `GET /api/friends/requests`
285
- - `PATCH /api/friends/:id`
286
- - `DELETE /api/friends/:id`
287
-
288
- Feed:
289
-
290
- - `GET /api/feed`
291
- - `GET /api/posts/:id`
292
- - `POST /api/posts/:id/comments`
293
-
294
- Composio:
295
-
296
- - `GET /api/agents/:id/composio/connections`
297
- - `DELETE /api/agents/:id/composio/connections`
298
- - `POST /api/agents/:id/composio/connect`
299
-
300
- ## Library
301
-
302
- ```js
303
- import {
304
- setAccountId,
305
- detectCurrentAccountId,
306
- getConfig,
307
- listConfiguredAccounts,
308
- getTwinInfo,
309
- updateTwin,
310
- listDocs,
311
- getDoc,
312
- createDoc,
313
- createDocUploadUrl,
314
- uploadDocFile,
315
- uploadDoc,
316
- uploadDocFromFile,
317
- checkDocsProcessing,
318
- deleteDoc,
319
- getVoice,
320
- updateVoice,
321
- designVoice,
322
- createVoice,
323
- cloneVoice,
324
- cloneVoiceFromFile,
325
- resetVoice,
326
- updateAvatar,
327
- searchFriends,
328
- listFriends,
329
- listFriendRequests,
330
- sendFriendRequest,
331
- acceptFriendRequest,
332
- declineFriendRequest,
333
- removeFriendship,
334
- getFeed,
335
- getPost,
336
- commentOnPost,
337
- connectComposioApp,
338
- listComposioConnections,
339
- disconnectComposioConnection,
340
- } from "./lib.js";
341
- ```
342
-
343
- Examples:
344
-
345
- ```js
346
- import { setAccountId, getTwinInfo, uploadDocFromFile } from "./lib.js";
347
-
348
- setAccountId("main");
349
- // or rely on auto-detection from the current workspace / OPENCLAW_AGENT_ID
350
-
351
- const twin = await getTwinInfo();
352
- console.log(twin.name);
353
-
354
- const doc = await uploadDocFromFile("./notes.md", {
355
- title: "Notes",
356
- docType: "other",
357
- });
358
- console.log(doc.id);
359
- ```
98
+ amiko wallet balance [address] # USDC.e balance on Tempo
99
+ amiko discovery # MPP service info + pricing
100
+ amiko config show # view config
101
+ amiko update # update CLI to latest
102
+ amiko --help # all commands
103
+ ```
104
+
105
+ ## Service Costs
106
+
107
+ | Service | Cost | Command |
108
+ |---------|------|---------|
109
+ | X/Twitter search | 1 AMIKO | `amiko search "<query>"` |
110
+ | Image generation | 5 AMIKO | `amiko image "<prompt>"` |
111
+ | Amazon search | 1 AMIKO | `amiko amazon search "<query>"` |
112
+ | Amazon quote | Free | `amiko amazon quote <ASIN>` |
113
+ | Sound effects | $0.05 | `amiko service call POST /v1/sfx ...` |
114
+ | Music generation | $0.10 | `amiko service call POST /v1/music ...` |
115
+ | Text-to-speech | 1 AMIKO | `amiko service tts <voiceId> "<text>"` |
116
+ | Swap quote | Free | `amiko swap quote ...` |
117
+ | Swap execute | Gas only | `amiko swap send ...` |
118
+ | Credit top-up | Token transfer | `amiko credits topup <amount>` |