@pachca/cli 2026.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (369) hide show
  1. package/README.md +352 -0
  2. package/README.template.md +190 -0
  3. package/bin/dev.js +5 -0
  4. package/bin/run.js +5 -0
  5. package/dist/base-command.d.ts +74 -0
  6. package/dist/base-command.d.ts.map +1 -0
  7. package/dist/base-command.js +242 -0
  8. package/dist/base-command.js.map +1 -0
  9. package/dist/client.d.ts +45 -0
  10. package/dist/client.d.ts.map +1 -0
  11. package/dist/client.js +258 -0
  12. package/dist/client.js.map +1 -0
  13. package/dist/commands/api.d.ts +38 -0
  14. package/dist/commands/api.d.ts.map +1 -0
  15. package/dist/commands/api.js +212 -0
  16. package/dist/commands/api.js.map +1 -0
  17. package/dist/commands/auth/list.d.ts +23 -0
  18. package/dist/commands/auth/list.d.ts.map +1 -0
  19. package/dist/commands/auth/list.js +39 -0
  20. package/dist/commands/auth/list.js.map +1 -0
  21. package/dist/commands/auth/login.d.ts +23 -0
  22. package/dist/commands/auth/login.d.ts.map +1 -0
  23. package/dist/commands/auth/login.js +140 -0
  24. package/dist/commands/auth/login.js.map +1 -0
  25. package/dist/commands/auth/logout.d.ts +26 -0
  26. package/dist/commands/auth/logout.d.ts.map +1 -0
  27. package/dist/commands/auth/logout.js +81 -0
  28. package/dist/commands/auth/logout.js.map +1 -0
  29. package/dist/commands/auth/refresh.d.ts +26 -0
  30. package/dist/commands/auth/refresh.d.ts.map +1 -0
  31. package/dist/commands/auth/refresh.js +68 -0
  32. package/dist/commands/auth/refresh.js.map +1 -0
  33. package/dist/commands/auth/status.d.ts +23 -0
  34. package/dist/commands/auth/status.d.ts.map +1 -0
  35. package/dist/commands/auth/status.js +51 -0
  36. package/dist/commands/auth/status.js.map +1 -0
  37. package/dist/commands/auth/switch.d.ts +26 -0
  38. package/dist/commands/auth/switch.d.ts.map +1 -0
  39. package/dist/commands/auth/switch.js +37 -0
  40. package/dist/commands/auth/switch.js.map +1 -0
  41. package/dist/commands/bots/list-events.d.ts +31 -0
  42. package/dist/commands/bots/list-events.d.ts.map +1 -0
  43. package/dist/commands/bots/list-events.js +85 -0
  44. package/dist/commands/bots/list-events.js.map +1 -0
  45. package/dist/commands/bots/remove-event.d.ts +30 -0
  46. package/dist/commands/bots/remove-event.d.ts.map +1 -0
  47. package/dist/commands/bots/remove-event.js +48 -0
  48. package/dist/commands/bots/remove-event.js.map +1 -0
  49. package/dist/commands/bots/update.d.ts +34 -0
  50. package/dist/commands/bots/update.d.ts.map +1 -0
  51. package/dist/commands/bots/update.js +78 -0
  52. package/dist/commands/bots/update.js.map +1 -0
  53. package/dist/commands/changelog.d.ts +23 -0
  54. package/dist/commands/changelog.d.ts.map +1 -0
  55. package/dist/commands/changelog.js +40 -0
  56. package/dist/commands/changelog.js.map +1 -0
  57. package/dist/commands/chats/archive.d.ts +32 -0
  58. package/dist/commands/chats/archive.d.ts.map +1 -0
  59. package/dist/commands/chats/archive.js +35 -0
  60. package/dist/commands/chats/archive.js.map +1 -0
  61. package/dist/commands/chats/create.d.ts +33 -0
  62. package/dist/commands/chats/create.d.ts.map +1 -0
  63. package/dist/commands/chats/create.js +91 -0
  64. package/dist/commands/chats/create.js.map +1 -0
  65. package/dist/commands/chats/get.d.ts +33 -0
  66. package/dist/commands/chats/get.d.ts.map +1 -0
  67. package/dist/commands/chats/get.js +35 -0
  68. package/dist/commands/chats/get.js.map +1 -0
  69. package/dist/commands/chats/list.d.ts +37 -0
  70. package/dist/commands/chats/list.d.ts.map +1 -0
  71. package/dist/commands/chats/list.js +117 -0
  72. package/dist/commands/chats/list.js.map +1 -0
  73. package/dist/commands/chats/unarchive.d.ts +32 -0
  74. package/dist/commands/chats/unarchive.d.ts.map +1 -0
  75. package/dist/commands/chats/unarchive.js +34 -0
  76. package/dist/commands/chats/unarchive.js.map +1 -0
  77. package/dist/commands/chats/update.d.ts +35 -0
  78. package/dist/commands/chats/update.d.ts.map +1 -0
  79. package/dist/commands/chats/update.js +52 -0
  80. package/dist/commands/chats/update.js.map +1 -0
  81. package/dist/commands/commands.d.ts +24 -0
  82. package/dist/commands/commands.d.ts.map +1 -0
  83. package/dist/commands/commands.js +71 -0
  84. package/dist/commands/commands.js.map +1 -0
  85. package/dist/commands/common/custom-properties.d.ts +29 -0
  86. package/dist/commands/common/custom-properties.d.ts.map +1 -0
  87. package/dist/commands/common/custom-properties.js +68 -0
  88. package/dist/commands/common/custom-properties.js.map +1 -0
  89. package/dist/commands/common/direct-url.d.ts +35 -0
  90. package/dist/commands/common/direct-url.d.ts.map +1 -0
  91. package/dist/commands/common/direct-url.js +123 -0
  92. package/dist/commands/common/direct-url.js.map +1 -0
  93. package/dist/commands/common/get-exports.d.ts +34 -0
  94. package/dist/commands/common/get-exports.d.ts.map +1 -0
  95. package/dist/commands/common/get-exports.js +47 -0
  96. package/dist/commands/common/get-exports.js.map +1 -0
  97. package/dist/commands/common/request-export.d.ts +33 -0
  98. package/dist/commands/common/request-export.d.ts.map +1 -0
  99. package/dist/commands/common/request-export.js +90 -0
  100. package/dist/commands/common/request-export.js.map +1 -0
  101. package/dist/commands/common/uploads.d.ts +28 -0
  102. package/dist/commands/common/uploads.d.ts.map +1 -0
  103. package/dist/commands/common/uploads.js +29 -0
  104. package/dist/commands/common/uploads.js.map +1 -0
  105. package/dist/commands/config/get.d.ts +26 -0
  106. package/dist/commands/config/get.d.ts.map +1 -0
  107. package/dist/commands/config/get.js +28 -0
  108. package/dist/commands/config/get.js.map +1 -0
  109. package/dist/commands/config/list.d.ts +23 -0
  110. package/dist/commands/config/list.d.ts.map +1 -0
  111. package/dist/commands/config/list.js +49 -0
  112. package/dist/commands/config/list.js.map +1 -0
  113. package/dist/commands/config/set.d.ts +27 -0
  114. package/dist/commands/config/set.d.ts.map +1 -0
  115. package/dist/commands/config/set.js +30 -0
  116. package/dist/commands/config/set.js.map +1 -0
  117. package/dist/commands/doctor.d.ts +24 -0
  118. package/dist/commands/doctor.d.ts.map +1 -0
  119. package/dist/commands/doctor.js +175 -0
  120. package/dist/commands/doctor.js.map +1 -0
  121. package/dist/commands/group-tags/create.d.ts +29 -0
  122. package/dist/commands/group-tags/create.d.ts.map +1 -0
  123. package/dist/commands/group-tags/create.js +74 -0
  124. package/dist/commands/group-tags/create.js.map +1 -0
  125. package/dist/commands/group-tags/delete.d.ts +32 -0
  126. package/dist/commands/group-tags/delete.d.ts.map +1 -0
  127. package/dist/commands/group-tags/delete.js +45 -0
  128. package/dist/commands/group-tags/delete.js.map +1 -0
  129. package/dist/commands/group-tags/get.d.ts +32 -0
  130. package/dist/commands/group-tags/get.d.ts.map +1 -0
  131. package/dist/commands/group-tags/get.js +32 -0
  132. package/dist/commands/group-tags/get.js.map +1 -0
  133. package/dist/commands/group-tags/list-users.d.ts +36 -0
  134. package/dist/commands/group-tags/list-users.d.ts.map +1 -0
  135. package/dist/commands/group-tags/list-users.js +90 -0
  136. package/dist/commands/group-tags/list-users.js.map +1 -0
  137. package/dist/commands/group-tags/list.d.ts +32 -0
  138. package/dist/commands/group-tags/list.d.ts.map +1 -0
  139. package/dist/commands/group-tags/list.js +91 -0
  140. package/dist/commands/group-tags/list.js.map +1 -0
  141. package/dist/commands/group-tags/update.d.ts +33 -0
  142. package/dist/commands/group-tags/update.d.ts.map +1 -0
  143. package/dist/commands/group-tags/update.js +75 -0
  144. package/dist/commands/group-tags/update.js.map +1 -0
  145. package/dist/commands/guide.d.ts +26 -0
  146. package/dist/commands/guide.d.ts.map +1 -0
  147. package/dist/commands/guide.js +86 -0
  148. package/dist/commands/guide.js.map +1 -0
  149. package/dist/commands/introspect.d.ts +27 -0
  150. package/dist/commands/introspect.d.ts.map +1 -0
  151. package/dist/commands/introspect.js +82 -0
  152. package/dist/commands/introspect.js.map +1 -0
  153. package/dist/commands/link-previews/add.d.ts +33 -0
  154. package/dist/commands/link-previews/add.d.ts.map +1 -0
  155. package/dist/commands/link-previews/add.js +76 -0
  156. package/dist/commands/link-previews/add.js.map +1 -0
  157. package/dist/commands/members/add-group-tags.d.ts +32 -0
  158. package/dist/commands/members/add-group-tags.d.ts.map +1 -0
  159. package/dist/commands/members/add-group-tags.js +73 -0
  160. package/dist/commands/members/add-group-tags.js.map +1 -0
  161. package/dist/commands/members/add.d.ts +34 -0
  162. package/dist/commands/members/add.d.ts.map +1 -0
  163. package/dist/commands/members/add.js +82 -0
  164. package/dist/commands/members/add.js.map +1 -0
  165. package/dist/commands/members/leave.d.ts +33 -0
  166. package/dist/commands/members/leave.d.ts.map +1 -0
  167. package/dist/commands/members/leave.js +48 -0
  168. package/dist/commands/members/leave.js.map +1 -0
  169. package/dist/commands/members/list.d.ts +37 -0
  170. package/dist/commands/members/list.d.ts.map +1 -0
  171. package/dist/commands/members/list.js +97 -0
  172. package/dist/commands/members/list.js.map +1 -0
  173. package/dist/commands/members/remove-group-tag.d.ts +36 -0
  174. package/dist/commands/members/remove-group-tag.d.ts.map +1 -0
  175. package/dist/commands/members/remove-group-tag.js +49 -0
  176. package/dist/commands/members/remove-group-tag.js.map +1 -0
  177. package/dist/commands/members/remove.d.ts +37 -0
  178. package/dist/commands/members/remove.d.ts.map +1 -0
  179. package/dist/commands/members/remove.js +53 -0
  180. package/dist/commands/members/remove.js.map +1 -0
  181. package/dist/commands/members/update.d.ts +36 -0
  182. package/dist/commands/members/update.d.ts.map +1 -0
  183. package/dist/commands/members/update.js +39 -0
  184. package/dist/commands/members/update.js.map +1 -0
  185. package/dist/commands/messages/create.d.ts +38 -0
  186. package/dist/commands/messages/create.d.ts.map +1 -0
  187. package/dist/commands/messages/create.js +128 -0
  188. package/dist/commands/messages/create.js.map +1 -0
  189. package/dist/commands/messages/delete.d.ts +33 -0
  190. package/dist/commands/messages/delete.d.ts.map +1 -0
  191. package/dist/commands/messages/delete.js +50 -0
  192. package/dist/commands/messages/delete.js.map +1 -0
  193. package/dist/commands/messages/get.d.ts +33 -0
  194. package/dist/commands/messages/get.d.ts.map +1 -0
  195. package/dist/commands/messages/get.js +37 -0
  196. package/dist/commands/messages/get.js.map +1 -0
  197. package/dist/commands/messages/list.d.ts +33 -0
  198. package/dist/commands/messages/list.d.ts.map +1 -0
  199. package/dist/commands/messages/list.js +127 -0
  200. package/dist/commands/messages/list.js.map +1 -0
  201. package/dist/commands/messages/pin.d.ts +32 -0
  202. package/dist/commands/messages/pin.d.ts.map +1 -0
  203. package/dist/commands/messages/pin.js +35 -0
  204. package/dist/commands/messages/pin.js.map +1 -0
  205. package/dist/commands/messages/unpin.d.ts +33 -0
  206. package/dist/commands/messages/unpin.d.ts.map +1 -0
  207. package/dist/commands/messages/unpin.js +49 -0
  208. package/dist/commands/messages/unpin.js.map +1 -0
  209. package/dist/commands/messages/update.d.ts +38 -0
  210. package/dist/commands/messages/update.d.ts.map +1 -0
  211. package/dist/commands/messages/update.js +74 -0
  212. package/dist/commands/messages/update.js.map +1 -0
  213. package/dist/commands/profile/delete-status.d.ts +28 -0
  214. package/dist/commands/profile/delete-status.d.ts.map +1 -0
  215. package/dist/commands/profile/delete-status.js +44 -0
  216. package/dist/commands/profile/delete-status.js.map +1 -0
  217. package/dist/commands/profile/get-info.d.ts +27 -0
  218. package/dist/commands/profile/get-info.d.ts.map +1 -0
  219. package/dist/commands/profile/get-info.js +26 -0
  220. package/dist/commands/profile/get-info.js.map +1 -0
  221. package/dist/commands/profile/get-status.d.ts +28 -0
  222. package/dist/commands/profile/get-status.d.ts.map +1 -0
  223. package/dist/commands/profile/get-status.js +29 -0
  224. package/dist/commands/profile/get-status.js.map +1 -0
  225. package/dist/commands/profile/get.d.ts +28 -0
  226. package/dist/commands/profile/get.d.ts.map +1 -0
  227. package/dist/commands/profile/get.js +29 -0
  228. package/dist/commands/profile/get.js.map +1 -0
  229. package/dist/commands/profile/update-status.d.ts +33 -0
  230. package/dist/commands/profile/update-status.d.ts.map +1 -0
  231. package/dist/commands/profile/update-status.js +95 -0
  232. package/dist/commands/profile/update-status.js.map +1 -0
  233. package/dist/commands/reactions/add.d.ts +35 -0
  234. package/dist/commands/reactions/add.d.ts.map +1 -0
  235. package/dist/commands/reactions/add.js +82 -0
  236. package/dist/commands/reactions/add.js.map +1 -0
  237. package/dist/commands/reactions/list.d.ts +36 -0
  238. package/dist/commands/reactions/list.d.ts.map +1 -0
  239. package/dist/commands/reactions/list.js +91 -0
  240. package/dist/commands/reactions/list.js.map +1 -0
  241. package/dist/commands/reactions/remove.d.ts +35 -0
  242. package/dist/commands/reactions/remove.d.ts.map +1 -0
  243. package/dist/commands/reactions/remove.js +88 -0
  244. package/dist/commands/reactions/remove.js.map +1 -0
  245. package/dist/commands/read-member/list-readers.d.ts +35 -0
  246. package/dist/commands/read-member/list-readers.d.ts.map +1 -0
  247. package/dist/commands/read-member/list-readers.js +89 -0
  248. package/dist/commands/read-member/list-readers.js.map +1 -0
  249. package/dist/commands/search/list-chats.d.ts +38 -0
  250. package/dist/commands/search/list-chats.d.ts.map +1 -0
  251. package/dist/commands/search/list-chats.js +122 -0
  252. package/dist/commands/search/list-chats.js.map +1 -0
  253. package/dist/commands/search/list-messages.d.ts +38 -0
  254. package/dist/commands/search/list-messages.d.ts.map +1 -0
  255. package/dist/commands/search/list-messages.js +121 -0
  256. package/dist/commands/search/list-messages.js.map +1 -0
  257. package/dist/commands/search/list-users.d.ts +37 -0
  258. package/dist/commands/search/list-users.d.ts.map +1 -0
  259. package/dist/commands/search/list-users.js +117 -0
  260. package/dist/commands/search/list-users.js.map +1 -0
  261. package/dist/commands/security/list.d.ts +39 -0
  262. package/dist/commands/security/list.d.ts.map +1 -0
  263. package/dist/commands/security/list.js +155 -0
  264. package/dist/commands/security/list.js.map +1 -0
  265. package/dist/commands/tasks/create.d.ts +36 -0
  266. package/dist/commands/tasks/create.d.ts.map +1 -0
  267. package/dist/commands/tasks/create.js +111 -0
  268. package/dist/commands/tasks/create.js.map +1 -0
  269. package/dist/commands/tasks/delete.d.ts +33 -0
  270. package/dist/commands/tasks/delete.d.ts.map +1 -0
  271. package/dist/commands/tasks/delete.js +50 -0
  272. package/dist/commands/tasks/delete.js.map +1 -0
  273. package/dist/commands/tasks/get.d.ts +33 -0
  274. package/dist/commands/tasks/get.d.ts.map +1 -0
  275. package/dist/commands/tasks/get.js +37 -0
  276. package/dist/commands/tasks/get.js.map +1 -0
  277. package/dist/commands/tasks/list.d.ts +31 -0
  278. package/dist/commands/tasks/list.d.ts.map +1 -0
  279. package/dist/commands/tasks/list.js +87 -0
  280. package/dist/commands/tasks/list.js.map +1 -0
  281. package/dist/commands/tasks/update.d.ts +42 -0
  282. package/dist/commands/tasks/update.d.ts.map +1 -0
  283. package/dist/commands/tasks/update.js +90 -0
  284. package/dist/commands/tasks/update.js.map +1 -0
  285. package/dist/commands/thread/add.d.ts +33 -0
  286. package/dist/commands/thread/add.d.ts.map +1 -0
  287. package/dist/commands/thread/add.js +36 -0
  288. package/dist/commands/thread/add.js.map +1 -0
  289. package/dist/commands/thread/get.d.ts +32 -0
  290. package/dist/commands/thread/get.d.ts.map +1 -0
  291. package/dist/commands/thread/get.js +32 -0
  292. package/dist/commands/thread/get.js.map +1 -0
  293. package/dist/commands/users/create.d.ts +30 -0
  294. package/dist/commands/users/create.d.ts.map +1 -0
  295. package/dist/commands/users/create.js +78 -0
  296. package/dist/commands/users/create.js.map +1 -0
  297. package/dist/commands/users/delete.d.ts +33 -0
  298. package/dist/commands/users/delete.d.ts.map +1 -0
  299. package/dist/commands/users/delete.js +50 -0
  300. package/dist/commands/users/delete.js.map +1 -0
  301. package/dist/commands/users/get-status.d.ts +33 -0
  302. package/dist/commands/users/get-status.d.ts.map +1 -0
  303. package/dist/commands/users/get-status.js +37 -0
  304. package/dist/commands/users/get-status.js.map +1 -0
  305. package/dist/commands/users/get.d.ts +33 -0
  306. package/dist/commands/users/get.d.ts.map +1 -0
  307. package/dist/commands/users/get.js +37 -0
  308. package/dist/commands/users/get.js.map +1 -0
  309. package/dist/commands/users/list.d.ts +32 -0
  310. package/dist/commands/users/list.d.ts.map +1 -0
  311. package/dist/commands/users/list.js +92 -0
  312. package/dist/commands/users/list.js.map +1 -0
  313. package/dist/commands/users/remove-status.d.ts +33 -0
  314. package/dist/commands/users/remove-status.d.ts.map +1 -0
  315. package/dist/commands/users/remove-status.js +50 -0
  316. package/dist/commands/users/remove-status.js.map +1 -0
  317. package/dist/commands/users/update-status.d.ts +38 -0
  318. package/dist/commands/users/update-status.d.ts.map +1 -0
  319. package/dist/commands/users/update-status.js +101 -0
  320. package/dist/commands/users/update-status.js.map +1 -0
  321. package/dist/commands/users/update.d.ts +44 -0
  322. package/dist/commands/users/update.d.ts.map +1 -0
  323. package/dist/commands/users/update.js +90 -0
  324. package/dist/commands/users/update.js.map +1 -0
  325. package/dist/commands/version.d.ts +23 -0
  326. package/dist/commands/version.d.ts.map +1 -0
  327. package/dist/commands/version.js +23 -0
  328. package/dist/commands/version.js.map +1 -0
  329. package/dist/commands/views/open.d.ts +32 -0
  330. package/dist/commands/views/open.d.ts.map +1 -0
  331. package/dist/commands/views/open.js +103 -0
  332. package/dist/commands/views/open.js.map +1 -0
  333. package/dist/data/alternatives.json +73 -0
  334. package/dist/data/changelog.json +328 -0
  335. package/dist/data/workflows.json +990 -0
  336. package/dist/get-version.d.ts +7 -0
  337. package/dist/get-version.d.ts.map +1 -0
  338. package/dist/get-version.js +23 -0
  339. package/dist/get-version.js.map +1 -0
  340. package/dist/hooks/command-not-found.d.ts +4 -0
  341. package/dist/hooks/command-not-found.d.ts.map +1 -0
  342. package/dist/hooks/command-not-found.js +51 -0
  343. package/dist/hooks/command-not-found.js.map +1 -0
  344. package/dist/hooks/init.d.ts +4 -0
  345. package/dist/hooks/init.d.ts.map +1 -0
  346. package/dist/hooks/init.js +95 -0
  347. package/dist/hooks/init.js.map +1 -0
  348. package/dist/hooks/postrun.d.ts +4 -0
  349. package/dist/hooks/postrun.d.ts.map +1 -0
  350. package/dist/hooks/postrun.js +67 -0
  351. package/dist/hooks/postrun.js.map +1 -0
  352. package/dist/index.d.ts +2 -0
  353. package/dist/index.d.ts.map +1 -0
  354. package/dist/index.js +2 -0
  355. package/dist/index.js.map +1 -0
  356. package/dist/output.d.ts +26 -0
  357. package/dist/output.d.ts.map +1 -0
  358. package/dist/output.js +175 -0
  359. package/dist/output.js.map +1 -0
  360. package/dist/profiles.d.ts +52 -0
  361. package/dist/profiles.d.ts.map +1 -0
  362. package/dist/profiles.js +192 -0
  363. package/dist/profiles.js.map +1 -0
  364. package/dist/utils.d.ts +21 -0
  365. package/dist/utils.d.ts.map +1 -0
  366. package/dist/utils.js +62 -0
  367. package/dist/utils.js.map +1 -0
  368. package/oclif.manifest.json +12266 -0
  369. package/package.json +73 -0
