@heyamiko/amiko-cli 0.8.3 → 0.9.0-beta.0

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 +41 -23
  2. package/dist/index.js +466 -924
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @heyamiko/amiko-cli (v0.8.3)
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,20 +16,29 @@ 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 search "AI agents" --wallet <solana-address>
30
39
 
31
40
  # Generate an image (5 AMIKO)
32
- amiko image "a sunset over mountains"
41
+ amiko 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
@@ -247,38 +256,34 @@ amiko 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,19 @@ 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
+
396
+ ### 0.8.4
397
+
398
+ - Documentation catch-up for 0.8.3 (header version, removed lingering references to `amiko connect` / `whoami`).
399
+ - Test suite: removed stale `wallet`/`whoami` assertions; `--version` now reads from `package.json` so future bumps don't break it.
400
+
383
401
  ### 0.8.3
384
402
 
385
403
  - `post:create --media` and `post:comment --media` — attach media URLs to feed posts and comments.