@heyamiko/amiko-cli 0.7.3 → 0.7.8

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,4 +1,4 @@
1
- # @heyamiko/amiko-cli (v0.7.0)
1
+ # @heyamiko/amiko-cli (v0.7.8)
2
2
 
3
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
 
@@ -63,23 +63,43 @@ amiko whoami # show current auth status
63
63
 
64
64
  ```bash
65
65
  amiko credits balance # credit balance + wallet balances across all chains
66
- amiko credits topup <amount> # top up credits (amount in credits, e.g. 10000)
66
+ amiko credits topup <amount> # top up credits (positional amount is credits)
67
67
  ```
68
68
 
69
- **Top-up options:**
69
+ **10,000 credits = $1.00 USD.**
70
+
71
+ **Three input forms — pick one.** The topup command accepts exactly one of:
72
+
73
+ | Form | Meaning | Example |
74
+ |------|---------|---------|
75
+ | `<amount>` (positional) | credits | `topup 10000 --token AMIKO` → 10,000 credits = $1 |
76
+ | `--usd <n>` | US dollars | `topup --usd 5 --token USDC` → $5 = 50,000 credits |
77
+ | `--spend <n>` | spend N of `--token`, price-converted live | `topup --spend 1 --token SOL` → "1 SOL worth of credits" |
78
+
79
+ Map user intent directly to the form, no manual price math needed:
80
+
81
+ ```bash
82
+ amiko credits topup --spend 1 --token SOL # "1 SOL worth of credits"
83
+ amiko credits topup --spend 1 --token USDC # "1 USDC worth of credits"
84
+ amiko credits topup --usd 5 --token USDC # "$5 worth of credits"
85
+ amiko credits topup 10000 --token AMIKO # 10,000 credits in AMIKO
86
+ ```
87
+
88
+ **Confirmation.** Every topup prints a `Top-up Summary` (credits, cost in tokens, USD, source wallet) and then waits at `Proceed? [y/N]` on stdin. Pass `--yes` to skip (only after you've shared the summary with the user).
89
+
90
+ **Other flags:**
70
91
 
71
92
  ```bash
72
- amiko credits topup 10000 # auto-select best wallet + token
73
- amiko credits topup 10000 --token AMIKO # use AMIKO (Solana)
74
- amiko credits topup 10000 --token USDC --chain base # use USDC on Base
75
- amiko credits topup 5000 --method mpp # use MPP 402 payment
76
- amiko credits topup 10000 --wallet Gu2b...QVya # specific wallet address
77
- amiko credits topup 10000 --yes # skip confirmation
93
+ amiko credits topup 10000 --token USDC --chain base # USDC on Base
94
+ amiko credits topup 5000 --method mpp # MPP 402 payment
95
+ amiko credits topup 10000 --wallet Gu2b...QVya # specific wallet
78
96
  ```
79
97
 
80
98
  **Supported tokens:** AMIKO, SOL, USDC, USDT
81
99
  **Supported chains:** Solana, Base, Ethereum, Tempo
82
100
 
101
+ **After every paid command, the CLI prints a `Balance: N credits (~$X.XX)` line** so agents can relay the remaining balance to the user without a separate `credits balance` call.
102
+
83
103
  ## Search
84
104
 
85
105
  ```bash
@@ -103,6 +123,8 @@ amiko image "banner" --raw # raw JSON
103
123
 
104
124
  Costs 5 AMIKO per image. Returns a Supabase Storage URL.
105
125
 
126
+ Image generation typically takes 20–60s. In non-TTY environments (agents, piped shells), the CLI prints a `…still working (Ns elapsed)` tick to stderr every 3s so the parent process can tell it hasn't hung.
127
+
106
128
  ## Amazon
107
129
 
108
130
  ```bash
@@ -167,6 +189,19 @@ amiko service call POST /v1/music/plan '{"prompt":"Epic orchestral piece"}'
167
189
 
168
190
  Audio and image endpoints upload to Supabase Storage and return permanent URLs.
169
191
 
192
+ ## Error Output
193
+
194
+ When a paid command fails (payment already sent, but the upstream service returned 4xx/5xx), the CLI prints the actual upstream response body so you can see the real failure reason:
195
+
196
+ ```
197
+ Service call failed: 400 Bad Request
198
+ Response body:
199
+ Prompt failed upstream content moderation. Try rephrasing.
200
+ Payment tx: https://solscan.io/tx/2mtcNTkYksJz2j15...
201
+ ```
202
+
203
+ JSON `error` / `message` / `detail` fields are extracted when present; raw body up to 2000 chars otherwise. Agents should relay this verbatim to the user instead of guessing at reasons.
204
+
170
205
  ## Wallet
171
206
 
172
207
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heyamiko/amiko-cli",
3
- "version": "0.7.3",
3
+ "version": "0.7.8",
4
4
  "description": "Amiko CLI — swap tokens, manage credits, bridge cross-chain, and call marketplace agents",
5
5
  "type": "module",
6
6
  "bin": {
package/skills/SKILL.md CHANGED
@@ -15,29 +15,58 @@ The `amiko` CLI is installed globally. Auth and payments are automatic via `.ami
15
15
 
16
16
  ## Critical Rules
17
17
 
18
- 1. **Always confirm before spending.** Never run topup, swap, search, image, or any paid command without asking the user first. Show them what it will cost and wait for explicit approval.
19
- 2. **Never retry a failed command.** If a command returns an error, report it and stop. Every paid call costs tokens even on failure.
20
- 3. **Never suggest `amiko login` or `amiko connect`.** These commands don't exist. Auth is automatic via `.amiko.json`.
21
- 4. **Check balance before expensive operations.** Run `amiko credits balance` first if unsure about funds.
22
- 5. **Payments are automatic.** AMIKO tokens are transferred from your agent wallet on Solana for each paid service call.
18
+ 1. **Always confirm the price with the user BEFORE running any paid command.** This is non-negotiable. For every one of: `topup`, `search`, `image`, `amazon search`, `service call`, `service tts`, `swap send` — you must first quote the exact cost in the relevant unit (AMIKO, $USD, or gas), wait for the user's explicit "yes" / "go ahead" / "do it", and only then run the command. Do not pre-empt; do not batch multiple paid calls; do not use `--yes` unless the user has just approved this specific call.
19
+ 2. **After every paid command, report the remaining balance to the user.** The CLI now prints a `Balance: N credits (~$X.XX)` line at the end of every paid command. Include that figure in your reply so the user knows what they have left.
20
+ 3. **Never retry a failed command.** If a command returns an error, report it and stop. Every paid call costs tokens even on failure.
21
+ 4. **Never suggest `amiko login` or `amiko connect`.** These commands don't exist. Auth is automatic via `.amiko.json`.
22
+ 5. **Check balance before expensive operations.** Run `amiko credits balance` first if unsure about funds.
23
+ 6. **Payments are automatic.** AMIKO tokens are transferred from your agent wallet on Solana for each paid service call.
24
+
25
+ ### Pricing cheat sheet (quote this to the user before running)
26
+
27
+ | Command | Cost |
28
+ |---------|------|
29
+ | `amiko search "<query>"` | 1 AMIKO |
30
+ | `amiko image "<prompt>"` | 5 AMIKO |
31
+ | `amiko amazon search "<query>"` | 1 AMIKO |
32
+ | `amiko amazon quote <ASIN>` | Free |
33
+ | `amiko service tts <voiceId> "<text>"` | 1 AMIKO |
34
+ | `amiko service call POST /v1/sfx ...` | $0.05 |
35
+ | `amiko service call POST /v1/music ...` | $0.10 |
36
+ | `amiko service call POST /v1/music/plan ...` | $0.02 |
37
+ | `amiko swap quote ...` | Free |
38
+ | `amiko swap send ...` | Solana gas only |
39
+ | `amiko credits topup ...` | Whatever amount you top up |
23
40
 
24
41
  ## Commands
25
42
 
26
43
  ### Credits & Wallet
27
44
 
28
- **Credits are NOT tokens.** 10,000 credits = $1.00 USD. The `topup` command's `<amount>` argument is always in **credits**, not tokens.
45
+ **Credits are NOT tokens.** 10,000 credits = $1.00 USD.
29
46
 
30
- **When the user says "top up X AMIKO" or "top up X dollars"** — they mean spend that amount of tokens/dollars. You must convert to credits first:
31
- - "top up 1 AMIKO" → check AMIKO price (~$0.04), so 1 AMIKO ≈ $0.04 ≈ 400 credits → `amiko credits topup 400 --token AMIKO --yes`
32
- - "top up $5" → $5 = 50,000 credits → `amiko credits topup 50000 --token AMIKO --yes`
33
- - "top up 10000 credits" → already in credits → `amiko credits topup 10000 --token AMIKO --yes`
47
+ The `topup` command accepts **one** of three amount forms:
34
48
 
35
- Always clarify with the user: "That's X credits (≈$Y), paying Z AMIKO from your wallet. Proceed?"
49
+ | Form | Meaning | Example |
50
+ |------|---------|---------|
51
+ | `<amount>` (positional) | credits | `amiko credits topup 10000 --token AMIKO` → 10,000 credits = $1 |
52
+ | `--usd <n>` | US dollars | `amiko credits topup --usd 5 --token USDC` → $5 = 50,000 credits |
53
+ | `--spend <n>` | spend N of `--token` | `amiko credits topup --spend 1 --token SOL` → "1 SOL worth of credits" |
54
+
55
+ **Map user intent directly to the right form** — no manual price math needed:
56
+
57
+ - "top up 1 SOL of credits" → `amiko credits topup --spend 1 --token SOL`
58
+ - "top up 1 USDC worth of credits" → `amiko credits topup --spend 1 --token USDC`
59
+ - "top up 1 AMIKO" → `amiko credits topup --spend 1 --token AMIKO`
60
+ - "top up $5 in USDC" → `amiko credits topup --usd 5 --token USDC`
61
+ - "top up 10000 credits with AMIKO" → `amiko credits topup 10000 --token AMIKO`
62
+
63
+ **Always confirm with the user before running.** The CLI prints a `Top-up Summary` (credits, cost in tokens, USD, wallet) and then prompts `Proceed? [y/N]`. Do NOT pass `--yes` unless the user has explicitly approved the summary.
36
64
 
37
65
  ```bash
38
- amiko credits balance # credit balance + wallet balances
39
- amiko credits topup 10000 --token AMIKO --yes # buy 10,000 credits (~$1) paying in AMIKO
40
- amiko credits topup 50000 --token USDC --yes # buy 50,000 credits (~$5) paying in USDC
66
+ amiko credits balance # credit balance + wallet balances
67
+ amiko credits topup --spend 1 --token SOL # "1 SOL worth of credits" — prompts
68
+ amiko credits topup --usd 5 --token USDC # $5 paying in USDC — prompts
69
+ amiko credits topup 10000 --token AMIKO --yes # skip prompt (only after user approved summary)
41
70
  ```
42
71
 
43
72
  **How topup works:**