package/README.md ADDED
@@ -0,0 +1,352 @@
1
+ # @pachca/cli
2
+
3
+ Официальный CLI для [Пачки](https://pachca.com).
4
+
5
+ ## Установка
6
+
7
+ ```
8
+ npm install -g @pachca/cli
9
+
10
+ # Или без установки:
11
+ npx @pachca/cli users list
12
+ ```
13
+
14
+ ## Быстрый старт
15
+
16
+ ```
17
+ pachca auth login # сохранить токен
18
+ pachca users list # список сотрудников
19
+ pachca messages create --entity-id 123 --content "Привет!"
20
+ ```
21
+
22
+ Получить токен: https://dev.pachca.com/guides/authorization
23
+
24
+ ## Использование в агентах (Claude, Cursor и др.)
25
+
26
+ Если агент устанавливает CLI по просьбе пользователя и токена ещё нет — агент должен запросить его у пользователя:
27
+
28
+ ```
29
+ # Агент спрашивает: "Нужен API-токен Пачки."
30
+ # "Получите его на https://dev.pachca.com/guides/authorization"
31
+ pachca auth login --token <токен от пользователя>
32
+
33
+ # Дальше команды работают без токена в каждой строке
34
+ pachca users list
35
+ pachca messages create --entity-id 123 --content "Привет!"
36
+ ```
37
+
38
+ Если токен уже есть в окружении — `auth login` не нужен:
39
+
40
+ ```
41
+ PACHCA_TOKEN=$TOKEN pachca users list
42
+ ```
43
+
44
+ ## Профили (несколько токенов)
45
+
46
+ Храните несколько токенов под именами — личный, боты:
47
+
48
+ ```
49
+ pachca auth login --profile personal
50
+ pachca auth login --profile bot-notify
51
+ pachca auth list
52
+ pachca auth switch bot-notify
53
+ ```
54
+
55
+ Токены хранятся в `~/.config/pachca/config.toml` (chmod 600).
56
+ В CI — через переменную окружения PACHCA_TOKEN.
57
+
58
+ ## Поиск по сценариям
59
+
60
+ Не знаете какую команду использовать? Поищите по задаче:
61
+
62
+ ```
63
+ pachca guide "отправить файл"
64
+ pachca guide "создать беседу и добавить участников"
65
+ pachca guide # список всех сценариев
66
+ ```
67
+
68
+ <!-- AUTO:COMMANDS -->
69
+ ## Команды
70
+
71
+ ### security
72
+
73
+ | Команда | Описание |
74
+ |---------|---------|
75
+ | `pachca security list` | Журнал аудита событий |
76
+
77
+ ### bots
78
+
79
+ | Команда | Описание |
80
+ |---------|---------|
81
+ | `pachca bots update` | Редактирование бота |
82
+ | `pachca bots list-events` | История событий |
83
+ | `pachca bots remove-event` | Удаление события |
84
+
85
+ ### chats
86
+
87
+ | Команда | Описание |
88
+ |---------|---------|
89
+ | `pachca chats create` | Новый чат |
90
+ | `pachca chats list` | Список чатов |
91
+ | `pachca chats get` | Информация о чате |
92
+ | `pachca chats update` | Обновление чата |
93
+ | `pachca chats archive` | Архивация чата |
94
+ | `pachca chats unarchive` | Разархивация чата |
95
+
96
+ ### common
97
+
98
+ | Команда | Описание |
99
+ |---------|---------|
100
+ | `pachca common request-export` | Экспорт сообщений |
101
+ | `pachca common get-exports` | Скачать архив экспорта |
102
+ | `pachca common custom-properties` | Список дополнительных полей |
103
+ | `pachca common direct-url` | Загрузка файла |
104
+ | `pachca common uploads` | Получение подписи, ключа и других параметров |
105
+
106
+ ### members
107
+
108
+ | Команда | Описание |
109
+ |---------|---------|
110
+ | `pachca members add-group-tags` | Добавление тегов |
111
+ | `pachca members remove-group-tag` | Исключение тега |
112
+ | `pachca members leave` | Выход из беседы или канала |
113
+ | `pachca members list` | Список участников чата |
114
+ | `pachca members add` | Добавление пользователей |
115
+ | `pachca members remove` | Исключение пользователя |
116
+ | `pachca members update` | Редактирование роли |
117
+
118
+ ### group-tags
119
+
120
+ | Команда | Описание |
121
+ |---------|---------|
122
+ | `pachca group-tags create` | Новый тег |
123
+ | `pachca group-tags list` | Список тегов сотрудников |
124
+ | `pachca group-tags get` | Информация о теге |
125
+ | `pachca group-tags update` | Редактирование тега |
126
+ | `pachca group-tags delete` | Удаление тега |
127
+ | `pachca group-tags list-users` | Список сотрудников тега |
128
+
129
+ ### messages
130
+
131
+ | Команда | Описание |
132
+ |---------|---------|
133
+ | `pachca messages create` | Новое сообщение |
134
+ | `pachca messages list` | Список сообщений чата |
135
+ | `pachca messages get` | Информация о сообщении |
136
+ | `pachca messages update` | Редактирование сообщения |
137
+ | `pachca messages delete` | Удаление сообщения |
138
+ | `pachca messages pin` | Закрепление сообщения |
139
+ | `pachca messages unpin` | Открепление сообщения |
140
+
141
+ ### link-previews
142
+
143
+ | Команда | Описание |
144
+ |---------|---------|
145
+ | `pachca link-previews add` | Unfurl (разворачивание ссылок) |
146
+
147
+ ### reactions
148
+
149
+ | Команда | Описание |
150
+ |---------|---------|
151
+ | `pachca reactions add` | Добавление реакции |
152
+ | `pachca reactions remove` | Удаление реакции |
153
+ | `pachca reactions list` | Список реакций |
154
+
155
+ ### read-member
156
+
157
+ | Команда | Описание |
158
+ |---------|---------|
159
+ | `pachca read-member list-readers` | Список прочитавших сообщение |
160
+
161
+ ### thread
162
+
163
+ | Команда | Описание |
164
+ |---------|---------|
165
+ | `pachca thread add` | Новый тред |
166
+ | `pachca thread get` | Информация о треде |
167
+
168
+ ### profile
169
+
170
+ | Команда | Описание |
171
+ |---------|---------|
172
+ | `pachca profile get-info` | Информация о токене |
173
+ | `pachca profile get` | Информация о профиле |
174
+ | `pachca profile get-status` | Текущий статус |
175
+ | `pachca profile update-status` | Новый статус |
176
+ | `pachca profile delete-status` | Удаление статуса |
177
+
178
+ ### search
179
+
180
+ | Команда | Описание |
181
+ |---------|---------|
182
+ | `pachca search list-chats` | Поиск чатов |
183
+ | `pachca search list-messages` | Поиск сообщений |
184
+ | `pachca search list-users` | Поиск сотрудников |
185
+
186
+ ### tasks
187
+
188
+ | Команда | Описание |
189
+ |---------|---------|
190
+ | `pachca tasks create` | Новое напоминание |
191
+ | `pachca tasks list` | Список напоминаний |
192
+ | `pachca tasks get` | Информация о напоминании |
193
+ | `pachca tasks update` | Редактирование напоминания |
194
+ | `pachca tasks delete` | Удаление напоминания |
195
+
196
+ ### users
197
+
198
+ | Команда | Описание |
199
+ |---------|---------|
200
+ | `pachca users create` | Создать сотрудника |
201
+ | `pachca users list` | Список сотрудников |
202
+ | `pachca users get` | Информация о сотруднике |
203
+ | `pachca users update` | Редактирование сотрудника |
204
+ | `pachca users delete` | Удаление сотрудника |
205
+ | `pachca users get-status` | Статус сотрудника |
206
+ | `pachca users update-status` | Новый статус сотрудника |
207
+ | `pachca users remove-status` | Удаление статуса сотрудника |
208
+
209
+ ### views
210
+
211
+ | Команда | Описание |
212
+ |---------|---------|
213
+ | `pachca views open` | Открытие представления |
214
+
215
+ <!-- AUTO:COMMANDS:END -->
216
+
217
+ <!-- AUTO:FLAGS -->
218
+ ## Глобальные флаги
219
+
220
+ | Флаг | Короткий | Описание |
221
+ |------|----------|----------|
222
+ | `--output <format>` | `-o` | Формат вывода: table, json, yaml, csv |
223
+ | `--columns <list>` | `-c` | Колонки для table-вывода |
224
+ | `--no-header` | | Скрыть заголовок таблицы |
225
+ | `--profile <name>` | `-p` | Профиль для этой команды |
226
+ | `--token <value>` | | Bearer-токен для этого вызова |
227
+ | `--quiet` | `-q` | Подавить вывод кроме ошибок |
228
+ | `--verbose` | `-v` | Показывать HTTP-детали |
229
+ | `--no-input` | | Отключить промпты |
230
+ | `--dry-run` | | Показать запрос без отправки |
231
+ | `--timeout <seconds>` | | Таймаут запроса |
232
+ | `--no-retry` | | Отключить авто-retry |
233
+
234
+ <!-- AUTO:FLAGS:END -->
235
+
236
+ ## Пагинация
237
+
238
+ ```
239
+ # Первая страница (по умолчанию)
240
+ pachca users list --limit 20
241
+
242
+ # Следующая страница вручную
243
+ pachca users list --cursor eyJpZCI6NTB9
244
+
245
+ # Загрузить все страницы автоматически
246
+ pachca users list --all
247
+ ```
248
+
249
+ ## Вывод и скрипты
250
+
251
+ ```
252
+ # JSON вместо таблицы
253
+ pachca users list -o json
254
+
255
+ # YAML
256
+ pachca users list -o yaml
257
+
258
+ # CSV (для Excel / Google Sheets)
259
+ pachca users list -o csv
260
+
261
+ # Выбрать колонки
262
+ pachca users list --columns id,email,role
263
+
264
+ # Только значения без заголовка (для скриптов)
265
+ pachca users list --columns email --no-header
266
+
267
+ # Пайп — цвет отключается автоматически
268
+ pachca users list -o json | jq '.[].name'
269
+
270
+ # Текст из файла или pipe
271
+ pachca messages create --entity-id 123 < message.txt
272
+ echo "Деплой завершён" | pachca messages create --entity-id 123
273
+
274
+ # Скачать файл (для команд с редиректом)
275
+ pachca common get-exports 123 --save ./export.zip
276
+
277
+ # Посмотреть запрос без отправки
278
+ pachca messages create --entity-id 123 --content "Привет" --dry-run
279
+
280
+ # Тихий режим — только exit code, без вывода
281
+ pachca messages create -q --entity-id 123 --content "Деплой завершён"
282
+
283
+ # CI / неинтерактивный режим
284
+ PACHCA_TOKEN=xxx pachca messages create --entity-id 123 --content "Деплой завершён" --no-input
285
+
286
+ # DELETE без подтверждения (в TTY)
287
+ pachca users delete 1234 --force
288
+ ```
289
+
290
+ ## Прямые API-запросы
291
+
292
+ Escape hatch для нестандартных запросов без сгенерированных команд:
293
+
294
+ ```
295
+ pachca api GET /messages --query chat_id=123
296
+ pachca api POST /messages -F message[chat_id]=12345 -f message[content]="Привет"
297
+ pachca api POST /messages --input payload.json
298
+ pachca api GET /profile -o yaml --dry-run
299
+ ```
300
+
301
+ ## Настройки
302
+
303
+ Установить постоянные дефолты:
304
+
305
+ ```
306
+ pachca config set defaults.output json # всегда JSON
307
+ pachca config set defaults.timeout 60 # таймаут 60s
308
+ pachca config list # все настройки
309
+ ```
310
+
311
+ ## Диагностика
312
+
313
+ ```
314
+ pachca doctor
315
+ ```
316
+
317
+ ## Доступные команды
318
+
319
+ ```
320
+ pachca commands --available
321
+ ```
322
+
323
+ ## Changelog
324
+
325
+ ```
326
+ pachca changelog
327
+ ```
328
+
329
+ ## Shell completion
330
+
331
+ ```
332
+ pachca autocomplete zsh # zsh completion
333
+ pachca autocomplete bash # bash completion
334
+ pachca autocomplete fish # fish completion
335
+ ```
336
+
337
+ ## Переменные окружения
338
+
339
+ | Переменная | Описание |
340
+ |-----------|---------|
341
+ | `PACHCA_TOKEN` | Bearer-токен (высший приоритет, удобно для CI) |
342
+ | `PACHCA_PROFILE` | Активный профиль для команды |
343
+ | `PACHCA_TIMEOUT` | Таймаут запроса в секундах (по умолчанию 30) |
344
+ | `PACHCA_PROMPT_DISABLED` | Отключить интерактивные промпты |
345
+ | `CI` | Стандартная переменная CI-окружений |
346
+ | `NO_COLOR` | Отключить цвет в выводе |
347
+ | `FORCE_COLOR` | Принудительно включить цвет |
348
+ | `PACHCA_SKIP_NEW_VERSION_CHECK` | Отключить проверку обновлений |
349
+
350
+ ## Документация API
351
+
352
+ Полная документация: https://dev.pachca.com
@@ -0,0 +1,190 @@
1
+ # @pachca/cli
2
+
3
+ Официальный CLI для [Пачки](https://pachca.com).
4
+
5
+ ## Установка
6
+
7
+ ```
8
+ npm install -g @pachca/cli
9
+
10
+ # Или без установки:
11
+ npx @pachca/cli users list
12
+ ```
13
+
14
+ ## Быстрый старт
15
+
16
+ ```
17
+ pachca auth login # сохранить токен
18
+ pachca users list # список сотрудников
19
+ pachca messages create --entity-id 123 --content "Привет!"
20
+ ```
21
+
22
+ Получить токен: https://dev.pachca.com/guides/authorization
23
+
24
+ ## Использование в агентах (Claude, Cursor и др.)
25
+
26
+ Если агент устанавливает CLI по просьбе пользователя и токена ещё нет — агент должен запросить его у пользователя:
27
+
28
+ ```
29
+ # Агент спрашивает: "Нужен API-токен Пачки."
30
+ # "Получите его на https://dev.pachca.com/guides/authorization"
31
+ pachca auth login --token <токен от пользователя>
32
+
33
+ # Дальше команды работают без токена в каждой строке
34
+ pachca users list
35
+ pachca messages create --entity-id 123 --content "Привет!"
36
+ ```
37
+
38
+ Если токен уже есть в окружении — `auth login` не нужен:
39
+
40
+ ```
41
+ PACHCA_TOKEN=$TOKEN pachca users list
42
+ ```
43
+
44
+ ## Профили (несколько токенов)
45
+
46
+ Храните несколько токенов под именами — личный, боты:
47
+
48
+ ```
49
+ pachca auth login --profile personal
50
+ pachca auth login --profile bot-notify
51
+ pachca auth list
52
+ pachca auth switch bot-notify
53
+ ```
54
+
55
+ Токены хранятся в `~/.config/pachca/config.toml` (chmod 600).
56
+ В CI — через переменную окружения PACHCA_TOKEN.
57
+
58
+ ## Поиск по сценариям
59
+
60
+ Не знаете какую команду использовать? Поищите по задаче:
61
+
62
+ ```
63
+ pachca guide "отправить файл"
64
+ pachca guide "создать беседу и добавить участников"
65
+ pachca guide # список всех сценариев
66
+ ```
67
+
68
+ <!-- AUTO:COMMANDS -->
69
+ <!-- AUTO:COMMANDS:END -->
70
+
71
+ <!-- AUTO:FLAGS -->
72
+ <!-- AUTO:FLAGS:END -->
73
+
74
+ ## Пагинация
75
+
76
+ ```
77
+ # Первая страница (по умолчанию)
78
+ pachca users list --limit 20
79
+
80
+ # Следующая страница вручную
81
+ pachca users list --cursor eyJpZCI6NTB9
82
+
83
+ # Загрузить все страницы автоматически
84
+ pachca users list --all
85
+ ```
86
+
87
+ ## Вывод и скрипты
88
+
89
+ ```
90
+ # JSON вместо таблицы
91
+ pachca users list -o json
92
+
93
+ # YAML
94
+ pachca users list -o yaml
95
+
96
+ # CSV (для Excel / Google Sheets)
97
+ pachca users list -o csv
98
+
99
+ # Выбрать колонки
100
+ pachca users list --columns id,email,role
101
+
102
+ # Только значения без заголовка (для скриптов)
103
+ pachca users list --columns email --no-header
104
+
105
+ # Пайп — цвет отключается автоматически
106
+ pachca users list -o json | jq '.[].name'
107
+
108
+ # Текст из файла или pipe
109
+ pachca messages create --entity-id 123 < message.txt
110
+ echo "Деплой завершён" | pachca messages create --entity-id 123
111
+
112
+ # Скачать файл (для команд с редиректом)
113
+ pachca common get-exports 123 --save ./export.zip
114
+
115
+ # Посмотреть запрос без отправки
116
+ pachca messages create --entity-id 123 --content "Привет" --dry-run
117
+
118
+ # Тихий режим — только exit code, без вывода
119
+ pachca messages create -q --entity-id 123 --content "Деплой завершён"
120
+
121
+ # CI / неинтерактивный режим
122
+ PACHCA_TOKEN=xxx pachca messages create --entity-id 123 --content "Деплой завершён" --no-input
123
+
124
+ # DELETE без подтверждения (в TTY)
125
+ pachca users delete 1234 --force
126
+ ```
127
+
128
+ ## Прямые API-запросы
129
+
130
+ Escape hatch для нестандартных запросов без сгенерированных команд:
131
+
132
+ ```
133
+ pachca api GET /messages --query chat_id=123
134
+ pachca api POST /messages -F message[chat_id]=12345 -f message[content]="Привет"
135
+ pachca api POST /messages --input payload.json
136
+ pachca api GET /profile -o yaml --dry-run
137
+ ```
138
+
139
+ ## Настройки
140
+
141
+ Установить постоянные дефолты:
142
+
143
+ ```
144
+ pachca config set defaults.output json # всегда JSON
145
+ pachca config set defaults.timeout 60 # таймаут 60s
146
+ pachca config list # все настройки
147
+ ```
148
+
149
+ ## Диагностика
150
+
151
+ ```
152
+ pachca doctor
153
+ ```
154
+
155
+ ## Доступные команды
156
+
157
+ ```
158
+ pachca commands --available
159
+ ```
160
+
161
+ ## Changelog
162
+
163
+ ```
164
+ pachca changelog
165
+ ```
166
+
167
+ ## Shell completion
168
+
169
+ ```
170
+ pachca autocomplete zsh # zsh completion
171
+ pachca autocomplete bash # bash completion
172
+ pachca autocomplete fish # fish completion
173
+ ```
174
+
175
+ ## Переменные окружения
176
+
177
+ | Переменная | Описание |
178
+ |-----------|---------|
179
+ | `PACHCA_TOKEN` | Bearer-токен (высший приоритет, удобно для CI) |
180
+ | `PACHCA_PROFILE` | Активный профиль для команды |
181
+ | `PACHCA_TIMEOUT` | Таймаут запроса в секундах (по умолчанию 30) |
182
+ | `PACHCA_PROMPT_DISABLED` | Отключить интерактивные промпты |
183
+ | `CI` | Стандартная переменная CI-окружений |
184
+ | `NO_COLOR` | Отключить цвет в выводе |
185
+ | `FORCE_COLOR` | Принудительно включить цвет |
186
+ | `PACHCA_SKIP_NEW_VERSION_CHECK` | Отключить проверку обновлений |
187
+
188
+ ## Документация API
189
+
190
+ Полная документация: https://dev.pachca.com
package/bin/dev.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env tsx
2
+
3
+ import { execute } from '@oclif/core';
4
+
5
+ await execute({ development: true, dir: import.meta.url });
package/bin/run.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execute } from '@oclif/core';
4
+
5
+ await execute({ dir: import.meta.url });
@@ -0,0 +1,74 @@
1
+ import { Command, type Interfaces } from '@oclif/core';
2
+ import { resolveToken } from './profiles.js';
3
+ import { type RequestOptions, type ClientFlags } from './client.js';
4
+ import { type OutputFormat, type OutputOptions } from './output.js';
5
+ export type BaseFlags = Interfaces.InferredFlags<typeof BaseCommand.baseFlags>;
6
+ export declare abstract class BaseCommand extends Command {
7
+ static baseFlags: {
8
+ output: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
9
+ columns: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
10
+ 'no-header': Interfaces.BooleanFlag<boolean>;
11
+ 'no-truncate': Interfaces.BooleanFlag<boolean>;
12
+ profile: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
13
+ token: Interfaces.OptionFlag<string | undefined, Interfaces.CustomOptions>;
14
+ quiet: Interfaces.BooleanFlag<boolean>;
15
+ 'no-color': Interfaces.BooleanFlag<boolean>;
16
+ verbose: Interfaces.BooleanFlag<boolean>;
17
+ 'no-input': Interfaces.BooleanFlag<boolean>;
18
+ 'dry-run': Interfaces.BooleanFlag<boolean>;
19
+ timeout: Interfaces.OptionFlag<number | undefined, Interfaces.CustomOptions>;
20
+ 'no-retry': Interfaces.BooleanFlag<boolean>;
21
+ json: Interfaces.BooleanFlag<boolean>;
22
+ };
23
+ private _parsedFlags;
24
+ protected get parsedFlags(): BaseFlags;
25
+ protected set parsedFlags(flags: BaseFlags);
26
+ /**
27
+ * Get the resolved output format, respecting flag > config > TTY default.
28
+ */
29
+ protected getOutputFormat(): OutputFormat;
30
+ /**
31
+ * Get output options from parsed flags.
32
+ */
33
+ protected getOutputOptions(): OutputOptions;
34
+ /**
35
+ * Get client flags for the HTTP client.
36
+ */
37
+ protected getClientFlags(): ClientFlags;
38
+ /**
39
+ * Whether the CLI is in interactive mode for this command.
40
+ */
41
+ protected isInteractive(): boolean;
42
+ /**
43
+ * Resolve the auth token.
44
+ */
45
+ protected resolveAuth(): ReturnType<typeof resolveToken>;
46
+ /**
47
+ * Check if the current profile has the required scope.
48
+ * Exits with error if scope is missing.
49
+ */
50
+ protected checkScope(requiredScope: string): void;
51
+ /**
52
+ * Make an authenticated API request.
53
+ */
54
+ protected apiRequest(opts: Omit<RequestOptions, 'token'>): Promise<{
55
+ data: unknown;
56
+ status: number;
57
+ headers: Headers;
58
+ }>;
59
+ /**
60
+ * Output data in the configured format.
61
+ */
62
+ protected output(data: unknown): void;
63
+ /**
64
+ * Output a success message to stderr.
65
+ */
66
+ protected success(message: string): void;
67
+ /**
68
+ * Handle errors with structured output.
69
+ */
70
+ protected catch(err: Error & {
71
+ exitCode?: number;
72
+ }): Promise<void>;
73
+ }
74
+ //# sourceMappingURL=base-command.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base-command.d.ts","sourceRoot":"","sources":["../src/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAS,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9D,OAAO,EACL,YAAY,EAMb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAgD,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAClH,OAAO,EAA0C,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAG5G,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,aAAa,CAAC,OAAO,WAAW,CAAC,SAAS,CAAC,CAAC;AAE/E,8BAAsB,WAAY,SAAQ,OAAO;IAC/C,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;MA2Dd;IAEF,OAAO,CAAC,YAAY,CAAa;IACjC,SAAS,KAAK,WAAW,IAAI,SAAS,CAA8B;IACpE,SAAS,KAAK,WAAW,CAAC,KAAK,EAAE,SAAS,EAKzC;IAED;;OAEG;IACH,SAAS,CAAC,eAAe,IAAI,YAAY;IAQzC;;OAEG;IACH,SAAS,CAAC,gBAAgB,IAAI,aAAa;IAU3C;;OAEG;IACH,SAAS,CAAC,cAAc,IAAI,WAAW;IAYvC;;OAEG;IACH,SAAS,CAAC,aAAa,IAAI,OAAO;IAKlC;;OAEG;IACH,SAAS,CAAC,WAAW,IAAI,UAAU,CAAC,OAAO,YAAY,CAAC;IAOxD;;;OAGG;IACH,SAAS,CAAC,UAAU,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IA+BjD;;OAEG;cACa,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAmB7H;;OAEG;IACH,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,IAAI;IAUrC;;OAEG;IACH,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIxC;;OAEG;cACsB,KAAK,CAAC,GAAG,EAAE,KAAK,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;CA6ClF"}