@heyamiko/amiko-cli 0.8.4 → 0.9.0-beta.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.
Files changed (3) hide show
  1. package/README.md +58 -45
  2. package/dist/index.js +480 -937
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @heyamiko/amiko-cli (v0.8.4)
1
+ # @heyamiko/amiko-cli (v0.9.0-beta.0)
2
2
 
3
3
  Manage wallets, credits, swaps, MPP marketplace services, and your Amiko twin (identity, documents, voice, avatar, friends, feed, Composio apps) from the terminal. Works for both human users and AI agents running on OpenClaw.
4
4
 
@@ -16,28 +16,37 @@ amiko update
16
16
 
17
17
  ## Quick Start
18
18
 
19
- Auth is automatic on twins and OpenClaw agents via `.amiko.json`. On a local machine, generate an API key from your Amiko settings and place it in `~/.amiko/config.json` as `apiKey`.
19
+ Auth is loaded from `.amiko.json` found in the current working directory (or any parent). The only required field is `amikoTwinToken`. The CLI walks upward from cwd; if none is found it falls back to `/data/.openclaw/workspace/.amiko.json`.
20
+
21
+ ```json
22
+ {
23
+ "amikoTwinToken": "clawd-...",
24
+ "amikoTwinId": "twin_..."
25
+ }
26
+ ```
27
+
28
+ All paid operations (credits topup, wallet transfer, swap) are signed by the Amiko platform on your behalf — the CLI never holds private keys.
20
29
 
21
30
  ```bash
22
31
  # Check your balance
23
32
  amiko credits balance
24
33
 
25
- # Top up credits from your agent's wallet
34
+ # Top up credits (platform signs the transfer from your agent wallet)
26
35
  amiko credits topup 10000 --token AMIKO --yes
27
36
 
28
- # Search X/Twitter (1 AMIKO)
29
- amiko search "AI agents"
37
+ # Search X/Twitter (1 AMIKO, pass --wallet)
38
+ amiko market search "AI agents" --wallet <solana-address>
30
39
 
31
40
  # Generate an image (5 AMIKO)
32
- amiko image "a sunset over mountains"
41
+ amiko market image "a sunset over mountains" --wallet <solana-address>
33
42
 
34
43
  # Swap tokens on Solana
35
44
  amiko swap quote 1.0 SOL USDC
36
45
  amiko swap send 1.0 SOL USDC --yes
37
46
 
38
47
  # Call any MPP service
39
- amiko service list
40
- amiko service call POST /v1/sfx '{"text":"thunder","duration_seconds":5}'
48
+ amiko market service list
49
+ amiko market service call POST /v1/sfx '{"text":"thunder","duration_seconds":5}'
41
50
  ```
42
51
 
43
52
  ## Credits
@@ -84,9 +93,9 @@ amiko credits topup 10000 --wallet Gu2b...QVya # specific wallet
84
93
  ## Search
85
94
 
86
95
  ```bash
87
- amiko search "AI agents" # search X/Twitter (1 AMIKO)
88
- amiko search "bitcoin" --token USDC # pay with USDC instead
89
- amiko search "news" --raw # raw JSON output
96
+ amiko market search "AI agents" # search X/Twitter (1 AMIKO)
97
+ amiko market search "bitcoin" --token USDC # pay with USDC instead
98
+ amiko market search "news" --raw # raw JSON output
90
99
  ```
91
100
 
92
101
  Pays 1 AMIKO per search via Crossmint wallet transfer. Tries Solana wallet first, falls back to EVM.
@@ -94,12 +103,12 @@ Pays 1 AMIKO per search via Crossmint wallet transfer. Tries Solana wallet first
94
103
  ## Image Generation
95
104
 
96
105
  ```bash
97
- amiko image "a sunset over mountains" # gpt-image-1 (default)
98
- amiko image "logo" --background transparent # transparent background
99
- amiko image "cat" --model dall-e-3 # DALL-E 3
100
- amiko image "portrait" --size 1024x1792 --quality high # portrait, high quality
101
- amiko image "icon" --format webp # webp output
102
- amiko image "banner" --raw # raw JSON
106
+ amiko market image "a sunset over mountains" # gpt-image-1 (default)
107
+ amiko market image "logo" --background transparent # transparent background
108
+ amiko market image "cat" --model dall-e-3 # DALL-E 3
109
+ amiko market image "portrait" --size 1024x1792 --quality high # portrait, high quality
110
+ amiko market image "icon" --format webp # webp output
111
+ amiko market image "banner" --raw # raw JSON
103
112
  ```
