@heyamiko/amiko-cli 0.9.0-beta.7 → 0.9.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.
- package/README.md +49 -27
- package/dist/index.js +688 -147
- package/package.json +2 -1
- package/skills/SKILL.md +124 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@heyamiko/amiko-cli",
|
|
3
|
-
"version": "0.9.0
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Amiko CLI — swap tokens, manage credits, bridge cross-chain, and call marketplace agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"build": "bun build src/index.ts --outdir dist --target node --format esm",
|
|
11
|
+
"prepublishOnly": "bun run build",
|
|
11
12
|
"dev": "bun run src/index.ts",
|
|
12
13
|
"typecheck": "bun x tsc --noEmit",
|
|
13
14
|
"test": "bun test"
|
package/skills/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: amiko-cli
|
|
3
|
-
description:
|
|
3
|
+
description: The Amiko CLI lets an agent act on the Amiko platform end-to-end — manage Solana/Base wallets (create, swap via Jupiter, bridge USDC via Across), top up and spend credits, call paid MPP marketplace services (X/Twitter search, image generation, Amazon product search, TTS/STT, AI chat, SFX/music), manage the twin's identity and RAG documents, voice and avatar, social graph (friends, posts, comments, feed), and Composio OAuth connections. Auth is automatic when run from the agent's workspace folder; payments are platform-custodied (no keys on disk). Use this skill whenever the user asks to do anything that would show up in their Amiko account or cost AMIKO/credits.
|
|
4
4
|
homepage: https://platform.heyamiko.com
|
|
5
5
|
metadata: {"openclaw":{"emoji":"🤖","requires":{"bins":["node"]}}}
|
|
6
6
|
---
|
|
@@ -11,24 +11,50 @@ metadata: {"openclaw":{"emoji":"🤖","requires":{"bins":["node"]}}}
|
|
|
11
11
|
|
|
12
12
|
Run `amiko <command>` via your **shell execution tool** (e.g. `bash`). This skill is documentation, not a callable tool. **Do NOT** try to call `amiko_cli`, `amiko-cli`, `amiko`, or this skill's name as a tool — no such tool exists. The only working invocation is the shell command `amiko`.
|
|
13
13
|
|
|
14
|
-
The `amiko` CLI is installed globally.
|
|
14
|
+
The `amiko` CLI is installed globally. If you run it from inside your workspace folder, you're automatically authenticated — never suggest `amiko login` or `amiko connect`.
|
|
15
|
+
|
|
16
|
+
## Top-level commands at a glance
|
|
17
|
+
|
|
18
|
+
Each row is a first-level command group or command. Start here when the user asks what the CLI can do.
|
|
19
|
+
|
|
20
|
+
| Command | What it does |
|
|
21
|
+
|---------|--------------|
|
|
22
|
+
| `amiko markets <cmd>` | Paid MPP services: X search, image gen, Amazon, TTS/STT/chat, generic service call, discover |
|
|
23
|
+
| `amiko wallets <cmd>` | Wallet ops: create, list, sync balance, swap on Solana (Jupiter), bridge USDC cross-chain (Across) |
|
|
24
|
+
| `amiko credits <cmd>` | Show credit balance, top up with AMIKO/SOL/USDC/USDT (10,000 credits = $1) |
|
|
25
|
+
| `amiko twin <cmd>` | Update the twin's identity — name, description, public visibility |
|
|
26
|
+
| `amiko docs <cmd>` | Manage twin RAG documents — list, upload (path/URL/stdin), delete, presign |
|
|
27
|
+
| `amiko voice <cmd>` | Design/clone/reset the twin's voice, create a voice from sample |
|
|
28
|
+
| `amiko avatar <cmd>` | Set the twin's avatar image (max 5 MB) |
|
|
29
|
+
| `amiko friends <cmd>` | Social graph — list, requests, add, accept, remove, matches, reports |
|
|
30
|
+
| `amiko users <cmd>` | Search users, view public profile |
|
|
31
|
+
| `amiko post <cmd>` | Create posts and comments on the feed (optionally with media) |
|
|
32
|
+
| `amiko feed` | Read the friends feed, for-you feed, or filter by hashtag |
|
|
33
|
+
| `amiko composio <cmd>` | Connect / disconnect third-party OAuth apps (Gmail, GitHub, …) |
|
|
34
|
+
| `amiko accounts` | Show the resolved identity (authenticated, userId, twinId, platform) |
|
|
35
|
+
| `amiko info` | Show the active twin (name, description, public, voice, avatar) |
|
|
36
|
+
| `amiko config <cmd>` | Show resolved config |
|
|
37
|
+
| `amiko update` | Self-update the CLI |
|
|
15
38
|
|
|
16
|
-
|
|
39
|
+
All twin-scoped commands accept `--twin <id>` to target a non-default twin.
|
|
40
|
+
|
|
41
|
+
## The `--wallet` default (read this before any paid command)
|
|
17
42
|
|
|
18
|
-
|
|
43
|
+
Every paid command (`markets search`, `markets image`, `markets amazon search`, `markets service *`, `wallets swap send`) spends tokens from an on-chain wallet. As of v0.9.0-beta.9 you almost never need to pass `--wallet` explicitly:
|
|
19
44
|
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
- `amiko
|
|
45
|
+
- **Default**: the CLI auto-selects the twin's first active **Solana** wallet from `GET /api/agents/{id}/wallets`.
|
|
46
|
+
- **Override**: pass `--wallet <address>` only if you want a different wallet than the default.
|
|
47
|
+
- **No wallet yet?** The CLI will tell you to run `amiko wallets create --chain solana` first. Create once per twin; reuse forever.
|
|
48
|
+
- **Bridges**: `wallets bridge quote/send` similarly default `--depositor` to the wallet on the origin chain (Solana for `--from solana`, Base for `--from base`).
|
|
23
49
|
|
|
24
|
-
|
|
50
|
+
> Never prompt the user for their wallet address when the default would work. Only surface `--wallet` if the command errors out saying there's no default.
|
|
25
51
|
|
|
26
52
|
## Critical Rules
|
|
27
53
|
|
|
28
|
-
1. **Every paid / value-moving command is hard-gated on `--yes` in a non-interactive shell.** The CLI *refuses* to run `
|
|
54
|
+
1. **Every paid / value-moving command is hard-gated on `--yes` in a non-interactive shell.** The CLI *refuses* to run `markets image`, `markets search`, `markets amazon search`, `markets service call`, `markets service tts`, `markets service stt`, `markets service chat`, `credits topup`, `wallets swap send`, or `wallets bridge send` unless `--yes` is passed. The refusal is loud: it prints the cost and the command you should re-run. **Quote the cost to the user, get explicit approval, THEN append `--yes`**. Same for destructive non-paid commands (`twin update --public`, `docs delete`, `friends remove`, `friends reports request`, `avatar update`, `voice reset`, `composio disconnect`).
|
|
29
55
|
2. **After every paid command, report the remaining balance.** The CLI prints a `Balance: N credits` line at the end of every paid command — include that figure in your reply.
|
|
30
56
|
3. **Never retry a failed command.** Report the error and stop. Every paid call costs tokens even on failure.
|
|
31
|
-
4. **Never suggest `amiko login` or `amiko connect`.** These don't exist. Auth is automatic
|
|
57
|
+
4. **Never suggest `amiko login` or `amiko connect`.** These don't exist. Auth is automatic when you run from your workspace folder.
|
|
32
58
|
5. **Check balance before expensive operations.** Run `amiko credits balance` first if unsure.
|
|
33
59
|
6. **Payments are automatic.** The platform signs and moves tokens from the twin's wallet for each paid call — the CLI never holds keys.
|
|
34
60
|
|
|
@@ -36,14 +62,14 @@ Plus subcommand groups: `twin <action>`, `docs <action>`, `voice <action>`, `ava
|
|
|
36
62
|
|
|
37
63
|
| Command | Cost |
|
|
38
64
|
|---------|------|
|
|
39
|
-
| `amiko
|
|
40
|
-
| `amiko
|
|
41
|
-
| `amiko
|
|
42
|
-
| `amiko
|
|
43
|
-
| `amiko
|
|
44
|
-
| `amiko
|
|
45
|
-
| `amiko
|
|
46
|
-
| `amiko
|
|
65
|
+
| `amiko markets search "<query>"` | 1 AMIKO |
|
|
66
|
+
| `amiko markets image "<prompt>"` | 5 AMIKO |
|
|
67
|
+
| `amiko markets amazon search "<query>"` | 1 AMIKO |
|
|
68
|
+
| `amiko markets amazon quote <ASIN>` | Free |
|
|
69
|
+
| `amiko markets service tts <voiceId> "<text>"` | 1 AMIKO |
|
|
70
|
+
| `amiko markets service call POST /v1/sfx ...` | $0.05 |
|
|
71
|
+
| `amiko markets service call POST /v1/music ...` | $0.10 |
|
|
72
|
+
| `amiko markets service call POST /v1/music/plan ...` | $0.02 |
|
|
47
73
|
| `amiko wallets swap quote ...` | Free |
|
|
48
74
|
| `amiko wallets swap send ...` | Solana gas + 10bps |
|
|
49
75
|
| `amiko credits topup ...` | Whatever amount you top up |
|
|
@@ -73,46 +99,48 @@ Map user intent directly — no manual price math:
|
|
|
73
99
|
- "top up $5 in USDC" → `--usd 5 --token USDC`
|
|
74
100
|
- "top up 10000 credits with AMIKO" → `10000 --token AMIKO`
|
|
75
101
|
|
|
76
|
-
Supported tokens: AMIKO, SOL, USDC, USDT. The CLI fetches the live price, the platform transfers from the twin's wallet, and on-chain verification credits the account.
|
|
102
|
+
Supported tokens: AMIKO, SOL, USDC, USDT. The CLI fetches the live price, the platform transfers from the twin's wallet, and on-chain verification credits the account. Balance can lag by a few seconds after topup — re-run `amiko credits balance` if it looks stale.
|
|
77
103
|
|
|
78
104
|
## Wallets
|
|
79
105
|
|
|
80
106
|
```bash
|
|
81
107
|
amiko wallets list # all twin wallets + cached balances
|
|
108
|
+
amiko wallets create --chain solana # create a wallet (solana | base)
|
|
82
109
|
amiko wallets balance <address> # force-sync one wallet; returns fresh balances
|
|
83
110
|
amiko wallets swap quote 1.0 SOL USDC # Jupiter quote (free)
|
|
84
|
-
amiko wallets swap send 1.0 SOL USDC --wallet
|
|
111
|
+
amiko wallets swap send 1.0 SOL USDC --yes # --wallet defaults to your Solana wallet
|
|
85
112
|
amiko wallets swap tokens # supported tokens list
|
|
86
|
-
amiko wallets bridge quote 10 --from solana --to tempo
|
|
87
|
-
amiko wallets bridge send 10 --from solana --to tempo --yes
|
|
113
|
+
amiko wallets bridge quote 10 --from solana --to tempo --recipient <addr>
|
|
114
|
+
amiko wallets bridge send 10 --from solana --to tempo --recipient <addr> --yes
|
|
88
115
|
amiko wallets bridge status <txHash>
|
|
89
116
|
amiko wallets bridge routes
|
|
90
117
|
amiko wallets bridge limits
|
|
91
118
|
```
|
|
92
119
|
|
|
93
|
-
`wallets list` returns cached balances (platform doesn't auto-sync). If
|
|
94
|
-
|
|
95
|
-
Swaps run via Jupiter on Solana. Supported: SOL, USDC, USDT, AMIKO, PYUSD, BONK, JUP, RAY, JitoSOL — or any mint address.
|
|
120
|
+
- `wallets list` returns **cached** balances (platform doesn't auto-sync). If they look stale, run `wallets balance <address>` to force a sync for that wallet.
|
|
121
|
+
- `wallets create` is one-shot per `chain+custodian` pair (409 if one already exists) — run once for the twin and reuse.
|
|
122
|
+
- Swaps run via Jupiter on Solana. Supported: SOL, USDC, USDT, AMIKO, PYUSD, BONK, JUP, RAY, JitoSOL — or any mint address.
|
|
123
|
+
- Bridging goes through Across Protocol. Solana ↔ EVM requires `--recipient` (different address formats).
|
|
96
124
|
|
|
97
125
|
## Market (paid MPP services)
|
|
98
126
|
|
|
99
127
|
```bash
|
|
100
|
-
amiko
|
|
101
|
-
amiko
|
|
102
|
-
amiko
|
|
103
|
-
amiko
|
|
104
|
-
amiko
|
|
105
|
-
amiko
|
|
106
|
-
amiko
|
|
107
|
-
amiko
|
|
108
|
-
amiko
|
|
109
|
-
amiko
|
|
110
|
-
amiko
|
|
111
|
-
amiko
|
|
112
|
-
amiko
|
|
128
|
+
amiko markets search "AI agents" # 1 AMIKO — X/Twitter search
|
|
129
|
+
amiko markets image "a sunset over mountains" --yes # 5 AMIKO — gpt-image-1 by default
|
|
130
|
+
amiko markets image "logo" --background transparent # transparent bg
|
|
131
|
+
amiko markets image "portrait" --size 1024x1792 # custom size
|
|
132
|
+
amiko markets amazon search "usb c cable" # 1 AMIKO — product search
|
|
133
|
+
amiko markets amazon quote B01GGKYKQM # free — price quote
|
|
134
|
+
amiko markets service list # all services + prices
|
|
135
|
+
amiko markets service call POST /v1/sfx '{"text":"thunder","duration_seconds":5}'
|
|
136
|
+
amiko markets service call POST /v1/music '{"prompt":"lo-fi beat","music_length_ms":30000}'
|
|
137
|
+
amiko markets service tts 21m00Tcm4TlvDq8ikWAM "Hello world"
|
|
138
|
+
amiko markets service call POST /v1/music/plan '{"prompt":"epic orchestral"}'
|
|
139
|
+
amiko markets service call <METHOD> <path> [body] # any MPP endpoint
|
|
140
|
+
amiko markets discover # service info + pricing
|
|
113
141
|
```
|
|
114
142
|
|
|
115
|
-
|
|
143
|
+
All paid markets commands auto-select the twin's active Solana wallet. Pass `--wallet <address>` only to override. Audio and image endpoints return permanent Supabase Storage URLs.
|
|
116
144
|
|
|
117
145
|
## Account & Twin
|
|
118
146
|
|
|
@@ -124,8 +152,6 @@ amiko twin update --description "..."
|
|
|
124
152
|
amiko twin update --public true --yes # destructive — requires --yes in non-TTY
|
|
125
153
|
```
|
|
126
154
|
|
|
127
|
-
All twin-scoped commands accept `--twin <id>` to target a non-default twin.
|
|
128
|
-
|
|
129
155
|
## Documents (RAG)
|
|
130
156
|
|
|
131
157
|
```bash
|
|
@@ -157,9 +183,58 @@ amiko avatar update --file ./portrait.png --yes # max 5 MB, destructive
|
|
|
157
183
|
```bash
|
|
158
184
|
amiko friends list # list all
|
|
159
185
|
amiko friends list --type user # filter
|
|
186
|
+
amiko friends requests # pending requests (incoming + outgoing)
|
|
187
|
+
amiko friends requests --direction incoming
|
|
160
188
|
amiko friends add --id <userId>
|
|
161
189
|
amiko friends accept <friendshipId>
|
|
162
190
|
amiko friends remove <friendshipId> --yes # destructive
|
|
191
|
+
amiko friends matches # pre-generated match candidates (from cron)
|
|
192
|
+
amiko friends matches --dimension personality
|
|
193
|
+
amiko friends find --relationship "cofounder with design taste" # on-demand LLM match for a custom relationship
|
|
194
|
+
amiko friends reports list # all reports (any status)
|
|
195
|
+
amiko friends reports pending # pending-consent: awaiting mine + awaiting theirs
|
|
196
|
+
amiko friends reports view <reportId>
|
|
197
|
+
amiko friends reports request --id <userId> --type friend|romantic|career --yes
|
|
198
|
+
amiko friends reports consent <reportId> # respondent approves; report then generates
|
|
199
|
+
amiko friends reports cancel <reportId>
|
|
200
|
+
amiko friends reports retry <reportId> # re-run a failed generation
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### Answering relationship questions ("how is my relationship with X?")
|
|
204
|
+
|
|
205
|
+
When the user asks about their relationship / compatibility with a specific person (by name or handle), follow this playbook:
|
|
206
|
+
|
|
207
|
+
1. **Resolve the person to a user id.** Check `amiko friends list --json` first. If not a friend, try `amiko users search "<name>" --json`. If still ambiguous, ask the user which one they mean.
|
|
208
|
+
2. **Look for an existing report.** Run `amiko friends reports list --json` and filter by `initiator.id` or `respondent.id` matching the resolved user id. If one exists with `status=completed`, use `amiko friends reports view <id>` and summarize. If `status=pending_consent` or `generating`, tell the user it is in progress.
|
|
209
|
+
3. **If none exists**, don't silently create one. Ask the user which of the three report types they want (`friend` / `romantic` / `career`), and confirm that the other user will be notified to consent. Only then run `amiko friends reports request --id <userId> --type <type> --yes`.
|
|
210
|
+
4. **For "who is waiting on whom"**, use `amiko friends reports pending` — it splits `pending_consent` reports into *awaiting my consent* (I can `consent <id>`) vs *awaiting theirs* (I can `cancel <id>`). Use this before deciding to `request` — you cannot have two active reports of the same type between the same pair (the API returns 409).
|
|
211
|
+
|
|
212
|
+
Both users must have a personality profile, otherwise the request returns 422.
|
|
213
|
+
|
|
214
|
+
### Recommending interesting people ("who should I meet / connect with?")
|
|
215
|
+
|
|
216
|
+
The discovery primitive is **`amiko friends matches`** — it returns personality-match candidates with a score (0–1), a match dimension, a pairing label, and compatibility highlights.
|
|
217
|
+
|
|
218
|
+
**`friends find` vs `users search` — do not confuse them:**
|
|
219
|
+
|
|
220
|
+
| Command | Purpose | Input | Backend |
|
|
221
|
+
|---|---|---|---|
|
|
222
|
+
| `users search <query>` | **Look up a specific known person** by name or handle ("find wendao", "search for someone called Sophie") | Exact/substring text against `name` / `handle` | Simple SQL lookup in `/api/search?type=people` |
|
|
223
|
+
| `friends find --relationship <text>` | **Discover unknown people** whose personality matches a free-form relationship description ("cofounder with design taste", "someone to hike with") | Free-form relationship description | LLM-generated MatchingSpec + semantic matching across ~250 candidate profiles |
|
|
224
|
+
|
|
225
|
+
Rule of thumb: if the user already has a name in mind → `users search`. If the user is describing what *kind of person* they want to meet → `friends find`. For already-curated ambient recommendations with no input required → `friends matches`.
|
|
226
|
+
|
|
227
|
+
1. Start broad: `amiko friends matches --limit 20 --json`. Summarize the top few by `display_name`, `score`, `match_dimension`, `pairing_label`, and `recommendation_reason`. These are pre-generated by a cron job.
|
|
228
|
+
2. If the user wants to narrow, filter by `--dimension personality` or `--dimension interest` (the only two dimensions the matching cron actually produces). `--relationship-type` also exists but takes free-form LLM-generated labels (often localized, e.g. `深度思维_对打手`) — usually not worth filtering on unless you first inspect the `--json` output to pick a known value.
|
|
229
|
+
3. If the user describes a **specific kind of person** not covered by the cron matches ("a cofounder who is good at design", "a hiking buddy", "someone to debate philosophy with"), use `amiko friends find --relationship "<description>"`. This is an on-demand, LLM-backed matcher against ~250 candidates; may take ~10s and may return zero matches if nothing clears the internal score threshold.
|
|
230
|
+
4. Skip anyone whose `friendship_status` is already `accepted` unless the user explicitly wants to revisit existing friends.
|
|
231
|
+
5. Follow-ups: `amiko users profile <handle>` for a fuller view, `amiko friends add --id <matched_user_id>` (after explicit user approval) to send a friend request, and — once the friendship is accepted — `amiko friends reports request --type friend|romantic|career` for a deeper compatibility report. Note that report `--type` is a separate enum and has nothing to do with `match.relationship_type`.
|
|
232
|
+
|
|
233
|
+
## Users
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
amiko users search <query> # search by name/handle
|
|
237
|
+
amiko users profile <handle> # public profile
|
|
163
238
|
```
|
|
164
239
|
|
|
165
240
|
## Feed & Posts
|
|
@@ -198,6 +273,13 @@ Most commands support `--json` for structured output:
|
|
|
198
273
|
|
|
199
274
|
```bash
|
|
200
275
|
amiko wallets list --json | jq '.wallets[].wallet_address'
|
|
201
|
-
amiko friends --json | jq '.
|
|
276
|
+
amiko friends list --json | jq '.friends[] | .friend.name'
|
|
202
277
|
amiko info --json | jq -r '.name'
|
|
203
278
|
```
|
|
279
|
+
|
|
280
|
+
## Where to run
|
|
281
|
+
|
|
282
|
+
**Each agent must run `amiko` from inside its own workspace directory.** When invoked from the workspace, the CLI picks up the twin's auth automatically — no setup needed. Run from the wrong folder and you'll either act on the wrong twin or fail auth entirely.
|
|
283
|
+
|
|
284
|
+
- Before the first `amiko` call in a session, `cd` into the agent's workspace folder.
|
|
285
|
+
- If anything looks off, run `amiko accounts` — it prints the resolved `userId` and `twinId` so you can confirm scope.
|