@wirecat/amo-cli 0.0.0-stage → 0.1.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 (274) hide show
  1. package/CHANGELOG.md +70 -0
  2. package/LICENSE +204 -0
  3. package/README.md +265 -2
  4. package/contracts/wirecat.json +1356 -0
  5. package/dist/amo/account.d.ts +18 -0
  6. package/dist/amo/account.d.ts.map +1 -0
  7. package/dist/amo/account.js +48 -0
  8. package/dist/amo/account.js.map +1 -0
  9. package/dist/amo/allow-list.d.ts +31 -0
  10. package/dist/amo/allow-list.d.ts.map +1 -0
  11. package/dist/amo/allow-list.js +106 -0
  12. package/dist/amo/allow-list.js.map +1 -0
  13. package/dist/amo/errors.d.ts +12 -0
  14. package/dist/amo/errors.d.ts.map +1 -0
  15. package/dist/amo/errors.js +72 -0
  16. package/dist/amo/errors.js.map +1 -0
  17. package/dist/amo/json.d.ts +3 -0
  18. package/dist/amo/json.d.ts.map +1 -0
  19. package/dist/amo/json.js +3 -0
  20. package/dist/amo/json.js.map +1 -0
  21. package/dist/amo/oauth.d.ts +55 -0
  22. package/dist/amo/oauth.d.ts.map +1 -0
  23. package/dist/amo/oauth.js +189 -0
  24. package/dist/amo/oauth.js.map +1 -0
  25. package/dist/amo/operation.d.ts +45 -0
  26. package/dist/amo/operation.d.ts.map +1 -0
  27. package/dist/amo/operation.js +119 -0
  28. package/dist/amo/operation.js.map +1 -0
  29. package/dist/amo/operations.d.ts +3 -0
  30. package/dist/amo/operations.d.ts.map +1 -0
  31. package/dist/amo/operations.js +1407 -0
  32. package/dist/amo/operations.js.map +1 -0
  33. package/dist/amo/routes.d.ts +67 -0
  34. package/dist/amo/routes.d.ts.map +1 -0
  35. package/dist/amo/routes.js +65 -0
  36. package/dist/amo/routes.js.map +1 -0
  37. package/dist/amo/transport.d.ts +62 -0
  38. package/dist/amo/transport.d.ts.map +1 -0
  39. package/dist/amo/transport.js +282 -0
  40. package/dist/amo/transport.js.map +1 -0
  41. package/dist/api-keys.d.ts +47 -0
  42. package/dist/api-keys.d.ts.map +1 -0
  43. package/dist/api-keys.js +224 -0
  44. package/dist/api-keys.js.map +1 -0
  45. package/dist/bin/amo.d.ts +3 -0
  46. package/dist/bin/amo.d.ts.map +1 -0
  47. package/dist/bin/amo.js +40 -0
  48. package/dist/bin/amo.js.map +1 -0
  49. package/dist/bundle/all-profiles-3KQVWDV4.js +278 -0
  50. package/dist/bundle/amo.js +198 -0
  51. package/dist/bundle/anthropic-N5NOX7K7.js +90 -0
  52. package/dist/bundle/app-server-2MST5EZ5.js +245 -0
  53. package/dist/bundle/bun-4NHWOFX2.js +169 -0
  54. package/dist/bundle/bun-sqlite-DRSXPWPR.js +75 -0
  55. package/dist/bundle/chunk-2B24PDH7.js +1718 -0
  56. package/dist/bundle/chunk-2I5UVMLW.js +3232 -0
  57. package/dist/bundle/chunk-3IRJDH2U.js +731 -0
  58. package/dist/bundle/chunk-4ZAK773N.js +100 -0
  59. package/dist/bundle/chunk-5D4AEUVA.js +24783 -0
  60. package/dist/bundle/chunk-5D4Z2B5B.js +334 -0
  61. package/dist/bundle/chunk-5E5R65CA.js +54 -0
  62. package/dist/bundle/chunk-5HGGG3QO.js +73 -0
  63. package/dist/bundle/chunk-5RLUHTK6.js +23 -0
  64. package/dist/bundle/chunk-5SBLU7D7.js +63 -0
  65. package/dist/bundle/chunk-5Z5PEEKP.js +206 -0
  66. package/dist/bundle/chunk-63F65DHU.js +29 -0
  67. package/dist/bundle/chunk-6RS7OYTD.js +64 -0
  68. package/dist/bundle/chunk-73CXFE36.js +88 -0
  69. package/dist/bundle/chunk-7GTUZY7M.js +170 -0
  70. package/dist/bundle/chunk-7PKFYX7V.js +189 -0
  71. package/dist/bundle/chunk-7U5HJEPZ.js +1400 -0
  72. package/dist/bundle/chunk-A33TIM5D.js +4172 -0
  73. package/dist/bundle/chunk-ADEWU4P4.js +38 -0
  74. package/dist/bundle/chunk-ADLS6FVG.js +24600 -0
  75. package/dist/bundle/chunk-AHJ4W2IL.js +106 -0
  76. package/dist/bundle/chunk-AUBB72VF.js +2572 -0
  77. package/dist/bundle/chunk-BVMNXI53.js +1266 -0
  78. package/dist/bundle/chunk-CDY2NJFE.js +136 -0
  79. package/dist/bundle/chunk-CHUKWON6.js +244 -0
  80. package/dist/bundle/chunk-CUZRHF34.js +230 -0
  81. package/dist/bundle/chunk-D72URWJE.js +532 -0
  82. package/dist/bundle/chunk-DAY6TSPF.js +786 -0
  83. package/dist/bundle/chunk-DFDN6AUB.js +21 -0
  84. package/dist/bundle/chunk-DJD7TBYG.js +2791 -0
  85. package/dist/bundle/chunk-DOSJONCX.js +1197 -0
  86. package/dist/bundle/chunk-DQV2IKCF.js +72 -0
  87. package/dist/bundle/chunk-DXGGCGRP.js +218 -0
  88. package/dist/bundle/chunk-EH6ZEJGT.js +932 -0
  89. package/dist/bundle/chunk-EPOV5UIO.js +185 -0
  90. package/dist/bundle/chunk-EQ7A6NA6.js +53 -0
  91. package/dist/bundle/chunk-EQUKVVHX.js +353 -0
  92. package/dist/bundle/chunk-EROSAUNP.js +133 -0
  93. package/dist/bundle/chunk-ESZSMZKT.js +82 -0
  94. package/dist/bundle/chunk-FKR3M62D.js +407 -0
  95. package/dist/bundle/chunk-GNTJMB6X.js +142 -0
  96. package/dist/bundle/chunk-GQ7VFIYM.js +316 -0
  97. package/dist/bundle/chunk-JH3UOHRE.js +161 -0
  98. package/dist/bundle/chunk-JMDLPBXK.js +1068 -0
  99. package/dist/bundle/chunk-JR6TSMFX.js +9435 -0
  100. package/dist/bundle/chunk-L6AFE73L.js +18 -0
  101. package/dist/bundle/chunk-LDEBZ3IX.js +238 -0
  102. package/dist/bundle/chunk-LGQXGOPJ.js +58 -0
  103. package/dist/bundle/chunk-LJQUYECN.js +6848 -0
  104. package/dist/bundle/chunk-LRBPT7LQ.js +95 -0
  105. package/dist/bundle/chunk-LSND5QYI.js +460 -0
  106. package/dist/bundle/chunk-NC76INB2.js +27955 -0
  107. package/dist/bundle/chunk-NHXJYS4R.js +1334 -0
  108. package/dist/bundle/chunk-NJYAL3UW.js +92 -0
  109. package/dist/bundle/chunk-O2UCU52O.js +4065 -0
  110. package/dist/bundle/chunk-ODNQU7DH.js +1028 -0
  111. package/dist/bundle/chunk-P3WQRTYZ.js +24 -0
  112. package/dist/bundle/chunk-P5LYZRKW.js +63373 -0
  113. package/dist/bundle/chunk-PFO76YFP.js +2003 -0
  114. package/dist/bundle/chunk-PM77PRB6.js +12269 -0
  115. package/dist/bundle/chunk-Q2VNBY4Y.js +38109 -0
  116. package/dist/bundle/chunk-QDMXZZG4.js +604 -0
  117. package/dist/bundle/chunk-QRQYUHCZ.js +761 -0
  118. package/dist/bundle/chunk-RPWAJYI6.js +2336 -0
  119. package/dist/bundle/chunk-SMSTGO2G.js +58 -0
  120. package/dist/bundle/chunk-SZ2V62HB.js +72 -0
  121. package/dist/bundle/chunk-T2UDLX76.js +259 -0
  122. package/dist/bundle/chunk-TGEQNS6G.js +16 -0
  123. package/dist/bundle/chunk-TNUFLULO.js +2333 -0
  124. package/dist/bundle/chunk-TZSUZGWM.js +25 -0
  125. package/dist/bundle/chunk-U7RLVJ34.js +274 -0
  126. package/dist/bundle/chunk-UBRREVLJ.js +72 -0
  127. package/dist/bundle/chunk-ULXQ5MJM.js +76 -0
  128. package/dist/bundle/chunk-UMVRT7VQ.js +46 -0
  129. package/dist/bundle/chunk-V77XNPXG.js +360 -0
  130. package/dist/bundle/chunk-VVHRQ46X.js +193 -0
  131. package/dist/bundle/chunk-VX37MPTJ.js +7 -0
  132. package/dist/bundle/chunk-WCYCUTSK.js +362 -0
  133. package/dist/bundle/chunk-XEFAMLSD.js +288 -0
  134. package/dist/bundle/chunk-XQL7FEF4.js +721 -0
  135. package/dist/bundle/chunk-XRTD2GCU.js +627 -0
  136. package/dist/bundle/chunk-Y37A3232.js +804 -0
  137. package/dist/bundle/chunk-Y5E2WNWB.js +35 -0
  138. package/dist/bundle/chunk-ZM7I52EP.js +78 -0
  139. package/dist/bundle/chunk-ZVVMGPBJ.js +50 -0
  140. package/dist/bundle/cli-QVWTXADI.js +1193 -0
  141. package/dist/bundle/command-contract-QBUQBXH7.js +39 -0
  142. package/dist/bundle/command-server-entry-5VL5U5EE.js +168 -0
  143. package/dist/bundle/decode-SQ5WGNDX.js +296 -0
  144. package/dist/bundle/dispatch-LA4DFXJD.js +411 -0
  145. package/dist/bundle/dist-T54K3FJV.js +7577 -0
  146. package/dist/bundle/echarts-25Z3RINX.js +42501 -0
  147. package/dist/bundle/embed-BNOTNXMA.js +37 -0
  148. package/dist/bundle/embedder-BCUT7KKV.js +110 -0
  149. package/dist/bundle/failure-PKAC6XCT.js +24 -0
  150. package/dist/bundle/first-run-EO5K5GME.js +28 -0
  151. package/dist/bundle/first-screen-GMN3T6RW.js +39 -0
  152. package/dist/bundle/instructions-VLM3QAYB.js +11 -0
  153. package/dist/bundle/mcp-7ILNMJH5.js +167 -0
  154. package/dist/bundle/meeting-combined-LAMF7S2B.js +24 -0
  155. package/dist/bundle/meeting-model-GHMMUQ34.js +24 -0
  156. package/dist/bundle/meeting-semantic-BMP6323L.js +21 -0
  157. package/dist/bundle/node-CT3N3TNL.js +176 -0
  158. package/dist/bundle/node-P4E63KXA.js +2340 -0
  159. package/dist/bundle/node-TLZSIHIJ.js +21 -0
  160. package/dist/bundle/node-sqlite-MELD2SBX.js +73 -0
  161. package/dist/bundle/oauth-YBH5OKC2.js +19 -0
  162. package/dist/bundle/open-WNSBWTAG.js +22 -0
  163. package/dist/bundle/openai-XSNMNLW6.js +237 -0
  164. package/dist/bundle/process-I2QKOMM7.js +91 -0
  165. package/dist/bundle/program-DV73CIGP.js +4940 -0
  166. package/dist/bundle/prompt-SOG4AKPM.js +16 -0
  167. package/dist/bundle/recognize-WMQLWMXH.js +25 -0
  168. package/dist/bundle/remote-4BTFOLFY.js +30 -0
  169. package/dist/bundle/rerank-LJ3TWRNV.js +51 -0
  170. package/dist/bundle/serve-B6UANKXN.js +198 -0
  171. package/dist/bundle/server-S6XD6V6E.js +77 -0
  172. package/dist/bundle/server-YRH6GJ5Z.js +206 -0
  173. package/dist/bundle/source-DGFTA2TN.js +42 -0
  174. package/dist/bundle/sqlite-runtime-R7QFWFE7.js +19 -0
  175. package/dist/bundle/state-DIJ5YUOE.js +35 -0
  176. package/dist/bundle/store-6WFWW7EC.js +294 -0
  177. package/dist/bundle/store-FJCNZULV.js +32 -0
  178. package/dist/bundle/store-MYTYDV6A.js +177 -0
  179. package/dist/bundle/store-maintenance-command-B5TMKFMG.js +68 -0
  180. package/dist/bundle/writer-GP7VIMAU.js +44 -0
  181. package/dist/commands/account.d.ts +3 -0
  182. package/dist/commands/account.d.ts.map +1 -0
  183. package/dist/commands/account.js +86 -0
  184. package/dist/commands/account.js.map +1 -0
  185. package/dist/commands/api.d.ts +3 -0
  186. package/dist/commands/api.d.ts.map +1 -0
  187. package/dist/commands/api.js +224 -0
  188. package/dist/commands/api.js.map +1 -0
  189. package/dist/commands/crm-shared.d.ts +8 -0
  190. package/dist/commands/crm-shared.d.ts.map +1 -0
  191. package/dist/commands/crm-shared.js +111 -0
  192. package/dist/commands/crm-shared.js.map +1 -0
  193. package/dist/commands/schedule.d.ts +3 -0
  194. package/dist/commands/schedule.d.ts.map +1 -0
  195. package/dist/commands/schedule.js +9 -0
  196. package/dist/commands/schedule.js.map +1 -0
  197. package/dist/commands/session.d.ts +18 -0
  198. package/dist/commands/session.d.ts.map +1 -0
  199. package/dist/commands/session.js +265 -0
  200. package/dist/commands/session.js.map +1 -0
  201. package/dist/commands/write.d.ts +14 -0
  202. package/dist/commands/write.d.ts.map +1 -0
  203. package/dist/commands/write.js +36 -0
  204. package/dist/commands/write.js.map +1 -0
  205. package/dist/config.d.ts +4 -0
  206. package/dist/config.d.ts.map +1 -0
  207. package/dist/config.js +29 -0
  208. package/dist/config.js.map +1 -0
  209. package/dist/context.d.ts +62 -0
  210. package/dist/context.d.ts.map +1 -0
  211. package/dist/context.js +97 -0
  212. package/dist/context.js.map +1 -0
  213. package/dist/crm/activities.d.ts +32 -0
  214. package/dist/crm/activities.d.ts.map +1 -0
  215. package/dist/crm/activities.js +196 -0
  216. package/dist/crm/activities.js.map +1 -0
  217. package/dist/crm/records.d.ts +20 -0
  218. package/dist/crm/records.d.ts.map +1 -0
  219. package/dist/crm/records.js +175 -0
  220. package/dist/crm/records.js.map +1 -0
  221. package/dist/crm/source.d.ts +41 -0
  222. package/dist/crm/source.d.ts.map +1 -0
  223. package/dist/crm/source.js +673 -0
  224. package/dist/crm/source.js.map +1 -0
  225. package/dist/crm/writer.d.ts +14 -0
  226. package/dist/crm/writer.d.ts.map +1 -0
  227. package/dist/crm/writer.js +247 -0
  228. package/dist/crm/writer.js.map +1 -0
  229. package/dist/identity.d.ts +7 -0
  230. package/dist/identity.d.ts.map +1 -0
  231. package/dist/identity.js +33 -0
  232. package/dist/identity.js.map +1 -0
  233. package/dist/index.d.ts +3 -0
  234. package/dist/index.d.ts.map +1 -0
  235. package/dist/index.js +3 -0
  236. package/dist/index.js.map +1 -0
  237. package/dist/program.d.ts +6 -0
  238. package/dist/program.d.ts.map +1 -0
  239. package/dist/program.js +91 -0
  240. package/dist/program.js.map +1 -0
  241. package/dist/reasons.d.ts +10 -0
  242. package/dist/reasons.d.ts.map +1 -0
  243. package/dist/reasons.js +35 -0
  244. package/dist/reasons.js.map +1 -0
  245. package/dist/setup/flow.d.ts +2 -0
  246. package/dist/setup/flow.d.ts.map +1 -0
  247. package/dist/setup/flow.js +127 -0
  248. package/dist/setup/flow.js.map +1 -0
  249. package/dist/setup/texts.en.json +25 -0
  250. package/dist/setup/texts.es.json +25 -0
  251. package/dist/setup/texts.ru.json +25 -0
  252. package/dist/store.d.ts +15 -0
  253. package/dist/store.d.ts.map +1 -0
  254. package/dist/store.js +16 -0
  255. package/dist/store.js.map +1 -0
  256. package/dist/version.d.ts +2 -0
  257. package/dist/version.d.ts.map +1 -0
  258. package/dist/version.js +2 -0
  259. package/dist/version.js.map +1 -0
  260. package/dist/wcat.d.ts +3 -0
  261. package/dist/wcat.d.ts.map +1 -0
  262. package/dist/wcat.js +4 -0
  263. package/dist/wcat.js.map +1 -0
  264. package/dist/whoami.d.ts +24 -0
  265. package/dist/whoami.d.ts.map +1 -0
  266. package/dist/whoami.js +33 -0
  267. package/dist/whoami.js.map +1 -0
  268. package/package.json +85 -4
  269. package/skills/amo-cli/SKILL.md +116 -0
  270. package/skills/amo-cli/references/mcp.md +38 -0
  271. package/skills/amo-cli/references/output.md +42 -0
  272. package/skills/amo-cli/references/reading.md +77 -0
  273. package/skills/amo-cli/references/setup.md +59 -0
  274. package/skills/amo-cli/references/writing.md +86 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,70 @@