104
113
 
105
114
  Costs 5 AMIKO per image. Returns a Supabase Storage URL.
@@ -109,8 +118,8 @@ Image generation typically takes 20–60s. In non-TTY environments (agents, pipe
109
118
  ## Amazon
110
119
 
111
120
  ```bash
112
- amiko amazon search "usb c cable" # product search (1 AMIKO)
113
- amiko amazon quote B01GGKYKQM # price quote (free)
121
+ amiko market amazon search "usb c cable" # product search (1 AMIKO)
122
+ amiko market amazon quote B01GGKYKQM # price quote (free)
114
123
  ```
115
124
 
116
125
  ## Swap
@@ -149,24 +158,24 @@ Default route: Solana → Tempo. Use `--from` and `--to` flags for other chains.
149
158
  Call any endpoint on the Amiko marketplace with automatic AMIKO payment:
150
159
 
151
160
  ```bash
152
- amiko service list # all services + prices
153
- amiko service call <METHOD> <path> [body]
161
+ amiko market service list # all services + prices
162
+ amiko market service call <METHOD> <path> [body]
154
163
  ```
155
164
 
156
165
  **Examples:**
157
166
 
158
167
  ```bash
159
168
  # Sound effects ($0.05) — returns { url, format, service }
160
- amiko service call POST /v1/sfx '{"text":"Thunder with heavy rain","duration_seconds":5}'
169
+ amiko market service call POST /v1/sfx '{"text":"Thunder with heavy rain","duration_seconds":5}'
161
170
 
162
171
  # Music generation ($0.10) — returns { url, format, service }
163
- amiko service call POST /v1/music '{"prompt":"Lo-fi chill beat","music_length_ms":30000}'
172
+ amiko market service call POST /v1/music '{"prompt":"Lo-fi chill beat","music_length_ms":30000}'
164
173
 
165
174
  # Text-to-speech (1 AMIKO) — returns { url, format, service }
166
- amiko service tts 21m00Tcm4TlvDq8ikWAM "Hello world"
175
+ amiko market service tts 21m00Tcm4TlvDq8ikWAM "Hello world"
167
176
 
168
177
  # Composition plan ($0.02)
169
- amiko service call POST /v1/music/plan '{"prompt":"Epic orchestral piece"}'
178
+ amiko market service call POST /v1/music/plan '{"prompt":"Epic orchestral piece"}'
170
179
  ```
171
180
 
172
181
  Audio and image endpoints upload to Supabase Storage and return permanent URLs.
@@ -185,7 +194,7 @@ Every paid / value-moving command (`image`, `search`, `amazon search`, `service
185
194
  Action: Generate image: a sunset over mountains
186
195
 
187
196
  Quote the cost to the user, get their explicit approval, then re-run with --yes:
188
- amiko image "a sunset over mountains" --yes
197
+ amiko market image "a sunset over mountains" --yes
189
198
  ```
190
199
 
191
200
  This makes cost confirmation effectively mandatory regardless of which model drives the agent — weak models can no longer silently burn tokens by ignoring the skill docs. The same refusal fires for `swap send` (Solana gas + 10 bps platform fee) and `bridge send` (Across fee + gas), so an agent cannot move tokens without a round-trip through user approval.
@@ -206,7 +215,7 @@ JSON `error` / `message` / `detail` fields are extracted when present; raw body
206
215
  ## Other Commands
207
216
 
208
217
  ```bash
209
- amiko discovery # MPP service info + pricing
218
+ amiko market discover # MPP service info + pricing
210
219
  amiko config show # view config
211
220
  amiko config set <key> <value> # set config value
212
221
  amiko update # update CLI to latest (full twin refresh — no restart needed)
@@ -243,42 +252,38 @@ Agents auto-authenticate via `.amiko.json` — no manual connect needed. The pla
243
252
  ```bash
244
253
  # Agent environment — just works
245
254
  amiko credits balance
246
- amiko search "trending topics"
255
+ amiko market search "trending topics"
247
256
  amiko credits topup 10000 --token AMIKO --yes
248
257
  ```
249
258
 
250
- The CLI checks for `.amiko.json` in order:
251
- 1. `$OPENCLAW_WORKSPACE_DIR/.amiko.json`
252
- 2. `$OPENCLAW_HOME/.openclaw/workspace/.amiko.json`
253
- 3. `/data/.openclaw/workspace/.amiko.json`
254
- 4. Walking up from `cwd`
259
+ The CLI finds `.amiko.json` by:
260
+ 1. Walking up from the current working directory.
261
+ 2. Falling back to `/data/.openclaw/workspace/.amiko.json`.
255
262
 
256
263
  Supported keys (both camelCase and SCREAMING_SNAKE_CASE):
257
- - `amikoTwinToken` / `AMIKO_TWIN_TOKEN` — auth token
258
- - `amikoTwinId` / `AMIKO_TWIN_ID` — twin identifier
259
- - `amikoPlatformUrl` / `AMIKO_PLATFORM_URL` — platform base URL
260
- - `agentWallets` — array of `{ chain, address }`
261
- - `billingBase` — billing API URL
262
- - `platformKey` — API key override
263
-
264
- **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.
264
+ - `amikoTwinToken` / `AMIKO_TWIN_TOKEN` — **required** auth token
265
+ - `amikoTwinId` / `AMIKO_TWIN_ID` — twin identifier (needed for paid ops)
266
+ - `amikoUserId` / `AMIKO_USER_ID` — user identifier (optional, for MPP topup)
267
+ - `amikoPlatformUrl` / `AMIKO_PLATFORM_URL` — platform base URL override
268
+ - `billingBase` — billing API URL override
269
+ - `apiBase` — MPP service URL override
265
270
 
266
271
  ## Configuration
267
272
 
268
- Config file: `~/.amiko/config.json`
273
+ Defaults (no config file needed — override in `.amiko.json` if needed):
269
274
 
270
275
  | Key | Default |
271
276
  |-----|---------|
272
277
  | `billingBase` | `https://billing.heyamiko.com` |
273
278
  | `apiBase` | `https://mpp.amikomarkets.com` |
274
- | `siteBase` | `https://platform.heyamiko.com` |
279
+ | `platformUrl` | `https://platform.heyamiko.com` |
275
280
 
276
281
  ## Architecture
277
282
 
278
283
  ```
279
284
  src/
280
285
  ├── index.ts # entry point (Commander)
281
- ├── onboarding.ts # first-run setup
286
+ ├── onboarding.ts # no-op (auth is file-based)
282
287
  ├── commands/
283
288
  │ ├── credits.ts # credits balance + topup
284
289
  │ ├── search.ts # X/Twitter search (1 AMIKO via MPP)
@@ -299,7 +304,7 @@ src/
299
304
  │ ├── feed.ts # feed, post:create, post:comment
300
305
  │ └── composio.ts # composio:connect, composio:disconnect
301
306
  └── lib/
302
- ├── config.ts # ~/.amiko/config.json
307
+ ├── config.ts # defaults + resolved auth wrapper
303
308
  ├── agent-config.ts # .amiko.json reader + auth resolution
304
309
  ├── api.ts # HTTP client (MPP + billing)
305
310
  ├── amiko-web.ts # HTTP client for amiko-web (twin + social REST)
@@ -380,6 +385,14 @@ npm publish
380
385
 
381
386
  ## Changelog
382
387
 
388
+ ### 0.9.0-beta.0
389
+
390
+ - **Breaking**: auth simplified to `.amiko.json` + `amikoTwinToken` only. Removed `apiKey`, `privyToken`, `platformKey`, `connectedKeyId`, `agentWallets`, and `~/.amiko/config.json`.
391
+ - **Breaking**: `config set`, `config reset`, `config path` removed — `.amiko.json` is the single source of truth.
392
+ - **Breaking**: `credits topup` now routes through platform (`POST /api/agents/{twinId}/credits/topup`). Platform signs and verifies; the CLI never holds keys.
393
+ - **Breaking**: `swap send`, `search`, `image`, `amazon search`, and `service *` paid flows now require `--wallet <address>` and route transfers through the platform.
394
+ - MPP-direct topup kept as an escape hatch: `credits topup --method mpp --key-id <keyId>`.
395
+
383
396
  ### 0.8.4
384
397
 
385
398
  - Documentation catch-up for 0.8.3 (header version, removed lingering references to `amiko connect` / `whoami`).