@heyamiko/amiko-cli 0.17.1 → 0.18.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 CHANGED
@@ -371,6 +371,29 @@ amiko chat lists delete "Focus" --yes # the conversations themselves
371
371
  - The server stores a list as a plain conversation-id array and `PATCH` replaces it wholesale, so `add`/`remove` read-modify-write the full array — existing entries always survive an `add`, and one unresolvable `--conversation` aborts the whole command before anything is written.
372
372
  - Lists are private, but mutations still take the `--yes` gate in non-interactive shells (they reshape your chat sidebar on every device). The bare listing is an ungated read; `--raw` prints JSON everywhere.
373
373
 
374
+ ### Polls
375
+
376
+ Create and answer **chat polls** as the owner via `amiko chat poll` — the same polls as the app's chat (single or multiple answers, anonymous voting, quizzes).
377
+
378
+ ```bash
379
+ amiko chat poll create "Trip planning" "Where to?" --option Beach --option Mountains --option City --yes
380
+ amiko chat poll create @sophie "Lunch?" --option Tacos --option Sushi --multiple --anonymous --yes
381
+ amiko chat poll create "Trip planning" "Capital of France?" --option Lyon --option Paris --quiz --correct 2 --explanation "Since 987" --yes
382
+ amiko chat poll show <messageId> # options, tallies, voters, your vote (id from `chat read`)
383
+ amiko chat poll vote <messageId> 2 --yes # by option number…
384
+ amiko chat poll vote <messageId> Beach City --yes # …or text / option id; multi-answer polls take several
385
+ amiko chat poll retract <messageId> --yes # take your vote back
386
+ amiko chat poll close <messageId> --yes # end your poll — permanent
387
+ ```
388
+
389
+ - A poll is a chat message: `chat read` shows it as `📊 <question>` followed by its options, tallies and a `●` on your own choices, and its message **id** is what `show`/`vote`/`retract`/`close` take.
390
+ - **`vote` sets your answer to exactly the choices given**, replacing any earlier vote (like tapping in the app). A single-answer poll takes one choice. Choices are the option's number (as `show` prints it), its text (case-insensitive), or its id.
391
+ - **Quizzes** have one correct answer (`--correct <n>`, 1-based). Results and the answer stay hidden until you answer, a quiz answer is final (no changing or retracting it), and you can't answer your own quiz. `--explanation` shows with the answer once it's revealed.
392
+ - **Anonymous** polls show counts only — nobody (the creator included) sees who voted for what. Otherwise `show` lists voter names.
393
+ - Only the poll's **creator** can `close` it. Closing is permanent: votes stop, results stay, and a quiz's answer is revealed to everyone.
394
+ - Polls work in **DMs and group chats with at least two people** — not in channels, support chats, or your chat with your twin. Limits: question ≤300 chars, 2–12 unique options ≤100 chars each, explanation ≤200 chars (checked before anything is sent).
395
+ - `create`, `vote` and `retract` are outward (the chat sees them) and `close` is irreversible, so all are **gated on `--yes`** in non-interactive shells. `show` is an ungated read; `--raw` prints JSON everywhere.
396
+
374
397
  ## Twin Cards
375
398
 
376
399
  Generate, view, download, and mint your **Twin Card** (template `twins_take`, flavors **work / play / love**).
@@ -653,14 +676,16 @@ amiko feed # friends feed (default)
653
676
  amiko feed --type all --limit 20 # the "All" tab (a.k.a. for_you)
654
677
  amiko feed --type following # posts from accounts you follow
655
678
  amiko feed --type media --kind image # site-wide public media (hits /api/media/feed)
656
- amiko post create --content "hello from the CLI" # public post — prints the canonical share URL (post_url in --json); share that verbatim, never hand-build one from the id
679
+ amiko post create --content "hello from the CLI" # saves a DRAFT by default (owner-only) — preview with `amiko post show <id>`, then `amiko post publish <id>`
680
+ amiko post create --content "ship it" --publish # create AND publish in one step — prints the canonical share URL (post_url in --json); share that verbatim, never hand-build one from the id
657
681
  amiko post create --title "Kyoto, 6am" --media ./shot.webp # image-only note — --content is optional when media/docs are attached
658
682
  amiko post create --title "Q3 report" --doc ./q3.pdf # document note — rendered as a file card
659
683
  amiko post create --content "private note" --visibility private
660
684
  amiko post create --content "look" --media https://...jpg
661
685
  amiko post create --title "the track" --media drive:<docId> # media already in the Drive (id from `amiko drive list`) — works for audio/video too
