@heyamiko/amiko-cli 0.14.0-beta.1 → 0.14.0-beta.11

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
@@ -120,12 +120,16 @@ Image generation typically takes 20–60s. In non-TTY environments (agents, pipe
120
120
 
121
121
  ## Create Studio
122
122
 
123
- The CLI half of the platform's Create Studio. `amiko create` generates media through Amiko's own authenticated endpoints (not the raw MPP pay-per-call surface `amiko markets` uses). Generation runs **asynchronously** and is **charged on success** from your twin's wallet — a failed or timed-out generation is never billed, and there's no up-front payment.
123
+ The CLI half of the platform's Create Studio. `amiko create` generates media through Amiko's own authenticated endpoints (not the raw MPP pay-per-call surface `amiko markets` uses). Generation runs **asynchronously** and is **charged on success** from your twin's wallet — a failed or timed-out generation is never billed, and there's no up-front payment. On unified-billing accounts, `--pay credits` pays from your Amiko account credits instead: the quote is reserved at submit, captured only on success, and released on failure (legacy accounts get a clear server error — omit the flag to keep the twin-wallet default).
124
124
 
125
125
  ```bash
126
- amiko create image "a sunset over mountains" # default gpt-image-2, 1:1
127
- amiko create image "logo" --aspect 16:9 --model gpt-image-2 # widescreen
126
+ amiko create image "a sunset over mountains" # default nano-banana-2, 1:1
127
+ amiko create image "logo" --aspect 16:9 --model gpt-image-2 # widescreen, OpenAI
128
+ amiko create image "a sunset" --pay credits --yes # pay with Amiko account credits (unified accounts)
128
129
  amiko create video "a whale in space" --resolution 768P --seconds 6
130
+ amiko create video "animate cover" --first-frame https://.../cover.png --yes
131
+ amiko create video "dance clip" --model dreamina-seedance-2-0-fast-260128 \
132
+ --reference-image https://.../ref1.png --reference-audio https://.../beat.mp3 --generate-audio --yes
129
133
  amiko create tts "Hello world" --voice 21m00Tcm4TlvDq8ikWAM
130
134
  amiko create music "lo-fi chill beat" --duration 30000
131
135
  amiko create music --lyrics "..." --instrumental # instrumental
@@ -139,7 +143,8 @@ Modes: `image`, `video`, `tts`, `music`, `sfx` (mirrors the platform Create Stud
139
143
 
140
144
  | Flag | Description |
141
145
  |------|-------------|
142
- | `--token <symbol>` | Charge token: `AMIKO`, `USDC`, `USDT`, `SOL` (default: auto, AMIKO-first) |
146
+ | `--pay <method>` | Payment method: `wallet` (twin wallet, default) or `credits` (Amiko account credits — unified accounts only) |
147
+ | `--token <symbol>` | Wallet charge token: `AMIKO`, `USDC`, `USDT`, `SOL` (default: auto, AMIKO-first); ignored with `--pay credits` |
143
148
  | `--yes` | Skip the pre-spend confirmation (required in non-interactive shells) |
144
149
  | `--raw` | Output the raw job result as JSON |
145
150
 
@@ -147,18 +152,27 @@ Modes: `image`, `video`, `tts`, `music`, `sfx` (mirrors the platform Create Stud
147
152
 
148
153
  | Flag | Default | Description |
149
154
  |------|---------|-------------|
150
- | `--model <model>` | `gpt-image-2` | Image model |
155
+ | `--model <model>` | `nano-banana-2` | Image model (`nano-banana[-2|-lite|-pro]`, `gpt-image-*`, `grok-imagine-image-quality`, `image-01`) |
151
156
  | `--aspect <ratio>` | `1:1` | Aspect ratio: `1:1`, `16:9`, `9:16`, `4:3`, `3:4` |
152
157
 
153
158
  **`amiko create video <prompt>`**
154
159
 
155
160
  | Flag | Default | Description |
156
161
  |------|---------|-------------|
157
- | `--model <model>` | `MiniMax-Hailuo-2.3-Fast` | Video model |
162
+ | `--model <model>` | smart | Video model (`MiniMax-Hailuo-*`, `dreamina-seedance-2-0-fast-260128`, …). Default: `MiniMax-Hailuo-02` for prompt-only (T2V), `MiniMax-Hailuo-2.3-Fast` when `--first-frame` is given (I2V) |
158
163
  | `--resolution <res>` | `768P` | `512P`, `720P`, `768P`, `1080P` |
159
164
  | `--seconds <n>` | `6` | Clip length: `6` or `10` |
160
165
  | `--aspect <ratio>` | — | Aspect ratio (provider-dependent) |
161
166
  | `--first-frame <url>` | — | Image-to-video: first frame URL or data URI |
167
+ | `--last-frame <url>` | — | First-and-last-frame video: ending frame URL or data URI |
168
+ | `--reference-image <url>` | — | Seedance multimodal reference image (repeatable, max 9) |
169
+ | `--reference-video <url>` | — | Seedance multimodal reference video (repeatable, max 3) |
170
+ | `--reference-audio <url>` | — | Seedance multimodal reference audio (repeatable, max 3) |
171
+ | `--subject-reference <url>` | — | MiniMax S2V subject/character reference image |
172
+ | `--generate-audio` | — | Seedance: generate audio in the output |
173
+ | `--no-generate-audio` | — | Seedance: output silent video |
174
+
175
+ Reference flags accept URLs or data URIs (not local paths). Typical I2V flow: `create image` → `create status <jobId>` for the image URL → `create video --first-frame <url>`.
162
176
 
163
177
  **`amiko create tts <text>`**
164
178
 
@@ -222,16 +236,38 @@ amiko chat list --limit 50 --archived # include archived
222
236
  amiko chat read @sophie # recent messages with a user (by @handle)
223
237
  amiko chat read <conversationId> --limit 40 # by conversation id (from `chat list`) — works for groups too
224
238
  amiko chat send @sophie "on my way!" --yes # send as the owner
239
+ amiko chat send <userId> "hey!" --yes # user id works too — the DM is opened automatically
240
+ amiko chat send Mars "hey!" --yes # or a name (friends first, then people search)
225
241
  amiko chat send <groupConversationId> "hi all" --yes # send to a group chat
226
242
  amiko chat send @sophie "look 👀" --image ./cat.png --yes # attach a local image
227
243
  amiko chat send @sophie "made this 🎵" --audio <generated-url> --yes # attach audio (e.g. from `amiko create`)
228
244
  ```
229
245
 
230
- - **`<target>`** for `read`/`send` is a **conversation id** (from `chat list` — use this for groups), an **`@handle`**, or a **name** (resolved via user search; if ambiguous, the CLI lists candidates instead of guessing).
231
- - A DM target that doesn't exist yet is **created automatically** (find-or-create).
246
+ - **`<target>`** for `read`/`send` is a **conversation id** (from `chat list` — use this for groups), a **user id**, an **`@handle`**, or a **name**. Names resolve against your **friends first**, then people search; if ambiguous, the CLI lists candidates instead of guessing. A cuid that isn't one of your conversations is retried as a user id, so pasting a user id "just works".
247
+ - `send` to a person you have no DM with yet **creates the DM automatically** (find-or-create, after the confirmation). `read` never creates one — it errors if no DM exists yet.
232
248
  - **Inline media**: `--image <pathOrUrl>` (jpg/png/webp/gif, local ≤10MB or an Amiko URL) and `--audio <pathOrUrl>` (local ≤25MB or an Amiko URL → sent as a voice note). One media block per message (image *or* audio). **Video isn't supported in chat yet.** A local file is uploaded; an Amiko URL (e.g. a generated asset from `amiko create`) attaches directly with no re-upload. (A local *audio* file is sent as a voice note, with your text as a separate message.)
233
249
  - `chat send` messages a real person, so it's **gated on `--yes`** in non-interactive shells. Delivery is real-time. `--raw` prints raw JSON on any subcommand.
234
250
 
251
+ ### Group chats
252
+
253
+ Create and manage group chats **as the owner** via `amiko chat group`:
254
+
255
+ ```bash
256
+ amiko chat group create "Leandro testing" --member Sophie --member Mars --member Matthew --yes
257
+ amiko chat group list # your group chats: title, id, member count, unread
258
+ amiko chat group info "Leandro testing" # members + roles (admins marked); works with the id too
259
+ amiko chat group rename <groupIdOrTitle> "New name" --yes
260
+ amiko chat group add <groupIdOrTitle> --member @sophie --yes
261
+ amiko chat group remove <groupIdOrTitle> --member Mars --yes
262
+ amiko chat group promote <groupIdOrTitle> --member Sophie --yes # make a member an admin
263
+ amiko chat group leave <groupIdOrTitle> --yes # alias: delete — see caveat below
264
+ ```
265
+
266
+ - **`--member`** is repeatable and accepts a plain name, `@handle`, or user id. Plain names resolve against your **friends** first (then people search); an ambiguous name errors listing candidates instead of guessing, and one unresolvable member aborts the whole command **before anything is changed**.
267
+ - **Groups address by id or title** — titles match case-insensitively (exact first, then substring) across your most recent 100 conversations; ambiguous titles error with candidates. `chat send "<group title>" "hi" --yes` also works when exactly one group title matches.
268
+ - **`leave` (alias `delete`) only hides the group for you.** Other members keep the conversation and its history — the platform has no delete-for-everyone. Rename, add, remove-others, and promote are **admin-only** (the creator is admin); the server enforces this.
269
+ - `create`/`add` are outward social actions and `rename`/`remove`/`leave`/`promote` are destructive, so all are **gated on `--yes`** in non-interactive shells. `--raw` prints JSON everywhere.
270
+
235
271
  ## Twin Cards
236
272
 
237
273
  Generate, view, download, and mint your **Twin Card** (template `twins_take`, flavors **work / play / love**).
@@ -528,6 +564,19 @@ npm publish
528
564
 
529
565
  ## Changelog
530
566
 
567
+ ### 0.14.0-beta.7
568
+
569
+ - **`amiko chat group invite <group>` — share a group's invite/join link + QR.** New read-only subcommand that fetches `GET /api/conversations/{id}/invite` (twin token) and prints the join link plus a scannable QR image URL. Admins-only: SKILL.md instructs the agent to confirm the asker holds `admin`/`owner` (via `amiko chat group info`) before sharing, and the endpoint is admin-gated server-side (403 → admin tip). Fails loudly if the response is missing its link/QR instead of printing a placeholder. Requires the companion amiko-web change (adds `qrUrl` to the invite response + a public `GET /api/conversations/join/[token]/qr` PNG route).
570
+
571
+ ### 0.14.0-beta.6
572
+
573
+ - **`amiko chat send`/`read` accept user ids — DMs no longer require an existing conversation.** Target resolution is rebuilt: a cuid target is verified as a conversation first and, on 404, retried as a user id (user ids and conversation ids are both cuids — previously a user id went straight to the messages route and died with "Conversation not found"). Plain names now resolve **friends-first** (then people search) via the shared `resolveMembers`, with ambiguity reported as a candidate list. Resolution is fully read-only: for `send`, a missing DM is found-or-created only **after** the `--yes`/approval gate (no more empty conversations from an unapproved send), and `read` never creates a DM at all — it errors if none exists. The confirmation summary now shows the **resolved** recipient (`Send to DM with Mars (@mars): …`) so a wrong-person resolution is visible before anything goes out. Unknown cuids are rejected before any conversation is created (the backend accepts dangling participant ids silently), and a 403 on a real conversation no longer falls through to DM creation.
574
+ - **Free outward actions no longer talk about cost.** `requireApproval` gained a `free` mode used by `chat send` and `chat group create/add`: the non-interactive refusal now says the action is free and tells the agent to confirm the action itself — instead of the old "This command will cost no charge… quote the cost to the user", which made twins ask owners to "approve the paid operation, cost 0". SKILL.md's Critical Rule 1 spells out the anti-pattern, documents user-id DM targets ("the owner never needs to start the conversation first"), and drops the false "server enforces friend rules" claim that fed authorization hallucinations.
575
+
576
+ ### 0.14.0-beta.5
577
+
578
+ - **`amiko chat group` — group-chat management as the owner.** New subcommand group under `chat`: `create` (name + repeatable `--member`, one atomic POST), `list`, `info` (members + roles), `rename`, `add`, `remove`, `promote`, and `leave` (alias `delete`). Members resolve friends-first by name (then people search), all-or-nothing before any mutation; groups address by id or case-insensitive title. Uses the existing amiko-web conversation routes (twin token) — rename/add/remove-others/promote are admin-enforced server-side, and `leave|delete` is honest about the platform's semantics: it only hides the group for the caller, there is no delete-for-everyone. `create`/`add` gate on `requireApproval`, the destructive rest on `confirmDestructive` (both exit 2 without `--yes` in non-interactive shells). Plain-name `chat send`/`read` targets now prefer an exact, unambiguous group-title match over people search. Shared conversation types + resolution helpers extracted to `src/lib/conversations.ts`; `convLabel` self-filtering now strips the `did:privy:` prefix so DM labels no longer include the owner. SKILL.md gains a Group chats block + gating-list updates.
579
+
531
580
  ### 0.14.0-beta.0
532
581
 
533
582
  - **Direct USDC/USDT payment for MPP marketplace services (Bug #9).** `markets search`, `markets image`, and `markets amazon search` gain `--token <AMIKO|USDC|USDT>`; `markets service call` completes its `--usdc` path and adds `--usdt` (both accept `auto` to price from the endpoint's USD anchor). Stables are pinned at $1.00 — no forced swap to AMIKO and no credits conversion. Requires the matching mpp-service deploy: `charge()`/`chargeAmiko()` now read `X-Payment-Token` and verify the on-chain transfer against that token's mint (`verifySplTransfer`), with a ±0.5% tolerance for stables (±5% stays for AMIKO spot drift). Also fixes stale hardcoded amounts: `markets search` / `amazon search` paid a flat "1 AMIKO" regardless of spot — under current prices that under-pays the $0.01 anchor and fails verification; amounts are now quoted live before the approval gate, which shows the real cost instead of "1 AMIKO". Shared payment plumbing extracted to `src/lib/treasury-payment.ts` (one TREASURY constant, one transfer path).