1
+ # Changelog
2
+
3
+ Notable changes to `@wirecat/amo-cli`. One section per version, newest first.
4
+
5
+ ## 0.1.1 — 18.11.2026
6
+
7
+ ### Fixed
8
+
9
+ - Published from GitHub Actions with npm provenance, so WireCat Desktop installs it: Desktop refuses a built-in tool's
10
+ release that its own repository's workflow did not build, and 0.1.0 was published from a computer.
11
+ - The user docs match bitrix24-cli's: MCP and permissions pages, a full start page, `amo <profile> setup` in the
12
+ README's quick start, environment variables in the configuration page, and more troubleshooting rows.
13
+
14
+ ## 0.1.0 — 17.11.2026
15
+
16
+ ### Added
17
+
18
+ - Started from `@wirecat/cli-template` 0.24.0.
19
+ - A `host` profile setting and the WireCat Desktop setup flow for a long-lived token, in English, Russian and Spanish
20
+ (`amo setup`, `src/setup/`); `session start` keeps `host` too.
21
+ - On cli-core 0.676.0: a profile reads offline only its own user's deals of a copy another profile on the same account
22
+ made (the administrator's reads stay whole), `organizations create|update --email|--phone` write the company's own
23
+ fields or refuse when the account has none, and `pipelines show --since-time|--until-time` answer a period funnel.
24
+ - On cli-core 0.681.0 and cli-base 0.106.0: `setup apply --dry-run` never opens the keyring, and a skill's parts are
25
+ served beside it.
26
+ - On cli-core 0.683.0: `changes list` and the digest work on Node 22.16, a note shows once in `changes list`, and
27
+ `config set crm.amocrm:<host>.self` is refused (only a signed-in sync sets the copy's user).
28
+ - With `config set crm.amocrm:<host>.activities on`, `sync` copies the tasks, comments and calls on your deals and
29
+ their clients (90 days back at first); `activities list` lists them, `changes list` shows what changed, and
30
+ `schedule command crm-digest --at 08:30 -- changes list --format report` sends a morning digest. A task deleted in
31
+ amoCRM leaves the copy at the next sync. A call keeps no phone number or recording, and the digest prints no note
32
+ text.
33
+ - `session start --host <address>` signs in to an amoCRM or Kommo account with a long-lived token, read hidden or from
34
+ stdin and kept in the keyring with the address; `session status --check` shows the account and the user.
35
+ - `api list`, `api show` and `api call` reach every operation of the amoCRM API v4 reference, each with its own
36
+ permission key, query parameters in `--params` and the body in `--body`. Own reads and lead, contact and company
37
+ changes are allowed, other reads, writes and deletes ask; conversations, chats, Salesbots, webhooks, widgets,
38
+ calls, adding users and task writes are denied until you allow them.
39
+ - Only the account's administrator deletes, sets a field to nothing, unlinks records or reads contacts, companies, notes
40
+ and events through `api call`, whatever the permissions say.
41
+ - `sync` copies the deals assigned to you, and to colleagues an administrator chooses, with their pipelines, stage
42
+ history and deletions, and only the contacts and companies on those deals. It narrows its reads with amoCRM's API
43
+ filter add-on when the account has it.
44
+ - `deals list`, `show`, `create`, `update`, `move` and `close` work on the copy and write to amoCRM; `close lost`
45
+ takes a loss reason by name. There is no `deals delete`: API v4 cannot delete a deal.
46
+ - `people`, `organizations` and `users` read the account live; contacts and companies can be created and changed.
47
+ Someone who is not the administrator sees another user's client's phones and e-mails in at most 100 `show`s a day.
48
+ - `session start --client-id <id>` signs in through your own private integration with OAuth, and renews the access
49
+ token itself. The integration's Redirect URI is `https://wirecat.dev/webhooks/apps/amo-callback`.
50
+ - `account remove` forgets a profile's sign-in and files; `--delete-data` also deletes the account's copy, and refuses
51
+ while another profile reads the same account (`--dry-run` lists it all and warns).
52
+ - `schedule` runs `sync` on a timer.
53
+ - `sync` resumes inside a page when a run's request budget ends, and reads clients only by the ids its deals name.
54
+ A colleague's client on none of your deals never enters the copy, and a record restored from amoCRM's trash comes
55
+ back whatever order amoCRM lists the events in.
56
+
57
+ ### Changed — may break callers
58
+
59
+ - **The MCP Registry entry asks which profiles to serve.** It started `mcp serve --profiles all`, so a client that
60
+ installed the server from the registry reached every account on the computer without the owner choosing. Now
61
+ `--profiles` is a required argument with the example `personal`: the client asks for one profile, a
62
+ comma-separated list or `all`. Why: a CLI never picks an account for the owner
63
+ ([WC-MCP-9](https://github.com/WireCatLabs/cli-base/blob/main/docs/standards/mcp.md#wc-mcp-9--a-server-serves-the-profiles-it-is-told-with-one-connection-for-each)). Watch for: a client set up from the old entry keeps `--profiles all` until it is set up again; a
64
+ server added by hand or with `mcp config` does not change.
65
+
66
+ ### Fixed
67
+
68
+ - A sign-in from `AMO_TOKEN` and `AMO_HOST` now finds its user: each command asks the account whose token it is, as
69
+ `session start` does, so `deals list` and the other reads of the copy show that user's deals instead of none. The
70
+ token is kept nowhere. Under `--offline` nobody is asked, and the reads show none.
package/LICENSE ADDED
@@ -0,0 +1,204 @@
1
+ Copyright (c) 2026 Viacheslav Ptsarev
2
+
3
+
4
+ Apache License
5
+ Version 2.0, January 2004
6
+ http://www.apache.org/licenses/
7
+
8
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
9
+
10
+ 1. Definitions.
11
+
12
+ "License" shall mean the terms and conditions for use, reproduction,
13
+ and distribution as defined by Sections 1 through 9 of this document.
14
+
15
+ "Licensor" shall mean the copyright owner or entity authorized by
16
+ the copyright owner that is granting the License.
17
+
18
+ "Legal Entity" shall mean the union of the acting entity and all
19
+ other entities that control, are controlled by, or are under common
20
+ control with that entity. For the purposes of this definition,
21
+ "control" means (i) the power, direct or indirect, to cause the
22
+ direction or management of such entity, whether by contract or
23
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
24
+ outstanding shares, or (iii) beneficial ownership of such entity.
25
+
26
+ "You" (or "Your") shall mean an individual or Legal Entity
27
+ exercising permissions granted by this License.
28
+
29
+ "Source" form shall mean the preferred form for making modifications,
30
+ including but not limited to software source code, documentation
31
+ source, and configuration files.
32
+
33
+ "Object" form shall mean any form resulting from mechanical
34
+ transformation or translation of a Source form, including but
35
+ not limited to compiled object code, generated documentation,
36
+ and conversions to other media types.
37
+
38
+ "Work" shall mean the work of authorship, whether in Source or
39
+ Object form, made available under the License, as indicated by a
40
+ copyright notice that is included in or attached to the work
41
+ (an example is provided in the Appendix below).
42
+
43
+ "Derivative Works" shall mean any work, whether in Source or Object
44
+ form, that is based on (or derived from) the Work and for which the
45
+ editorial revisions, annotations, elaborations, or other modifications
46
+ represent, as a whole, an original work of authorship. For the purposes
47
+ of this License, Derivative Works shall not include works that remain
48
+ separable from, or merely link (or bind by name) to the interfaces of,
49
+ the Work and Derivative Works thereof.
50
+
51
+ "Contribution" shall mean any work of authorship, including
52
+ the original version of the Work and any modifications or additions
53
+ to that Work or Derivative Works thereof, that is intentionally
54
+ submitted to Licensor for inclusion in the Work by the copyright owner
55
+ or by an individual or Legal Entity authorized to submit on behalf of
56
+ the copyright owner. For the purposes of this definition, "submitted"
57
+ means any form of electronic, verbal, or written communication sent
58
+ to the Licensor or its representatives, including but not limited to
59
+ communication on electronic mailing lists, source code control systems,
60
+ and issue tracking systems that are managed by, or on behalf of, the
61
+ Licensor for the purpose of discussing and improving the Work, but
62
+ excluding communication that is conspicuously marked or otherwise
63
+ designated in writing by the copyright owner as "Not a Contribution."
64
+
65
+ "Contributor" shall mean Licensor and any individual or Legal Entity
66
+ on behalf of whom a Contribution has been received by Licensor and
67
+ subsequently incorporated within the Work.
68
+
69
+ 2. Grant of Copyright License. Subject to the terms and conditions of
70
+ this License, each Contributor hereby grants to You a perpetual,
71
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
72
+ copyright license to reproduce, prepare Derivative Works of,
73
+ publicly display, publicly perform, sublicense, and distribute the
74
+ Work and such Derivative Works in Source or Object form.
75
+
76
+ 3. Grant of Patent License. Subject to the terms and conditions of
77
+ this License, each Contributor hereby grants to You a perpetual,
78
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
79
+ (except as stated in this section) patent license to make, have made,
80
+ use, offer to sell, sell, import, and otherwise transfer the Work,
81
+ where such license applies only to those patent claims licensable
82
+ by such Contributor that are necessarily infringed by their
83
+ Contribution(s) alone or by combination of their Contribution(s)
84
+ with the Work to which such Contribution(s) was submitted. If You
85
+ institute patent litigation against any entity (including a
86
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
87
+ or a Contribution incorporated within the Work constitutes direct
88
+ or contributory patent infringement, then any patent licenses
89
+ granted to You under this License for that Work shall terminate
90
+ as of the date such litigation is filed.
91
+
92
+ 4. Redistribution. You may reproduce and distribute copies of the
93
+ Work or Derivative Works thereof in any medium, with or without
94
+ modifications, and in Source or Object form, provided that You
95
+ meet the following conditions:
96
+
97
+ (a) You must give any other recipients of the Work or
98
+ Derivative Works a copy of this License; and
99
+
100
+ (b) You must cause any modified files to carry prominent notices
101
+ stating that You changed the files; and
102
+
103
+ (c) You must retain, in the Source form of any Derivative Works
104
+ that You distribute, all copyright, patent, trademark, and
105
+ attribution notices from the Source form of the Work,
106
+ excluding those notices that do not pertain to any part of
107
+ the Derivative Works; and
108
+
109
+ (d) If the Work includes a "NOTICE" text file as part of its
110
+ distribution, then any Derivative Works that You distribute must
111
+ include a readable copy of the attribution notices contained
112
+ within such NOTICE file, excluding those notices that do not
113
+ pertain to any part of the Derivative Works, in at least one
114
+ of the following places: within a NOTICE text file distributed
115
+ as part of the Derivative Works; within the Source form or
116
+ documentation, if provided along with the Derivative Works; or,
117
+ within a display generated by the Derivative Works, if and
118
+ wherever such third-party notices normally appear. The contents
119
+ of the NOTICE file are for informational purposes only and
120
+ do not modify the License. You may add Your own attribution
121
+ notices within Derivative Works that You distribute, alongside
122
+ or as an addendum to the NOTICE text from the Work, provided
123
+ that such additional attribution notices cannot be construed
124
+ as modifying the License.
125
+
126
+ You may add Your own copyright statement to Your modifications and
127
+ may provide additional or different license terms and conditions
128
+ for use, reproduction, or distribution of Your modifications, or
129
+ for any such Derivative Works as a whole, provided Your use,
130
+ reproduction, and distribution of the Work otherwise complies with
131
+ the conditions stated in this License.
132
+
133
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
134
+ any Contribution intentionally submitted for inclusion in the Work
135
+ by You to the Licensor shall be under the terms and conditions of
136
+ this License, without any additional terms or conditions.
137
+ Notwithstanding the above, nothing herein shall supersede or modify
138
+ the terms of any separate license agreement you may have executed
139
+ with Licensor regarding such Contributions.
140
+
141
+ 6. Trademarks. This License does not grant permission to use the trade
142
+ names, trademarks, service marks, or product names of the Licensor,
143
+ except as required for reasonable and customary use in describing the
144
+ origin of the Work and reproducing the content of the NOTICE file.
145
+
146
+ 7. Disclaimer of Warranty. Unless required by applicable law or
147
+ agreed to in writing, Licensor provides the Work (and each
148
+ Contributor provides its Contributions) on an "AS IS" BASIS,
149
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
150
+ implied, including, without limitation, any warranties or conditions
151
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
152
+ PARTICULAR PURPOSE. You are solely responsible for determining the
153
+ appropriateness of using or redistributing the Work and assume any
154
+ risks associated with Your exercise of permissions under this License.
155
+
156
+ 8. Limitation of Liability. In no event and under no legal theory,
157
+ whether in tort (including negligence), contract, or otherwise,
158
+ unless required by applicable law (such as deliberate and grossly
159
+ negligent acts) or agreed to in writing, shall any Contributor be
160
+ liable to You for damages, including any direct, indirect, special,
161
+ incidental, or consequential damages of any character arising as a
162
+ result of this License or out of the use or inability to use the
163
+ Work (including but not limited to damages for loss of goodwill,
164
+ work stoppage, computer failure or malfunction, or any and all
165
+ other commercial damages or losses), even if such Contributor
166
+ has been advised of the possibility of such damages.
167
+
168
+ 9. Accepting Warranty or Additional Liability. While redistributing
169
+ the Work or Derivative Works thereof, You may choose to offer,
170
+ and charge a fee for, acceptance of support, warranty, indemnity,
171
+ or other liability obligations and/or rights consistent with this
172
+ License. However, in accepting such obligations, You may act only
173
+ on Your own behalf and on Your sole responsibility, not on behalf
174
+ of any other Contributor, and only if You agree to indemnify,
175
+ defend, and hold each Contributor harmless for any liability
176
+ incurred by, or claims asserted against, such Contributor by reason
177
+ of your accepting any such warranty or additional liability.
178
+
179
+ END OF TERMS AND CONDITIONS
180
+
181
+ APPENDIX: How to apply the Apache License to your work.
182
+
183
+ To apply the Apache License to your work, attach the following
184
+ boilerplate notice, with the fields enclosed by brackets "[]"
185
+ replaced with your own identifying information. (Don't include
186
+ the brackets!) The text should be enclosed in the appropriate
187
+ comment syntax for the file format. We also recommend that a
188
+ file or class name and description of purpose be included on the
189
+ same "printed page" as the copyright notice for easier
190
+ identification within third-party archives.
191
+
192
+ Copyright [yyyy] [name of copyright owner]
193
+
194
+ Licensed under the Apache License, Version 2.0 (the "License");
195
+ you may not use this file except in compliance with the License.
196
+ You may obtain a copy of the License at
197
+
198
+ http://www.apache.org/licenses/LICENSE-2.0
199
+
200
+ Unless required by applicable law or agreed to in writing, software
201
+ distributed under the License is distributed on an "AS IS" BASIS,
202
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203
+ See the License for the specific language governing permissions and
204
+ limitations under the License.
package/README.md CHANGED
@@ -1,3 +1,266 @@
1
- # Temporary Holding Version
1
+ # amo: amoCRM and Kommo CLI for AI agents
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ <p align="center">
4
+ Know where every deal stands and what changed overnight, without opening amoCRM. Ask your AI agent, and it answers
5
+ from a copy of your deals on your computer, even offline. It moves and closes deals for you too, as far as you allow.
6
+ </p>
7
+
8
+ <p align="center">
9
+ <a href="https://github.com/WireCatLabs/amo-cli/blob/main/docs/index.md">Docs</a> ·
10
+ <a href="https://github.com/WireCatLabs/amo-cli/blob/main/docs/installation.md">Install</a> ·
11
+ <a href="https://github.com/WireCatLabs/amo-cli/blob/main/docs/usage.md">Usage</a> ·
12
+ <a href="https://t.me/wirecatdev">Telegram</a>
13
+ </p>
14
+
15
+ <p align="center">
16
+ <a href="https://www.npmjs.com/package/@wirecat/amo-cli"><img src="https://img.shields.io/npm/v/@wirecat/amo-cli" alt="npm"></a>
17
+ <a href="https://github.com/WireCatLabs/amo-cli/actions/workflows/ci.yml"><img src="https://github.com/WireCatLabs/amo-cli/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
18
+ <a href="https://github.com/WireCatLabs/amo-cli/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-Apache--2.0-blue" alt="License: Apache 2.0"></a>
19
+ </p>
20
+
21
+ - **Ask instead of clicking.** "Which deals are stuck in Quote sent?" gets an answer in a second, in Claude Code, Codex
22
+ or any app that speaks MCP.
23
+ - **The morning starts with what changed.** A short digest of yesterday's wins, losses and moves arrives before you
24
+ open the CRM.
25
+ - **Nothing happens behind your back.** Every action has its own permission, and nothing reaches a client until you
26
+ allow it.
27
+
28
+ ## What you get
29
+
30
+ - **The answer, not the search.** Ask about a deal, a client or a stage in your own words. The agent finds the deal
31
+ with its amount and owner, and the phones of the people on it.
32
+ - **The funnel at a glance.** How far deals get this month, at which stage they drop off, and how much of it you won.
33
+ - **Changes by asking.** "Move Example kitchen to Negotiation" or "close it as lost, the price was too high" is enough.
34
+ The agent finds the stage by its name.
35
+ - **One search across your work.** A deal turns up next to the chat where you agreed on it and the meeting where you
36
+ discussed it, if you use the other WireCat tools.
37
+
38
+ ```text
39
+ You: What changed in the CRM since yesterday?
40
+ Agent: (runs amo work changes list "at>=1d")
41
+ · New deal "Example kitchen", 15 000 EUR, in Quote sent
42
+ · "Example office" won, 8 200 EUR
43
+ · Task "Call back about the quote" added on "Example kitchen"
44
+ You: Move Example kitchen to Negotiation.
45
+ Agent: (runs amo work deals move deal:12 "Negotiation")
46
+ Done. "Example kitchen" is in Negotiation now.
47
+ ```
48
+
49
+ ## Why amo
50
+
51
+ - **A copy of your deals on your computer.** `sync` copies your deals with their contacts and companies, and the next
52
+ sync takes only the changes. Lists, the funnel and search then answer with no request to amoCRM, also offline. None
53
+ of the other tools in the comparison documents a copy like this.
54
+ - **A permission on every action.** Each command and each operation of the amoCRM API has its own level: allow, ask,
55
+ read only or deny. Messages to clients, Salesbots and webhooks are denied until you allow them, and
56
+ `AMO_READ_ONLY=1` stops every write.
57
+ - **The token stays in the system keyring.** It never appears in output, errors or run records, and no command takes
58
+ it as an argument.
59
+ - **A digest of what changed.** `changes list` shows what each sync saw change, and a schedule sends it to you every
60
+ morning.
61
+ - **Your CRM beside your other context.** Deals sit in the same local store as your messages, notes and meetings from
62
+ the other WireCat tools, and `search all` finds them together.
63
+ - **amoCRM and Kommo, as many accounts as you need.** Each account is a profile you name in the command, and none is
64
+ ever picked for you.
65
+ - **Free and open source.** Apache 2.0.
66
+
67
+ How it compares with other amoCRM and Kommo tools and MCP servers:
68
+ [the comparison](https://wirecat.dev/en/docs/amo/compare). Another tool fits better when an agent should set tasks
69
+ and write notes by itself. In `amo` that takes `api call`, which you run yourself after you allow it.
70
+
71
+ ## Quick start
72
+
73
+ ```sh
74
+ npm install -g @wirecat/amo-cli
75
+ amo skill install # the agent skill, for Claude Code, Codex, Gemini CLI and OpenClaw
76
+ amo work setup # make a private integration in amoCRM or Kommo, paste its token
77
+ amo work sync # copy your deals and their clients
78
+ amo work deals list status:open
79
+ ```
80
+
81
+ `work` is a profile, a name you choose for one account. It is the first word of every command that uses the account,
82
+ and none is ever assumed. `amo work setup` shows each click in amoCRM or Kommo, asks for the account's address and the
83
+ integration's long-lived token, checks them against the account and keeps the token in the system keyring. An account
84
+ administrator makes the integration once. A sync copies the deals assigned to the user the token belongs to. To copy
85
+ a colleague's too, see
86
+ [which deals sync copies](https://github.com/WireCatLabs/amo-cli/blob/main/docs/configuration.md#which-deals-sync-copies).
87
+
88
+ You need Node.js 22.16 or a later 22.x, or Node.js 24 or later. `amo doctor` needs no network and shows what is set
89
+ up.
90
+
91
+ More: [install and connect](https://github.com/WireCatLabs/amo-cli/blob/main/docs/installation.md), with the browser
92
+ sign-in through the integration.
93
+
94
+ ## Use it with your agent
95
+
96
+ Ask in plain words. The agent picks the commands.
97
+
98
+ > *"Use amo. Which deals are waiting in Quote sent, and for how much?"*
99
+ > *"Use amo. What changed in the CRM since yesterday?"*
100
+ > *"Use amo. Close the Example office deal as lost, the client chose another supplier."*
101
+
102
+ - **Claude Code, Codex, Gemini CLI, OpenClaw** and other agents with a terminal run `amo` themselves.
103
+ `amo skill install` teaches them how.
104
+ - **Claude Desktop, Cursor** and other MCP apps connect to `amo work mcp serve`.
105
+ - **ChatGPT or Claude in the browser** reach it through your own tunnel, after a login with a one-time code.
106
+
107
+ ```sh
108
+ amo work mcp add claude-code --allow-writes # or: codex
109
+ amo work mcp config # the entry for Claude Desktop, Cursor and others
110
+ ```
111
+
112
+ Over MCP nobody is at a terminal to answer a question, so a write set to `ask` goes ahead. Before an agent gets the
113
+ profile over MCP, set the writes it must not make to `readonly` or `deny`, or turn on approval in the agent's client.
114
+ Text from the account reaches the agent marked as untrusted, so the agent reads it as data, never as instructions.
115
+
116
+ More: [agents and MCP](https://github.com/WireCatLabs/amo-cli/blob/main/docs/mcp.md) ·
117
+ [permissions](https://github.com/WireCatLabs/amo-cli/blob/main/docs/permissions.md)
118
+
119
+ ## What it can do
120
+
121
+ ### Deals and the pipeline
122
+
123
+ ```sh
124
+ amo work deals list stage:"Quote sent" # from the copy, offline too
125
+ amo work pipelines show Sales --since-time 30d # the board and the funnel, with the win rate
126
+ amo work deals move deal:12 "Negotiation" # a stage by its name
127
+ amo work deals close deal:12 lost --reason "Example: chose another supplier"
128
+ ```
129
+
130
+ Create and update deals with the CRM's own fields by their labels. `--dry-run` shows what a change would do and the
131
+ permissions it checks.
132
+
133
+ More: [use it](https://github.com/WireCatLabs/amo-cli/blob/main/docs/usage.md#read-your-deals)
134
+
135
+ ### Contacts and companies
136
+
137
+ ```sh
138
+ amo work people list "Anna" # any contact in the account, read live
139
+ amo work organizations list "Example LLC"
140
+ amo work organizations update 9 --name "Example Ltd"
141
+ ```
142
+
143
+ The copy keeps only the clients on your deals. Any other client is read live from the account.
144
+
145
+ ### Tasks and what changed
146
+
147
+ ```sh
148
+ amo work activities list overdue:true # open tasks past their due time
149
+ amo work changes list "at>=1d" # what changed in the last day
150
+ amo work schedule command crm-digest --at 08:30 -- changes list --format report
151
+ ```
152
+
153
+ Tasks, comments and calls are copied once you turn on the activities setting. The digest goes to a desktop notice,
154
+ or to Telegram or a mailbox through your own WireCat `tg` or `mail`.
155
+
156
+ More: [tasks and the digest](https://github.com/WireCatLabs/amo-cli/blob/main/docs/usage.md#tasks-and-what-changed)
157
+
158
+ ### Any API operation
159
+
160
+ ```sh
161
+ amo work api list family:leads effect:write # every operation on deals, with its permission
162
+ amo work api call "GET /api/v4/leads" --params '{"limit":5}'
163
+ ```
164
+
165
+ Every operation of amoCRM's API v4 reference can be called, each checked against its own permission.
166
+
167
+ More: [call the API](https://github.com/WireCatLabs/amo-cli/blob/main/docs/usage.md#call-the-api)
168
+
169
+ ### With your other sources
170
+
171
+ `amo` keeps your deals in the same local store as the other WireCat tools, such as Telegram, MAX, mail and Google
172
+ Calendar. `amo work search all "Example LLC"` finds the deal beside the messages and meetings that mention it.
173
+
174
+ More: [WireCat](https://wirecat.dev)
175
+
176
+ ## How it works
177
+
178
+ - **Two ways to sign in.** A long-lived token acts with the rights of the administrator who made it. A sign-in through
179
+ the integration in the browser acts with the rights of the person who signs in, and `amo` renews it itself. Either is
180
+ kept in your system keyring.
181
+ - **A copy of your share of the CRM.** `sync` copies the pipelines, the deals assigned to you and only the contacts and
182
+ companies on them. An administrator can choose colleagues too. No sync copies the whole CRM.
183
+ - **Staying current.** `amo work schedule command crm --every 1h -- sync` keeps the copy fresh with a timer.
184
+ - **Polite to amoCRM.** `amo` keeps to 5 requests a second for every `amo` process on the account, under amoCRM's
185
+ limit, and waits out a short refusal.
186
+ - **No double writes.** When the answer to a write is lost, `amo` does not send it again. It reports the outcome as
187
+ unknown, so you check the record first.
188
+ - **Made for scripts.** `--json` prints one JSON value, and every error has a code to branch on.
189
+
190
+ More: [command reference](https://github.com/WireCatLabs/amo-cli/blob/main/docs/commands.md)
191
+
192
+ ## Settings and permissions
193
+
194
+ Each profile has a permission level for every command and every API operation: `allow`, `ask`, `readonly` or `deny`.
195
+ Creating and changing deals, contacts and companies is allowed. Deletes and most other writes ask first. Messages to
196
+ clients, Salesbots, webhooks, writing tasks and giving a record to another user are denied until you allow them.
197
+
198
+ ```sh
199
+ amo work config set permissions.deals.close deny # this profile closes no deal
200
+ ```
201
+
202
+ A stage change can start the account's own automation, such as a Salesbot that writes to a client. If your account
203
+ has one, decide who may move a deal before an agent gets the profile.
204
+
205
+ More: [permissions](https://github.com/WireCatLabs/amo-cli/blob/main/docs/permissions.md) ·
206
+ [settings](https://github.com/WireCatLabs/amo-cli/blob/main/docs/configuration.md)
207
+
208
+ ## Limits
209
+
210
+ - `amo` is tested against a fake account built from the Kommo API reference, and each release passes a check on a
211
+ live test account: it syncs, reads, and creates, moves and closes a deal.
212
+ - amoCRM's API v4 has no call that deletes a deal, so there is no `deals delete`. Close the deal as lost instead.
213
+ - Files on deals and contacts are not supported yet.
214
+ - Without amoCRM's paid API filter add-on, `sync` reads a contact or company one request at a time, and a live list
215
+ of contacts or companies cannot be narrowed by owner or time. A search by words still works.
216
+ - The Chats API, Drive and amoCRM's AI agent API live on other hosts, and `amo` does not reach them.
217
+ - Before 1.0, a minor version may change commands, `--json` fields and MCP tools. The changelog marks each such
218
+ change.
219
+
220
+ ## Security
221
+
222
+ The token works like a password: anyone who has it can do what its administrator can. `amo` keeps it in the system
223
+ keyring and never prints it. amoCRM has no call that revokes a token, so after a leak revoke it in the integration
224
+ itself.
225
+
226
+ More: [security](https://github.com/WireCatLabs/amo-cli/blob/main/docs/security.md) · Report a vulnerability:
227
+ [SECURITY.md](https://github.com/WireCatLabs/amo-cli/blob/main/SECURITY.md)
228
+
229
+ ## When something goes wrong
230
+
231
+ ```sh
232
+ amo doctor # what is set up, without connecting
233
+ amo work session status --check # whether the sign-in works, and as whom
234
+ ```
235
+
236
+ More: [troubleshooting](https://github.com/WireCatLabs/amo-cli/blob/main/docs/troubleshooting.md) · Ask on
237
+ [Discord](https://discord.gg/DebENqbRrJ) · Bugs go to this repository's issues.
238
+
239
+ ## Documentation
240
+
241
+ Everything is on [wirecat.dev/en/docs/amo](https://wirecat.dev/en/docs/amo). The same pages are in
242
+ [docs/](https://github.com/WireCatLabs/amo-cli/blob/main/docs/index.md).
243
+
244
+ ## Development
245
+
246
+ You need Node.js 22.16 or a later 22.x, or Node.js 24 or later, and pnpm.
247
+
248
+ ```sh
249
+ pnpm install && pnpm test
250
+ ```
251
+
252
+ Tests run against a fake account built from the Kommo API reference, with invented records and an injected keyring.
253
+ Nothing reaches a real account. `pnpm release:check` runs every check a release needs.
254
+
255
+ More: [testing](https://github.com/WireCatLabs/amo-cli/blob/main/docs/dev/TESTING.md) · [design](https://github.com/WireCatLabs/amo-cli/blob/main/docs/dev/DESIGN.md)
256
+
257
+ Pull requests, bug reports and ideas go to [issues](https://github.com/WireCatLabs/amo-cli/issues).
258
+
259
+ ## Part of WireCat
260
+
261
+ `amo` is one of the [WireCat](https://wirecat.dev) tools: open-source, local-first command-line tools that give AI
262
+ agents your context from messengers, mail, calendars, documents and CRMs. Each one works on its own.
263
+
264
+ ## License
265
+
266
+ [Apache 2.0](https://github.com/WireCatLabs/amo-cli/blob/main/LICENSE)