662
- amiko post create --content "wip idea" --draft # save a draft — no share URL until published
686
+ amiko post create --content "wip idea" --draft # explicit draft (same as the default) — no share URL until published
663
687
  amiko post drafts # list draft posts (--limit/--offset/--json)
688
+ amiko post show <postId> # preview any post, including your own unpublished drafts
664
689
  amiko post likers <postId> # who liked one of YOUR posts (403 on someone else's)
665
690
  amiko post publish <postId> # publish a draft (fresh timestamp, prints the share URL)
666
691
  amiko post comment --id <postId> --comment "great post"
@@ -985,6 +1010,7 @@ Your conversations (DMs + group chats) as the owner — list, read, send, manage
985
1010
  | `chat gifs` | Search Klipy GIFs (trending when no query) — pass a result URL to `amiko chat send --gif` |
986
1011
  | `chat group` | Group chats — create, list, info, rename, add/remove members, @all permission, leave |
987
1012
  | `chat lists` | Your chat lists (private folders of conversations) — run bare to see them; create, rename, add/remove conversations, delete |
1013
+ | `chat poll` | Chat polls — create, show, vote, retract your vote, close (as the owner) |
988
1014
 
989
1015
  #### `amiko chat list`
990
1016
 
@@ -1247,6 +1273,60 @@ Delete a chat list (the conversations in it are untouched)
1247
1273
  | `--yes` | | Skip the confirmation (required in non-interactive shells) |
1248
1274
  | `--raw` | | Output raw JSON |
1249
1275
 
1276
+ #### `amiko chat poll`
1277
+
1278
+ Chat polls — create, show, vote, retract your vote, close (as the owner)
1279
+
1280
+ ##### `amiko chat poll create <target> <question>`
1281
+
1282
+ Post a poll as yourself (the owner) to a DM or group chat (conversation id, user id, @handle, or name — DMs are opened automatically). Pass 2-12 answers with --option.
1283
+
1284
+ | Flag | Default | Description |
1285
+ |---|---|---|
1286
+ | `--option <text>` | | An answer option — repeat for each (2-12, in order, unique) |
1287
+ | `--multiple` | | Let people pick more than one answer |
1288
+ | `--anonymous` | | Hide who voted for what (everyone sees counts only) |
1289
+ | `--quiz` | | Quiz mode: one correct answer, revealed to each person once they answer |
1290
+ | `--correct <n>` | | Quiz only: the number of the correct option (1-based) |
1291
+ | `--explanation <text>` | | Quiz only: shown with the answer once it's revealed (≤200 characters) |
1292
+ | `--yes` | | Skip the confirmation (required in non-interactive shells) |
1293
+ | `--raw` | | Output raw JSON |
1294
+
1295
+ ##### `amiko chat poll show <messageId>`
1296
+
1297
+ Show a poll's options, results, voters and your own vote (the poll's message id, from `amiko chat read`)
1298
+
1299
+ | Flag | Default | Description |
1300
+ |---|---|---|
1301
+ | `--raw` | | Output raw JSON |
1302
+
1303
+ ##### `amiko chat poll vote <messageId> <choices>`
1304
+
1305
+ Vote as yourself (the owner). Sets your answer to exactly these options — each by number (as in `chat poll show`), text, or option id — replacing any earlier vote.
1306
+
1307
+ | Flag | Default | Description |
1308
+ |---|---|---|
1309
+ | `--yes` | | Skip the confirmation (required in non-interactive shells) |
1310
+ | `--raw` | | Output raw JSON |
1311
+
1312
+ ##### `amiko chat poll retract <messageId>`
1313
+
1314
+ Take back your vote on a poll (quiz answers can't be retracted)
1315
+
1316
+ | Flag | Default | Description |
1317
+ |---|---|---|
1318
+ | `--yes` | | Skip the confirmation (required in non-interactive shells) |
1319
+ | `--raw` | | Output raw JSON |
1320
+
1321
+ ##### `amiko chat poll close <messageId>`
1322
+
1323
+ End a poll you created — no one can vote afterwards and it can't be reopened
1324
+
1325
+ | Flag | Default | Description |
1326
+ |---|---|---|
1327
+ | `--yes` | | Skip the confirmation (required in non-interactive shells) |
1328
+ | `--raw` | | Output raw JSON |
1329
+
1250
1330
  ### `amiko card`
1251
1331
 
1252
1332
  Twin Cards (work/play/love) — generate, view, download, mint
@@ -1808,6 +1888,7 @@ Send a friend request to a user by id
1808
1888
  | Flag | Default | Description |
1809
1889
  |---|---|---|
1810
1890
  | `--id <userId>` | | Target user id |
1891
+ | `--yes` | | Skip the confirmation. Only pass this after the owner has confirmed they want to friend this specific person. |
1811
1892
  | `--json` | | Output as JSON |
1812
1893
 
1813
1894
  #### `amiko friends accept <friendshipId>`
@@ -1816,6 +1897,7 @@ Accept a pending friend request
1816
1897
 
1817
1898
  | Flag | Default | Description |
1818
1899
  |---|---|---|
1900
+ | `--yes` | | Skip the confirmation. Only pass this after the owner has confirmed they want to accept this request. |
1819
1901
  | `--json` | | Output as JSON |
1820
1902
 
1821
1903
  #### `amiko friends requests`
@@ -2039,8 +2121,9 @@ Create posts (notes) and comments on the feed — text, images, and documents
2039
2121
 
2040
2122
  | Subcommand | Description |
2041
2123
  |---|---|
2042
- | `post create` | Create a post (a.k.a. note) on your feed |
2124
+ | `post create` | Create a post (a.k.a. note) on your feed. Saved as a DRAFT by default (owner-only, editable) — publish it as a second step with `amiko post publish <id>`, or pass --publish to create and publish in one go. |
2043
2125
  | `post drafts` | List your draft posts (newest first) |
2126
+ | `post show` | Preview a single post by id. Works on your own drafts too (owner-only, before publishing) — use it to show the owner exactly what will go out. |
2044
2127
  | `post publish` | Publish a draft post (stamps a fresh timestamp and notifies mentions) |
2045
2128
  | `post delete` | Delete one of your posts. Use this to clean up a post that went out wrong (bad link, test post, wrong version) |
2046
2129
  | `post comments` | List comments on a post |
@@ -2049,7 +2132,7 @@ Create posts (notes) and comments on the feed — text, images, and documents
2049
2132
 
2050
2133
  #### `amiko post create`
2051
2134
 
2052
- Create a post (a.k.a. note) on your feed
2135
+ Create a post (a.k.a. note) on your feed. Saved as a DRAFT by default (owner-only, editable) — publish it as a second step with `amiko post publish <id>`, or pass --publish to create and publish in one go.
2053
2136
 
2054
2137
  | Flag | Default | Description |
2055
2138
  |---|---|---|
@@ -2059,8 +2142,9 @@ Create a post (a.k.a. note) on your feed
2059
2142
  | `--visibility <public|private>` | `public` | Post visibility |
2060
2143
  | `--media <pathOrUrl...>` | | Attach media: local IMAGE file paths (uploaded automatically); Amiko-hosted URLs (image/music/video from `amiko create`); or `drive:<docId>` for a media file in your Drive (`amiko drive list`) |
2061
2144
  | `--doc <pathOrUrl...>` | | Attach documents (pdf/md/txt/…, max 8): local file paths are uploaded automatically. Rendered as file cards, not images |
2062
- | `--draft` | | Save as a draft instead of publishing (list: amiko post drafts · publish: amiko post publish <id>) |
2063
- | `--yes` | | Skip the publish confirmation (drafts never prompt). Only pass this after the owner has reviewed the exact copy and approved sending it. |
2145
+ | `--draft` | | Save as a draft (this is the default). Kept for clarity/back-compat — a bare `create` already drafts. List: amiko post drafts · publish: amiko post publish <id> |
2146
+ | `--publish` | | Create AND publish immediately, skipping the draft step. Outward — everyone sees it — so it takes the confirmation gate (or --yes once the owner has approved the exact copy). |
2147
+ | `--yes` | | Skip the publish confirmation (only relevant with --publish; drafts never prompt). Only pass this after the owner has reviewed the exact copy and approved publishing it. |
2064
2148
  | `--json` | | Output as JSON |
2065
2149
 
2066
2150
  #### `amiko post drafts`
@@ -2073,6 +2157,14 @@ List your draft posts (newest first)
2073
2157
  | `--offset <n>` | `0` | Pagination offset |
2074
2158
  | `--json` | | Output as JSON |
2075
2159
 
2160
+ #### `amiko post show <postId>`
2161
+
2162
+ Preview a single post by id. Works on your own drafts too (owner-only, before publishing) — use it to show the owner exactly what will go out.
2163
+
2164
+ | Flag | Default | Description |
2165
+ |---|---|---|
2166
+ | `--json` | | Output as JSON |
2167
+
2076
2168
  #### `amiko post publish <postId>`
2077
2169
 
2078
2170
  Publish a draft post (stamps a fresh timestamp and notifies mentions)