@travisennis/acai 0.0.8 → 0.0.10

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 (386) hide show
  1. package/README.md +48 -729
  2. package/bin/acai +52 -0
  3. package/dist/agent/index.d.ts +12 -2
  4. package/dist/agent/index.d.ts.map +1 -1
  5. package/dist/agent/index.js +378 -168
  6. package/dist/agent/sub-agent.d.ts +23 -0
  7. package/dist/agent/sub-agent.d.ts.map +1 -0
  8. package/dist/agent/sub-agent.js +109 -0
  9. package/dist/cli/index.d.ts +26 -0
  10. package/dist/cli/index.d.ts.map +1 -0
  11. package/dist/{cli.js → cli/index.js} +84 -76
  12. package/dist/cli/stdin.d.ts +9 -0
  13. package/dist/cli/stdin.d.ts.map +1 -0
  14. package/dist/cli/stdin.js +37 -0
  15. package/dist/commands/copy/index.js +2 -2
  16. package/dist/commands/copy/utils.d.ts.map +1 -1
  17. package/dist/commands/copy/utils.js +15 -13
  18. package/dist/commands/generate-rules/index.d.ts +1 -1
  19. package/dist/commands/generate-rules/index.d.ts.map +1 -1
  20. package/dist/commands/generate-rules/index.js +16 -100
  21. package/dist/commands/generate-rules/service.d.ts +21 -0
  22. package/dist/commands/generate-rules/service.d.ts.map +1 -0
  23. package/dist/commands/generate-rules/service.js +103 -0
  24. package/dist/commands/handoff/index.js +2 -2
  25. package/dist/commands/health/index.js +1 -1
  26. package/dist/commands/health/utils.d.ts.map +1 -1
  27. package/dist/commands/health/utils.js +6 -0
  28. package/dist/commands/history/index.d.ts +1 -1
  29. package/dist/commands/history/index.d.ts.map +1 -1
  30. package/dist/commands/history/index.js +17 -18
  31. package/dist/commands/history/types.d.ts +38 -0
  32. package/dist/commands/history/types.d.ts.map +1 -1
  33. package/dist/commands/history/utils.d.ts.map +1 -1
  34. package/dist/commands/history/utils.js +63 -58
  35. package/dist/commands/init/index.d.ts.map +1 -1
  36. package/dist/commands/init/index.js +3 -8
  37. package/dist/commands/init-project/index.d.ts.map +1 -1
  38. package/dist/commands/init-project/index.js +3 -3
  39. package/dist/commands/init-project/utils.d.ts.map +1 -1
  40. package/dist/commands/init-project/utils.js +10 -2
  41. package/dist/commands/list-tools/index.d.ts.map +1 -1
  42. package/dist/commands/list-tools/index.js +7 -31
  43. package/dist/commands/manager.d.ts +2 -2
  44. package/dist/commands/manager.d.ts.map +1 -1
  45. package/dist/commands/manager.js +57 -33
  46. package/dist/commands/model/index.d.ts.map +1 -1
  47. package/dist/commands/model/index.js +20 -151
  48. package/dist/commands/model/model-panel.d.ts +4 -0
  49. package/dist/commands/model/model-panel.d.ts.map +1 -0
  50. package/dist/commands/model/model-panel.js +144 -0
  51. package/dist/commands/paste/index.d.ts.map +1 -1
  52. package/dist/commands/paste/index.js +59 -62
  53. package/dist/commands/paste/utils.d.ts.map +1 -1
  54. package/dist/commands/paste/utils.js +88 -58
  55. package/dist/commands/pickup/index.d.ts.map +1 -1
  56. package/dist/commands/pickup/index.js +6 -3
  57. package/dist/commands/pickup/utils.js +3 -3
  58. package/dist/commands/resources/index.d.ts.map +1 -1
  59. package/dist/commands/resources/index.js +33 -50
  60. package/dist/commands/review/index.d.ts.map +1 -1
  61. package/dist/commands/review/index.js +3 -117
  62. package/dist/commands/review/review-panel.d.ts +3 -0
  63. package/dist/commands/review/review-panel.d.ts.map +1 -0
  64. package/dist/commands/review/review-panel.js +186 -0
  65. package/dist/commands/review/utils.d.ts +9 -0
  66. package/dist/commands/review/utils.d.ts.map +1 -1
  67. package/dist/commands/review/utils.js +127 -68
  68. package/dist/commands/session/index.d.ts +1 -1
  69. package/dist/commands/session/index.d.ts.map +1 -1
  70. package/dist/commands/session/index.js +134 -112
  71. package/dist/commands/session/types.d.ts +7 -0
  72. package/dist/commands/session/types.d.ts.map +1 -1
  73. package/dist/commands/share/html-renderer.d.ts +25 -0
  74. package/dist/commands/share/html-renderer.d.ts.map +1 -0
  75. package/dist/commands/share/html-renderer.js +384 -0
  76. package/dist/commands/share/index.d.ts +3 -0
  77. package/dist/commands/share/index.d.ts.map +1 -0
  78. package/dist/commands/share/index.js +122 -0
  79. package/dist/commands/shell/index.d.ts.map +1 -1
  80. package/dist/commands/shell/index.js +16 -1
  81. package/dist/commands/types.d.ts +2 -2
  82. package/dist/commands/types.d.ts.map +1 -1
  83. package/dist/{config.d.ts → config/index.d.ts} +20 -9
  84. package/dist/config/index.d.ts.map +1 -0
  85. package/dist/{config.js → config/index.js} +43 -42
  86. package/dist/execution/index.d.ts.map +1 -1
  87. package/dist/execution/index.js +75 -55
  88. package/dist/index.d.ts +1 -0
  89. package/dist/index.d.ts.map +1 -1
  90. package/dist/index.js +170 -127
  91. package/dist/middleware/cache.d.ts.map +1 -1
  92. package/dist/middleware/cache.js +18 -36
  93. package/dist/models/ai-config.d.ts +1 -0
  94. package/dist/models/ai-config.d.ts.map +1 -1
  95. package/dist/models/ai-config.js +4 -3
  96. package/dist/models/anthropic-provider.d.ts +2 -5
  97. package/dist/models/anthropic-provider.d.ts.map +1 -1
  98. package/dist/models/anthropic-provider.js +3 -70
  99. package/dist/models/deepseek-provider.d.ts +1 -0
  100. package/dist/models/deepseek-provider.d.ts.map +1 -1
  101. package/dist/models/google-provider.d.ts +2 -3
  102. package/dist/models/google-provider.d.ts.map +1 -1
  103. package/dist/models/google-provider.js +0 -26
  104. package/dist/models/groq-provider.d.ts +1 -0
  105. package/dist/models/groq-provider.d.ts.map +1 -1
  106. package/dist/models/manager.d.ts +13 -2
  107. package/dist/models/manager.d.ts.map +1 -1
  108. package/dist/models/manager.js +20 -8
  109. package/dist/models/openai-provider.d.ts +5 -5
  110. package/dist/models/openai-provider.d.ts.map +1 -1
  111. package/dist/models/openai-provider.js +27 -40
  112. package/dist/models/opencode-zen-provider.d.ts +8 -3
  113. package/dist/models/opencode-zen-provider.d.ts.map +1 -1
  114. package/dist/models/opencode-zen-provider.js +68 -11
  115. package/dist/models/openrouter-provider.d.ts +24 -30
  116. package/dist/models/openrouter-provider.d.ts.map +1 -1
  117. package/dist/models/openrouter-provider.js +92 -177
  118. package/dist/models/providers.d.ts +1 -1
  119. package/dist/models/providers.d.ts.map +1 -1
  120. package/dist/models/xai-provider.d.ts +4 -3
  121. package/dist/models/xai-provider.d.ts.map +1 -1
  122. package/dist/models/xai-provider.js +18 -18
  123. package/dist/modes/manager.d.ts +23 -0
  124. package/dist/modes/manager.d.ts.map +1 -0
  125. package/dist/modes/manager.js +77 -0
  126. package/dist/modes/prompts.d.ts +2 -0
  127. package/dist/modes/prompts.d.ts.map +1 -0
  128. package/dist/modes/prompts.js +143 -0
  129. package/dist/prompts/mentions.d.ts +11 -0
  130. package/dist/prompts/mentions.d.ts.map +1 -0
  131. package/dist/{mentions.js → prompts/mentions.js} +21 -80
  132. package/dist/prompts/system-prompt.d.ts +26 -0
  133. package/dist/prompts/system-prompt.d.ts.map +1 -0
  134. package/dist/{prompts.js → prompts/system-prompt.js} +50 -22
  135. package/dist/repl/index.d.ts +174 -0
  136. package/dist/repl/index.d.ts.map +1 -0
  137. package/dist/{repl-new.js → repl/index.js} +399 -76
  138. package/dist/repl/project-status.d.ts +1 -0
  139. package/dist/repl/project-status.d.ts.map +1 -1
  140. package/dist/repl/project-status.js +4 -1
  141. package/dist/sessions/manager.d.ts +93 -1
  142. package/dist/sessions/manager.d.ts.map +1 -1
  143. package/dist/sessions/manager.js +264 -9
  144. package/dist/sessions/summary.d.ts +4 -0
  145. package/dist/sessions/summary.d.ts.map +1 -0
  146. package/dist/sessions/summary.js +30 -0
  147. package/dist/{skills.d.ts → skills/index.d.ts} +14 -2
  148. package/dist/skills/index.d.ts.map +1 -0
  149. package/dist/skills/index.js +294 -0
  150. package/dist/subagents/index.d.ts +15 -0
  151. package/dist/subagents/index.d.ts.map +1 -0
  152. package/dist/subagents/index.js +231 -0
  153. package/dist/terminal/control.d.ts +1 -1
  154. package/dist/terminal/control.d.ts.map +1 -1
  155. package/dist/terminal/control.js +30 -9
  156. package/dist/terminal/east-asian-width.d.ts.map +1 -1
  157. package/dist/terminal/east-asian-width.js +404 -351
  158. package/dist/terminal/keys.d.ts +17 -0
  159. package/dist/terminal/keys.d.ts.map +1 -1
  160. package/dist/terminal/keys.js +37 -0
  161. package/dist/terminal/select-prompt.d.ts.map +1 -1
  162. package/dist/terminal/select-prompt.js +24 -12
  163. package/dist/terminal/string-width.d.ts.map +1 -1
  164. package/dist/terminal/string-width.js +25 -27
  165. package/dist/terminal/style.d.ts.map +1 -1
  166. package/dist/terminal/style.js +4 -7
  167. package/dist/terminal/supports-color.d.ts.map +1 -1
  168. package/dist/terminal/supports-color.js +41 -27
  169. package/dist/terminal/table/cell.d.ts +12 -0
  170. package/dist/terminal/table/cell.d.ts.map +1 -1
  171. package/dist/terminal/table/cell.js +40 -25
  172. package/dist/terminal/table/layout-manager.d.ts.map +1 -1
  173. package/dist/terminal/table/layout-manager.js +100 -68
  174. package/dist/terminal/table/utils.d.ts.map +1 -1
  175. package/dist/terminal/table/utils.js +17 -10
  176. package/dist/terminal/wrap-ansi.d.ts.map +1 -1
  177. package/dist/terminal/wrap-ansi.js +172 -103
  178. package/dist/tokens/tracker.d.ts +1 -0
  179. package/dist/tokens/tracker.d.ts.map +1 -1
  180. package/dist/tokens/tracker.js +3 -0
  181. package/dist/tools/agent.d.ts +27 -0
  182. package/dist/tools/agent.d.ts.map +1 -0
  183. package/dist/tools/agent.js +81 -0
  184. package/dist/tools/bash.d.ts +4 -3
  185. package/dist/tools/bash.d.ts.map +1 -1
  186. package/dist/tools/bash.js +343 -121
  187. package/dist/tools/code-search.d.ts +41 -0
  188. package/dist/tools/code-search.d.ts.map +1 -0
  189. package/dist/tools/code-search.js +195 -0
  190. package/dist/tools/directory-tree.d.ts +3 -3
  191. package/dist/tools/directory-tree.d.ts.map +1 -1
  192. package/dist/tools/directory-tree.js +8 -5
  193. package/dist/tools/dynamic-tool-loader.d.ts +2 -5
  194. package/dist/tools/dynamic-tool-loader.d.ts.map +1 -1
  195. package/dist/tools/dynamic-tool-loader.js +20 -4
  196. package/dist/tools/edit-file.d.ts +7 -7
  197. package/dist/tools/edit-file.d.ts.map +1 -1
  198. package/dist/tools/edit-file.js +164 -66
  199. package/dist/tools/glob.d.ts +6 -6
  200. package/dist/tools/glob.d.ts.map +1 -1
  201. package/dist/tools/glob.js +95 -55
  202. package/dist/tools/grep.d.ts +15 -12
  203. package/dist/tools/grep.d.ts.map +1 -1
  204. package/dist/tools/grep.js +300 -192
  205. package/dist/tools/index.d.ts +143 -5
  206. package/dist/tools/index.d.ts.map +1 -1
  207. package/dist/tools/index.js +39 -24
  208. package/dist/tools/ls.d.ts +2 -2
  209. package/dist/tools/ls.d.ts.map +1 -1
  210. package/dist/tools/ls.js +7 -5
  211. package/dist/tools/read-file.d.ts +3 -3
  212. package/dist/tools/read-file.d.ts.map +1 -1
  213. package/dist/tools/read-file.js +74 -34
  214. package/dist/tools/save-file.d.ts +3 -3
  215. package/dist/tools/save-file.d.ts.map +1 -1
  216. package/dist/tools/save-file.js +11 -11
  217. package/dist/tools/skill.d.ts +23 -0
  218. package/dist/tools/skill.d.ts.map +1 -0
  219. package/dist/tools/skill.js +65 -0
  220. package/dist/tools/think.d.ts.map +1 -1
  221. package/dist/tools/think.js +2 -9
  222. package/dist/tools/utils.d.ts +2 -0
  223. package/dist/tools/utils.d.ts.map +1 -1
  224. package/dist/tools/utils.js +12 -0
  225. package/dist/tools/web-fetch.d.ts +62 -0
  226. package/dist/tools/web-fetch.d.ts.map +1 -0
  227. package/dist/tools/web-fetch.js +429 -0
  228. package/dist/tools/web-search.d.ts +62 -0
  229. package/dist/tools/web-search.d.ts.map +1 -0
  230. package/dist/tools/web-search.js +226 -0
  231. package/dist/tui/autocomplete/attachment-provider.d.ts +3 -6
  232. package/dist/tui/autocomplete/attachment-provider.d.ts.map +1 -1
  233. package/dist/tui/autocomplete/attachment-provider.js +25 -78
  234. package/dist/tui/autocomplete/base-provider.d.ts +1 -0
  235. package/dist/tui/autocomplete/base-provider.d.ts.map +1 -1
  236. package/dist/tui/autocomplete/combined-provider.d.ts +1 -4
  237. package/dist/tui/autocomplete/combined-provider.d.ts.map +1 -1
  238. package/dist/tui/autocomplete/combined-provider.js +3 -17
  239. package/dist/tui/autocomplete/command-provider.d.ts +1 -0
  240. package/dist/tui/autocomplete/command-provider.d.ts.map +1 -1
  241. package/dist/tui/autocomplete/command-provider.js +3 -0
  242. package/dist/tui/autocomplete/file-search-provider.d.ts +2 -1
  243. package/dist/tui/autocomplete/file-search-provider.d.ts.map +1 -1
  244. package/dist/tui/autocomplete/file-search-provider.js +36 -16
  245. package/dist/tui/autocomplete/skill-provider.d.ts +17 -0
  246. package/dist/tui/autocomplete/skill-provider.d.ts.map +1 -0
  247. package/dist/tui/autocomplete/skill-provider.js +49 -0
  248. package/dist/tui/autocomplete.d.ts +2 -2
  249. package/dist/tui/autocomplete.d.ts.map +1 -1
  250. package/dist/tui/autocomplete.js +3 -5
  251. package/dist/tui/components/assistant-message.d.ts.map +1 -1
  252. package/dist/tui/components/assistant-message.js +0 -4
  253. package/dist/tui/components/editor.d.ts +21 -2
  254. package/dist/tui/components/editor.d.ts.map +1 -1
  255. package/dist/tui/components/editor.js +228 -236
  256. package/dist/tui/components/footer.d.ts +6 -4
  257. package/dist/tui/components/footer.d.ts.map +1 -1
  258. package/dist/tui/components/footer.js +49 -25
  259. package/dist/tui/components/markdown.d.ts +8 -5
  260. package/dist/tui/components/markdown.d.ts.map +1 -1
  261. package/dist/tui/components/markdown.js +57 -39
  262. package/dist/tui/components/modal.d.ts.map +1 -1
  263. package/dist/tui/components/modal.js +35 -33
  264. package/dist/tui/components/notification.d.ts +13 -2
  265. package/dist/tui/components/notification.d.ts.map +1 -1
  266. package/dist/tui/components/notification.js +37 -2
  267. package/dist/tui/components/progress-bar.js +1 -1
  268. package/dist/tui/components/select-list.d.ts +1 -0
  269. package/dist/tui/components/select-list.d.ts.map +1 -1
  270. package/dist/tui/components/select-list.js +14 -11
  271. package/dist/tui/components/text.d.ts +16 -0
  272. package/dist/tui/components/text.d.ts.map +1 -1
  273. package/dist/tui/components/text.js +72 -57
  274. package/dist/tui/components/thinking-block.d.ts +9 -0
  275. package/dist/tui/components/thinking-block.d.ts.map +1 -1
  276. package/dist/tui/components/thinking-block.js +43 -11
  277. package/dist/tui/components/tool-execution.d.ts +5 -1
  278. package/dist/tui/components/tool-execution.d.ts.map +1 -1
  279. package/dist/tui/components/tool-execution.js +19 -10
  280. package/dist/tui/components/user-message.d.ts.map +1 -1
  281. package/dist/tui/components/user-message.js +0 -3
  282. package/dist/tui/components/welcome.js +2 -2
  283. package/dist/tui/editor-launcher.d.ts +13 -0
  284. package/dist/tui/editor-launcher.d.ts.map +1 -0
  285. package/dist/tui/editor-launcher.js +39 -0
  286. package/dist/tui/index.d.ts +3 -1
  287. package/dist/tui/index.d.ts.map +1 -1
  288. package/dist/tui/index.js +1 -0
  289. package/dist/tui/terminal.d.ts +27 -0
  290. package/dist/tui/terminal.d.ts.map +1 -1
  291. package/dist/tui/terminal.js +144 -15
  292. package/dist/tui/tui.d.ts +43 -0
  293. package/dist/tui/tui.d.ts.map +1 -1
  294. package/dist/tui/tui.js +172 -41
  295. package/dist/utils/bash/parse.d.ts +19 -0
  296. package/dist/utils/bash/parse.d.ts.map +1 -0
  297. package/dist/utils/bash/parse.js +223 -0
  298. package/dist/utils/bash/quote.d.ts +6 -0
  299. package/dist/utils/bash/quote.d.ts.map +1 -0
  300. package/dist/utils/bash/quote.js +23 -0
  301. package/dist/utils/bash.d.ts.map +1 -1
  302. package/dist/utils/bash.js +211 -126
  303. package/dist/utils/command-protection.d.ts +28 -0
  304. package/dist/utils/command-protection.d.ts.map +1 -0
  305. package/dist/utils/command-protection.js +324 -0
  306. package/dist/utils/dedent.d.ts.map +1 -0
  307. package/dist/utils/env-expand.d.ts +2 -0
  308. package/dist/utils/env-expand.d.ts.map +1 -0
  309. package/dist/utils/env-expand.js +8 -0
  310. package/dist/utils/filesystem/path-display.d.ts +11 -0
  311. package/dist/utils/filesystem/path-display.d.ts.map +1 -0
  312. package/dist/utils/filesystem/path-display.js +32 -0
  313. package/dist/utils/filesystem/security.d.ts +2 -2
  314. package/dist/utils/filesystem/security.d.ts.map +1 -1
  315. package/dist/utils/filesystem/security.js +32 -31
  316. package/dist/utils/formatting.d.ts.map +1 -0
  317. package/dist/{formatting.js → utils/formatting.js} +1 -1
  318. package/dist/utils/git.d.ts +4 -0
  319. package/dist/utils/git.d.ts.map +1 -1
  320. package/dist/utils/git.js +30 -0
  321. package/dist/utils/glob.d.ts +1 -1
  322. package/dist/utils/glob.d.ts.map +1 -1
  323. package/dist/utils/logger.d.ts.map +1 -0
  324. package/dist/{logger.js → utils/logger.js} +1 -1
  325. package/dist/utils/parsing.d.ts.map +1 -0
  326. package/dist/utils/process.d.ts.map +1 -1
  327. package/dist/utils/process.js +90 -37
  328. package/dist/utils/templates.d.ts +2 -0
  329. package/dist/utils/templates.d.ts.map +1 -0
  330. package/dist/utils/templates.js +24 -0
  331. package/dist/utils/version.d.ts.map +1 -0
  332. package/dist/{version.js → utils/version.js} +1 -1
  333. package/package.json +34 -25
  334. package/dist/cli.d.ts +0 -23
  335. package/dist/cli.d.ts.map +0 -1
  336. package/dist/commands/exit/index.d.ts +0 -10
  337. package/dist/commands/exit/index.d.ts.map +0 -1
  338. package/dist/commands/exit/index.js +0 -21
  339. package/dist/commands/exit/types.d.ts +0 -8
  340. package/dist/commands/exit/types.d.ts.map +0 -1
  341. package/dist/commands/exit/types.js +0 -1
  342. package/dist/commands/exit/utils.d.ts +0 -2
  343. package/dist/commands/exit/utils.d.ts.map +0 -1
  344. package/dist/commands/exit/utils.js +0 -13
  345. package/dist/commands/prompt/index.d.ts +0 -5
  346. package/dist/commands/prompt/index.d.ts.map +0 -1
  347. package/dist/commands/prompt/index.js +0 -126
  348. package/dist/commands/prompt/types.d.ts +0 -15
  349. package/dist/commands/prompt/types.d.ts.map +0 -1
  350. package/dist/commands/prompt/types.js +0 -1
  351. package/dist/commands/prompt/utils.d.ts +0 -12
  352. package/dist/commands/prompt/utils.d.ts.map +0 -1
  353. package/dist/commands/prompt/utils.js +0 -107
  354. package/dist/commands/reset/index.d.ts +0 -3
  355. package/dist/commands/reset/index.d.ts.map +0 -1
  356. package/dist/commands/reset/index.js +0 -25
  357. package/dist/commands/reset/types.d.ts +0 -1
  358. package/dist/commands/reset/types.d.ts.map +0 -1
  359. package/dist/commands/reset/types.js +0 -3
  360. package/dist/commands/save/index.d.ts +0 -3
  361. package/dist/commands/save/index.d.ts.map +0 -1
  362. package/dist/commands/save/index.js +0 -19
  363. package/dist/config.d.ts.map +0 -1
  364. package/dist/dedent.d.ts.map +0 -1
  365. package/dist/formatting.d.ts.map +0 -1
  366. package/dist/logger.d.ts.map +0 -1
  367. package/dist/mentions.d.ts +0 -14
  368. package/dist/mentions.d.ts.map +0 -1
  369. package/dist/parsing.d.ts.map +0 -1
  370. package/dist/prompts.d.ts +0 -10
  371. package/dist/prompts.d.ts.map +0 -1
  372. package/dist/repl-new.d.ts +0 -62
  373. package/dist/repl-new.d.ts.map +0 -1
  374. package/dist/skills.d.ts.map +0 -1
  375. package/dist/skills.js +0 -233
  376. package/dist/tui/autocomplete/path-provider.d.ts +0 -21
  377. package/dist/tui/autocomplete/path-provider.d.ts.map +0 -1
  378. package/dist/tui/autocomplete/path-provider.js +0 -164
  379. package/dist/version.d.ts.map +0 -1
  380. /package/dist/{dedent.d.ts → utils/dedent.d.ts} +0 -0
  381. /package/dist/{dedent.js → utils/dedent.js} +0 -0
  382. /package/dist/{formatting.d.ts → utils/formatting.d.ts} +0 -0
  383. /package/dist/{logger.d.ts → utils/logger.d.ts} +0 -0
  384. /package/dist/{parsing.d.ts → utils/parsing.d.ts} +0 -0
  385. /package/dist/{parsing.js → utils/parsing.js} +0 -0
  386. /package/dist/{version.d.ts → utils/version.d.ts} +0 -0
package/README.md CHANGED
@@ -2,205 +2,62 @@
2
2
 
3
3
  ![Project Status](https://img.shields.io/badge/Status-Active-brightgreen)
4
4
  ![License](https://img.shields.io/badge/License-MIT-blue.svg)
5
- <!-- Add more badges as appropriate, e.g., build status, version, etc. -->
6
5
 
7
- ## 🚀 Overview
6
+ ## Overview
8
7
 
9
- Acai is a powerful **AI-driven command-line interface (CLI) tool** designed to assist software developers in their daily tasks. It acts as an intelligent assistant, capable of understanding natural language prompts, interacting with your codebase, and automating various development workflows.
8
+ Acai is an AI-driven command-line tool that assists software developers with coding, debugging, refactoring, and workflow automation. It provides both a conversational REPL and a modern TUI for interacting with large language models in the context of your codebase.
10
9
 
11
- ### Core Functionality:
10
+ ### Key Capabilities
12
11
 
13
- * **Interactive AI Assistant:** Engage in a conversational REPL (Read-Eval-Print Loop) or TUI (Terminal User Interface) to get assistance with coding, debugging, refactoring, and more.
14
- * **Codebase Interaction:** Read, edit, and navigate files; search code; and understand project structure.
15
- * **Git Integration:** Generate conventional commits, review pull requests, and manage local changes.
16
- * **Extensible Tooling:** Utilizes a suite of internal tools (e.g., `bash`, `codeInterpreter`, `webSearch`) to perform actions.
17
- * **Multi-Model Support:** Seamlessly switch between various AI providers (e.g., OpenAI, Google, Anthropic, DeepSeek, Groq, OpenRouter).
18
- * **Context Management:** Automatically incorporates relevant file content, clipboard data, and conversation history into AI prompts.
19
- * **Configurable & Learnable:** Customize behavior through project-specific rules and learn from user corrections.
20
- * **Terminal User Interface:** Modern TUI with modal dialogs, autocomplete, and rich text formatting.
12
+ - **Interactive AI Assistant:** Conversational REPL and TUI with modal dialogs, autocomplete, and rich text formatting.
13
+ - **Codebase Interaction:** Read, edit, search, and navigate files with context-aware AI assistance.
14
+ - **Git Integration:** Generate conventional commits, review pull requests, and manage local changes.
15
+ - **Multi-Model Support:** Switch between OpenAI, Anthropic, Google, DeepSeek, Groq, X.AI, OpenRouter, and OpenCode Zen.
16
+ - **Piped Input:** Pipe text via stdin for REPL mode or as context with the `-p` flag.
17
+ - **Skills System:** Discover and load specialized instruction files for specific tasks.
18
+ - **Multi-workspace Support:** Work across multiple project directories simultaneously.
21
19
 
22
- ## ✨ Features
20
+ ## Prerequisites
23
21
 
24
- * **Conversational REPL/TUI:** Intuitive command-line interface and modern terminal UI for interacting with the AI.
25
- * **File System Operations:** Read, write, edit, move, and delete files.
26
- * **File & Directory Mentions:** Include file contents and entire directories in prompts using `@filename` and `@dirname` syntax.
27
- * **Code Navigation & Analysis:** Advanced file searching and code analysis capabilities.
28
- * **Git Workflow Automation:** Streamline commit messages and code reviews.
29
- * **Extensible Commands:** A rich set of built-in commands (`/help`, `/model`, `/session`, `/list-tools`, etc.).
30
- * **Token Usage Tracking:** Monitor AI token consumption with comprehensive session overview.
31
- * **Configurable AI Models:** Easily switch between different LLM providers and models.
32
- * **Shell Integration:** Execute shell commands inline using `!`command`` syntax or via `/shell` command.
33
- * **Dynamic Tools:** Create and load custom tools from JavaScript files in your project or user directory.
34
- * **Multi-workspace Support:** Work across multiple project directories simultaneously.
35
- * **Skills System:** Discover and load specialized instruction files for specific tasks (PDF extraction, database migrations, etc.).
36
-
37
-
38
- ## 🛠️ Technologies Used
39
-
40
- Acai is built primarily with **TypeScript** and runs on **Node.js**. Key technologies and dependencies include:
41
-
42
- * **TypeScript:** For type-safe and scalable code.
43
- * **Node.js:** The JavaScript runtime environment.
44
- * **AI SDK (`@ai-sdk/*`):** For integrating with various Large Language Models (LLMs) like OpenAI, Google Gemini, Anthropic, DeepSeek, Groq, and OpenRouter.
45
- * **`ripgrep` (via `grep.ts` tool):** For fast file content searching.
46
- * **`pino`:** For structured logging.
47
- * **`zod`:** For schema validation.
48
- * **`biomejs/biome`:** For code formatting and linting.
49
-
50
- ## 🚀 Getting Started
51
-
52
- ### Prerequisites
53
-
54
- **Required:**
55
- * Node.js 20 or higher
56
- * Git
57
- * [Ripgrep](https://github.com/BurntSushi/ripgrep) (`rg` command) - Fast file content searching
58
- * [GitHub CLI](https://cli.github.com/) (`gh` command) - Git operations and repository management
59
-
60
- **Installation of system dependencies:**
22
+ - Node.js 20 or higher
23
+ - Git
24
+ - [Ripgrep](https://github.com/BurntSushi/ripgrep) (`rg`) - Fast file content searching
25
+ - [GitHub CLI](https://cli.github.com/) (`gh`) - Git operations and repository management
61
26
 
62
27
  ```bash
63
- # macOS (using Homebrew)
28
+ # macOS
64
29
  brew install ripgrep gh
65
30
 
66
31
  # Ubuntu/Debian
67
32
  sudo apt install ripgrep gh
68
-
69
- # Windows (using Chocolatey)
70
- choco install ripgrep gh
71
-
72
- # Or using winget
73
- winget install BurntSushi.ripgrep GitHub.cli
74
33
  ```
75
34
 
76
- **Optional but recommended:**
77
- * API keys for AI providers (see Environment Variables section below)
78
-
79
- ### Installation for Users
35
+ ## Installation
80
36
 
81
37
  ```bash
82
38
  npm install -g @travisennis/acai
83
39
  ```
84
40
 
85
- ### Installation for Developers
41
+ ## Quick Start
86
42
 
87
43
  ```bash
88
- # Clone the repository
89
- git clone https://github.com/travisennis/acai-ts.git # Assuming this is the repo URL
90
- cd acai-ts
91
-
92
- # Install dependencies
93
- npm install
94
-
95
- # Set up environment variables (see Environment Variables section)
96
- cp .env.example .env # If .env.example exists, or create .env manually
97
- # Edit .env file with your API keys
98
-
99
- # Build the project
100
- npm run build
101
-
102
- # Link the CLI tool globally (optional, for easy access)
103
- npm link
104
- ```
105
-
106
- ## Environment Variables
107
-
108
- Acai supports various AI providers and web services through environment variables. Create a `.env` file in your project root or set these variables in your shell environment.
109
-
110
- ### AI Provider API Keys
111
-
112
- ```bash
113
- # OpenAI (GPT models)
114
- OPENAI_API_KEY=your_openai_api_key_here
115
-
116
- # Anthropic (Claude models)
117
- ANTHROPIC_API_KEY=your_anthropic_api_key_here
118
-
119
- # Google (Gemini models)
120
- GOOGLE_GENERATIVE_AI_API_KEY=your_google_api_key_here
121
-
122
- # DeepSeek
123
- DEEPSEEK_API_KEY=your_deepseek_api_key_here
124
-
125
- # Groq (Kimi models)
126
- GROQ_API_KEY=your_groq_api_key_here
127
-
128
- # X.AI (Grok models)
129
- X_AI_API_KEY=your_xai_api_key_here
130
- # Alternative name also supported:
131
- # XAI_API_KEY=your_xai_api_key_here
132
-
133
- # OpenRouter (Access to multiple models)
134
- OPENROUTER_API_KEY=your_openrouter_api_key_here
135
-
136
- # OpenCode Zen
137
- OPENCODE_ZEN_API_TOKEN=your_opencode_zen_api_token_here
138
- ```
139
-
140
- ### Application Configuration
141
-
142
- ```bash
143
- # Logging level (optional, defaults to "debug")
144
- # Options: trace, debug, info, warn, error, fatal
145
- LOG_LEVEL=info
146
- ```
147
-
148
- ### Example .env File
149
-
150
- ```bash
151
- # Core AI providers (at least one recommended)
152
- OPENAI_API_KEY=sk-...
153
- ANTHROPIC_API_KEY=sk-ant-...
154
-
155
- # Optional: Additional providers
156
- GOOGLE_GENERATIVE_AI_API_KEY=...
157
- GROQ_API_KEY=...
158
- OPENROUTER_API_KEY=sk-or-...
159
-
160
- # Optional: Application settings
161
- LOG_LEVEL=info
162
- ```
163
-
164
- **Note:** You need at least one AI provider API key to use Acai. The tool will work with any combination of the supported providers.
165
-
166
-
167
- ### Usage
168
-
169
- ```bash
170
- # Start interactive mode with default model
44
+ # Start interactive mode
171
45
  acai
172
46
 
173
47
  # Specify a model
174
48
  acai --model anthropic:sonnet
175
49
 
176
- # CLI mode (one-shot execution)
50
+ # One-shot CLI mode
177
51
  acai -p "What files contain the term 'toolCallRepair'?"
178
52
 
179
53
  # Pipe input
180
54
  echo "How many TypeScript files are in this project?" | acai
181
55
 
182
- # Disable skills discovery
183
- acai --no-skills
184
-
185
- # Add additional working directories
186
- acai --add-dir /path/to/project1 --add-dir /path/to/project2
187
-
188
- # Resume a previous session by selecting from a list
189
- acai --continue
190
-
191
- # Resume the most recent session
56
+ # Resume a previous session
192
57
  acai --resume
193
-
194
- # Resume a specific session by ID
195
- acai --resume a1b2c3d4-e5f6-7890-1234-567890abcdef
196
- ```
197
-
198
- **Note:** When exiting a session with messages, Acai will display a resume command with the session ID:
199
- ```
200
- To resume this session call acai --resume <session-id>
201
58
  ```
202
59
 
203
- Once in the REPL, you can type your prompts or use commands:
60
+ Once in the REPL, type prompts or use commands:
204
61
 
205
62
  ```
206
63
  > How do I read a file in Node.js?
@@ -208,591 +65,53 @@ Once in the REPL, you can type your prompts or use commands:
208
65
  > /help
209
66
  ```
210
67
 
211
- ### Prompt Mentions & Special Syntax
68
+ Reference files directly with `@filename`, directories with `@dirname`, or run shell commands with `` !`command` ``.
212
69
 
213
- You can reference files and directories directly in your prompts:
70
+ ## Technologies
214
71
 
215
- ```
216
- > Explain the purpose of @source/index.ts
217
- > What patterns do you see in @source/tools/ directory
218
- > Find security issues in @config/ directory
219
- > Check if `!ls -la` shows any suspicious files
220
- > Analyze @README.md for typos
221
- ```
72
+ - **TypeScript** and **Node.js**
73
+ - **AI SDK (`@ai-sdk/*`)** for LLM provider integration
74
+ - **Ripgrep** for fast file content searching
75
+ - **Pino** for structured logging
76
+ - **Zod** for schema validation
77
+ - **Biome** for formatting and linting
222
78
 
223
- **Supported syntax:**
224
- - `@filename` - Include contents of a specific file
225
- - `@dirname` - Recursively include all files in a directory
226
- - `@http://example.com` - Fetch and include web content
227
- - ``!`command` `` - Execute shell command and include output
228
-
229
- ### Prompt Arguments
230
-
231
- Pass dynamic values to commands using argument placeholders in custom prompts:
232
-
233
- #### All arguments with `$ARGUMENTS`
234
-
235
- The `$ARGUMENTS` placeholder captures all arguments passed to the command:
236
-
237
- ```bash
238
- # Command definition
239
- echo 'Fix issue #$ARGUMENTS following our coding standards' > .acai/prompts/fix-issue.md
240
-
241
- # Usage
242
- > /fix-issue 123 high-priority
243
- # $ARGUMENTS becomes: "123 high-priority"
244
- ```
245
-
246
- #### Individual arguments with `$1`, `$2`, `$3`, etc.
247
-
248
- Access specific arguments individually using positional parameters (similar to shell scripts):
249
-
250
- ```bash
251
- # Command definition
252
- echo 'Review PR #$1 with priority $2 and assign to $3' > .acai/prompts/review-pr.md
253
-
254
- # Usage
255
- > /review-pr 456 high alice
256
- # $1 becomes "456", $2 becomes "high", $3 becomes "alice"
257
- ```
258
-
259
- Use positional arguments when you need to:
260
- - Access arguments individually in different parts of your command
261
- - Provide defaults for missing arguments
262
- - Build more structured commands with specific parameter roles
263
-
264
- #### Backward compatibility with `{{INPUT}}`
265
-
266
- The legacy `{{INPUT}}` placeholder is still supported and works the same as `$ARGUMENTS`:
267
-
268
- ```bash
269
- # Command definition
270
- echo 'Analyze the following code: {{INPUT}}' > .acai/prompts/analyze.md
271
-
272
- # Usage
273
- > /analyze src/file.ts
274
- # {{INPUT}} becomes: "src/file.ts"
275
- ```
276
-
277
- **Note:** Using `-p/--prompt` runs in CLI mode (one-shot execution), while running without a prompt starts interactive REPL mode.
278
-
279
- For a list of available commands, type `/help` within the REPL.
280
-
281
- ## Interactive CLI Commands
282
-
283
- - `/help` - Shows usage information
284
- - `/reset` - Saves chat history and resets the conversation
285
- - `/save` - Saves chat history
286
- - `/exit` or `/bye` - Exits and saves chat history
287
- - `/init` - Generate or improve `AGENTS.md`
288
- - `/paste` - Add clipboard contents to the next prompt
289
- - `/prompt <name> [arguments...]` - Load saved prompts with optional arguments. Project prompts override user prompts. Supports argument placeholders (`$ARGUMENTS`, `$1`, `$2`, etc.) in prompt files.
290
- - `/model [provider:model|category|provider]` - List or switch models
291
- - `/session` - Show comprehensive session information including usage and costs
292
- - `/clear` - Clears the terminal screen for the current session
293
- - `/generateRules` - Analyze the current conversation and suggest project rules
294
- - `/copy` - Copy the last assistant response to the system clipboard
295
- - `/list-tools` or `/lt` - List all available static and dynamic tools
296
- - `/add-dir <path>` - Add additional working directory
297
- - `/list-dirs` - List all working directories
298
- - `/remove-dir <path>` - Remove a working directory
299
- - `/health` - Check system health and dependencies
300
- - `/history` - View and manage conversation history
301
- - `/pickup` - Resume a previous conversation
302
- - `/handoff` - Hand off conversation to another agent
303
- - `/shell` - Execute shell commands
304
-
305
- **Note**: Some commands mentioned in older documentation may no longer be available. Use `/help` to see current commands.
306
-
307
- Clipboard notes:
308
- - macOS: uses `pbcopy`
309
- - Windows: uses `clip`
310
- - Linux: tries `xclip`, falls back to `xsel`
311
-
312
- ## Custom Tools
313
-
314
- Acai supports dynamic custom tools that users can define as executable Node.js scripts. These tools extend the core functionality without modifying the source code.
315
-
316
- ### Directories
317
-
318
- - **Project tools**: `./.acai/tools/*.(m)js` (project-specific, override global tools with the same name).
319
- - **User tools**: `~/.acai/tools/*.(m)js` (global, available across all projects).
320
-
321
- ### Format Specification
322
-
323
- Custom tools are Node.js scripts that respond to environment variables:
324
-
325
- - **Describe mode**: Set `TOOL_ACTION=describe` to output YAML metadata to stdout.
326
-
327
- Example output:
328
-
329
- ```
330
- name: run-tests
331
- description: Run tests in a project workspace with proper output formatting
332
- parameters:
333
- - name: dir
334
- type: string
335
- description: the workspace directory to run tests in
336
- required: false
337
- default: "."
338
- ```
339
-
340
- - **Execute mode**: Set `TOOL_ACTION=execute` and read JSON parameters from stdin (array of `{name: string, value: any}`), perform the action, and output results to stdout (JSON or text). Exit with 0 on success, non-zero on error.
341
-
342
- Scripts should include `#!/usr/bin/env node` shebang for executability.
343
-
344
- ### Security Notes
345
-
346
- - Dynamic tools run in sandboxed child processes with limited permissions (no network access beyond what's allowed, timeout of 30s, isolated environment).
347
- - Scripts have access to the project directory but cannot access Acai internals.
348
- - Validate inputs and handle errors gracefully.
349
- - Malicious scripts could perform unintended actions; review tools before use.
350
- - Future enhancements may include script signing or allowlisting.
351
-
352
- ### Example Script
353
-
354
- Create `./.acai/tools/run-tests.js`:
355
-
356
- ```javascript
357
- #!/usr/bin/env node
358
-
359
- const { spawn } = require('node:child_process');
360
-
361
- if (process.env.TOOL_ACTION === 'describe') {
362
- console.log(JSON.stringify({
363
- name: 'run-tests',
364
- description: 'Run tests in the specified directory',
365
- parameters: [
366
- {
367
- name: 'dir',
368
- type: 'string',
369
- description: 'Directory to run tests in (default: current directory)',
370
- required: false,
371
- default: '.'
372
- }
373
- ]
374
- }, null, 2));
375
- process.exit(0);
376
- }
377
-
378
- if (process.env.TOOL_ACTION === 'execute') {
379
- let params = [];
380
- process.stdin.setEncoding('utf8');
381
- process.stdin.on('readable', () => {
382
- let chunk;
383
- while (null !== (chunk = process.stdin.read())) {
384
- params = JSON.parse(chunk);
385
- }
386
- });
387
-
388
- process.stdin.on('end', () => {
389
- const dir = params.find(p => p.name === 'dir')?.value || '.';
390
- const child = spawn('npm', ['test'], { cwd: dir, stdio: 'pipe' });
391
- let output = '';
392
- child.stdout.on('data', (data) => output += data);
393
- child.on('close', (code) => {
394
- console.log(output);
395
- process.exit(code);
396
- });
397
- });
398
- }
399
- ```
400
-
401
- ### Loading Tools
402
-
403
- Dynamic tools are loaded automatically on each user input.
404
-
405
- For more details, see the implementation in `source/tools/dynamic-tool-loader.ts`.
406
-
407
- ## Dynamic Tools
408
-
409
- Acai supports dynamic tools - custom tools that you can create and load from JavaScript files. This allows you to extend Acai's functionality with your own specialized tools.
410
-
411
- ### Creating Dynamic Tools
412
-
413
- Dynamic tools are JavaScript files that follow a specific structure. Here's a simple example:
414
-
415
- ```javascript
416
- #!/usr/bin/env node
417
-
418
- if (process.env.TOOL_ACTION === 'describe') {
419
- console.log(JSON.stringify({
420
- name: 'my-custom-tool',
421
- description: 'A custom tool that does something useful',
422
- parameters: [
423
- {
424
- name: 'input',
425
- type: 'string',
426
- description: 'Input to process',
427
- required: true
428
- }
429
- ]
430
- }, null, 2));
431
- process.exit(0);
432
- }
433
-
434
- if (process.env.TOOL_ACTION === 'execute') {
435
- let params = [];
436
- process.stdin.setEncoding('utf8');
437
- process.stdin.on('readable', () => {
438
- let chunk;
439
- while (null !== (chunk = process.stdin.read())) {
440
- params = JSON.parse(chunk);
441
- }
442
- });
443
-
444
- process.stdin.on('end', () => {
445
- const input = params.find(p => p.name === 'input')?.value;
446
- // Your tool logic here
447
- const result = `Processed: ${input}`;
448
- console.log(result);
449
- process.exit(0);
450
- });
451
- }
452
- ```
453
-
454
- ### Tool Structure
455
-
456
- - **Describe Phase**: When `TOOL_ACTION=describe`, the tool must output JSON metadata
457
- - `name`: Tool name (will be prefixed with `dynamic:`)
458
- - `description`: Human-readable description
459
- - `parameters`: Array of parameter definitions
460
- - **Execute Phase**: When `TOOL_ACTION=execute`, the tool reads parameters from stdin and outputs results
461
-
462
- ### Parameter Definition
463
-
464
- Each parameter can have:
465
- - `name`: Parameter name
466
- - `type`: "string", "number", or "boolean"
467
- - `description`: Human-readable description
468
- - `required`: Boolean (default: false)
469
- - `default`: Default value for optional parameters
470
-
471
- ### Tool Locations
472
-
473
- Dynamic tools are loaded from two locations:
474
- 1. **Project tools**: `.acai/tools/` in your project directory
475
- 2. **User tools**: `~/.acai/tools/` in your home directory
476
-
477
- Project tools override user tools with the same name.
478
-
479
- ### Configuration
480
-
481
- Dynamic tools are configured in your `.acai.json` file:
482
-
483
- ```json
484
- {
485
- "tools": {
486
- "dynamicTools": {
487
- "enabled": true,
488
- "maxTools": 50
489
- }
490
- }
491
- }
492
- ```
493
-
494
- - `enabled`: Enable/disable dynamic tools (default: true)
495
- - `maxTools`: Maximum number of tools to load (default: 50)
496
-
497
- ### Security Considerations
498
-
499
- Dynamic tools run with the same privileges as Acai itself. Keep these security points in mind:
500
-
501
- - **Input Validation**: Always validate and sanitize input parameters
502
- - **Path Safety**: Be careful with file paths to prevent directory traversal
503
- - **Resource Limits**: Tools are automatically killed after 30 seconds
504
- - **No Shell Access**: Tools run directly with Node.js, not through a shell
505
-
506
- ### Example Tools
507
-
508
- See the included `run-tests.js` tool in `.acai/tools/` for a complete example.
509
-
510
- ### Listing Tools
511
-
512
- Use the `/list-tools` command to see all available tools, including dynamic tools:
513
-
514
- ```
515
- > /list-tools
516
- Available tools:
517
- Static tools:
518
- bash
519
- readFile
520
- editFile
521
- ...
522
- Dynamic tools:
523
- dynamic:run-tests
524
- dynamic:my-custom-tool
525
-
526
- Total: 14 static, 2 dynamic
527
- ```
528
-
529
- ## Skills System
530
-
531
- Acai includes a powerful skills system that allows you to create and use specialized instruction files for specific tasks. Skills are markdown files with YAML frontmatter that provide detailed instructions for particular domains (e.g., database migrations, PDF extraction, code review).
532
-
533
- ### How Skills Work
534
-
535
- 1. **Discovery**: At startup, Acai scans multiple locations for skills
536
- 2. **Listing**: Available skills are listed in the system prompt
537
- 3. **On-demand loading**: When a task matches a skill's description, the agent uses the `read` tool to load the skill file
538
- 4. **Execution**: The agent follows the instructions in the skill file
539
-
540
- ### Skill File Format
541
-
542
- Skills are markdown files named `SKILL.md` with YAML frontmatter:
543
-
544
- ```markdown
545
- ---
546
- description: Extract text and tables from PDF files
547
- name: pdf-extract # Optional, defaults to directory name
548
- ---
549
-
550
- # PDF Processing Instructions
551
-
552
- 1. Use `pdftotext` to extract plain text
553
- 2. For tables, use `tabula-py` or similar
554
- 3. Always verify extraction quality
555
-
556
- Scripts are in: {baseDir}/scripts/
557
- Configuration: {baseDir}/config.json
558
- ```
559
-
560
- **Required fields:**
561
- - `description`: Short description shown in system prompt
562
-
563
- **Optional fields:**
564
- - `name`: Override the skill name (defaults to directory name or colon-separated path)
565
-
566
- **Placeholder:**
567
- - `{baseDir}`: Replaced with the skill's base directory path
568
-
569
- ### Skill Locations
570
-
571
- Skills are loaded from these locations (later sources override earlier ones):
572
-
573
- 1. `~/.codex/skills/**/SKILL.md` (Codex CLI user skills)
574
- 2. `~/.claude/skills/*/SKILL.md` (Claude Code user skills)
575
- 3. `<cwd>/.claude/skills/*/SKILL.md` (Claude Code project skills)
576
- 4. `~/.acai/skills/**/SKILL.md` (Acai user skills)
577
- 5. `<cwd>/.acai/skills/**/SKILL.md` (Acai project skills)
578
-
579
- ### Directory Structure
580
-
581
- Skills can be organized hierarchically with colon-separated names:
582
-
583
- ```
584
- ~/.acai/skills/
585
- ├── pdf-extract/
586
- │ ├── SKILL.md # Becomes "pdf-extract" skill
587
- │ └── scripts/ # Optional: supporting files
588
- ├── db/
589
- │ └── migrate/
590
- │ └── SKILL.md # Becomes "db:migrate" skill
591
- └── aws/
592
- └── s3/
593
- └── upload/
594
- └── SKILL.md # Becomes "aws:s3:upload" skill
595
- ```
596
-
597
- ### Compatibility
598
-
599
- Acai's skills system is compatible with:
600
- - **Pi Native Format**: `~/.acai/skills/**/SKILL.md` (recursive, colon-separated paths)
601
- - **Claude Code Format**: `~/.claude/skills/*/SKILL.md` (single level only)
602
- - **Codex CLI Format**: `~/.codex/skills/**/SKILL.md` (recursive, simple names)
603
-
604
- ### Configuration
605
-
606
- Skills are enabled by default. You can disable them via:
607
-
608
- 1. **CLI flag**: `acai --no-skills`
609
- 2. **Settings file**: Add to `~/.acai/acai.json` or `.acai/acai.json`:
610
- ```json
611
- {
612
- "skills": {
613
- "enabled": false
614
- }
615
- }
616
- ```
617
-
618
- ### Usage Example
619
-
620
- 1. **Agent startup**: Scans all skill locations
621
- 2. **System prompt**: Lists available skills
622
- 3. **User request**: "Extract text from this PDF"
623
- 4. **Agent matches**: Sees "pdf-extract: Extract text and tables from PDF files"
624
- 5. **Skill loading**: Uses `read` tool to load `~/.acai/skills/pdf-extract/SKILL.md`
625
- 6. **Placeholder substitution**: Replaces `{baseDir}` with skill directory path
626
- 7. **Execution**: Follows instructions in skill file
627
-
628
- ## Configuration
629
-
630
- ### Project Configuration
631
-
632
- Acai supports project-specific configuration through a `.acai/acai.json` file in your project directory:
633
-
634
- ```json
635
- {
636
- "logs": {
637
- "path": "~/.acai/logs/acai.log" // Optional: Custom log file location
638
- },
639
- "notify": true, // Optional: Enable system notifications (default: false)
640
- "tools": {
641
- "maxTokens": 30000 // Optional: Global max token limit for tools
642
- },
643
- "skills": {
644
- "enabled": true // Optional: Enable/disable skills discovery (default: true)
645
- },
646
-
647
-
648
-
649
- }
650
- ```
651
-
652
- ### Project-Specific Customization
653
-
654
- - **Rules/Guidelines**: Add project-specific AI behavior rules in `AGENTS.md`
655
- - **Custom Prompts**: Store reusable prompts in `.acai/prompts/`. Supports argument placeholders (`$ARGUMENTS`, `$1`, `$2`, etc.) for dynamic content.
656
-
657
- - **File Selections**: Save file/directory selections in `.acai/selections/`
658
- - **Memory/Rules**: Persistent project rules stored in `.acai/rules/`
659
-
660
- ### Global Configuration
661
-
662
- Global application settings are stored in:
663
- - **Configuration**: `~/.acai/`
664
- - **Logs**: `~/.acai/logs/acai.log`
665
- - **Message History**: `~/.acai/message-history/`
666
-
667
- ### Environment-Specific Setup
668
-
669
- For development, you can use different configurations:
670
-
671
- ```bash
672
- # Development with .env file
673
- npm run dev
674
-
675
- # Production
676
- acai
677
-
678
- # Custom log level
679
- LOG_LEVEL=warn acai
680
- ```
681
-
682
- ## Web Skills
683
-
684
- Acai's web functionality has been moved to standalone skills that operate independently of the core codebase. These skills provide web-related capabilities while keeping the main acai-ts project lightweight and focused.
685
-
686
- ### Skill Locations
687
-
688
- Web skills are located in:
689
- - `~/.acai/skills/web-fetch/` - User-level web fetch skill
690
- - `~/.acai/skills/web-search/` - User-level web search skill
691
- - `<project>/.acai/skills/web-fetch/` - Project-level web fetch skill
692
- - `<project>/.acai/skills/web-search/` - Project-level web search skill
693
-
694
-
695
- ## ⚙️ Development
696
-
697
- ### Development Environment Setup
698
-
699
- 1. **Clone and install dependencies:**
700
- ```bash
701
- git clone https://github.com/travisennis/acai-ts.git
702
- cd acai-ts
703
- npm install
704
- ```
705
-
706
- 2. **Set up environment variables:**
707
- ```bash
708
- # Create .env file with your API keys
709
- touch .env
710
- # Add your API keys (see Environment Variables section above)
711
- ```
712
-
713
- 3. **Development workflow:**
714
- ```bash
715
- # Run in development mode (uses .env file)
716
- npm run dev
717
-
718
- # Build and test
719
- npm run build
720
- npm test
721
-
722
- # Code quality
723
- npm run lint
724
- npm run format
725
- ```
726
-
727
- ### Available NPM Scripts
728
-
729
- Here's a list of useful `npm` scripts for development:
730
-
731
- | Script | Description |
732
- | :------------ | :----------------------------------------------------------------------- |
733
- | `npm run build` | Compiles the TypeScript source code to JavaScript. |
734
- | `npm run clean` | Removes the `dist/` directory. |
735
- | `npm run compile` | Compiles TypeScript files (`tsc --pretty`). |
736
- | `npm run lint` | Runs Biome linter to check for code style and quality issues. |
737
- | `npm run lint:fix` | Automatically fixes linting issues using Biome. |
738
- | `npm run test` | Runs unit tests with code coverage using `c8`. |
739
- | `npm run format` | Formats the codebase using Biome. |
740
- | `npm run dev` | Starts the application in development mode (loads .env file automatically). |
741
- | `npm run oxlint` | Runs Oxlint for additional code quality checks. |
742
- | `npm run knip` | Detects unused files, dependencies, and exports. |
743
- | `npm run check` | Interactively checks for and updates outdated npm packages. |
744
- | `npm run cpd` | Checks for copy-pasted code using `jscpd`. |
745
- | `npm run typecheck` | Type checks the codebase without emitting files. |
746
-
747
- ### Code Structure
748
-
749
- The project is organized as follows:
79
+ ## Project Structure
750
80
 
751
81
  ```
752
82
  .
753
- ├── .acai/ # Internal configuration and temporary files
754
83
  ├── source/ # Main application source code
755
- │ ├── agent/ # Agent loop and manual execution
756
- │ ├── api/ # External API integrations (e.g., Exa)
84
+ │ ├── agent/ # Agent loop and sub-agent execution
757
85
  │ ├── cli.ts # CLI entry point
758
- │ ├── commands/ # Implementations of REPL commands
86
+ │ ├── commands/ # REPL command implementations
759
87
  │ ├── execution/ # Command execution utilities
760
- │ ├── middleware/ # AI request/response middleware (logging, rate limiting)
88
+ │ ├── middleware/ # AI request/response middleware
761
89
  │ ├── models/ # AI model providers and management
90
+ │ ├── modes/ # Agent mode management
762
91
  │ ├── prompts/ # Prompt generation and management
763
- │ ├── repl/ # REPL interface components
92
+ │ ├── repl/ # REPL utilities
93
+ │ ├── sessions/ # Session persistence and management
764
94
  │ ├── terminal/ # Terminal output formatting and rendering
765
95
  │ ├── tui/ # Terminal User Interface components
766
96
  │ ├── tools/ # AI-callable tools (filesystem, git, web, bash, etc.)
767
97
  │ ├── tokens/ # Token counting and tracking
768
98
  │ └── utils/ # Utility functions
769
99
  ├── test/ # Unit tests
100
+ ├── docs/ # Additional documentation
770
101
  ├── ARCHITECTURE.md # Detailed architectural overview and flow diagrams
771
- ├── AGENTS.md # Project-specific AI rules and guidelines
772
- ├── TODO.md # Project roadmap and planned features
773
- ├── package.json # Project metadata, dependencies, and scripts
774
- └── README.md # This file
102
+ ├── CONTRIBUTING.md # Development setup and guidelines
103
+ └── AGENTS.md # Project-specific AI rules and guidelines
775
104
  ```
776
105
 
777
- For a more in-depth understanding of the project's architecture and internal flows, please refer to the [ARCHITECTURE.md](ARCHITECTURE.md) document.
106
+ ## Documentation
778
107
 
779
- ## 📚 Documentation & Examples
108
+ - [Usage Guide](docs/usage.md) - Commands, keyboard shortcuts, piped input, and prompt syntax
109
+ - [Configuration](docs/configuration.md) - Environment variables, project and global settings
110
+ - [Skills System](docs/skills.md) - Creating and using specialized instruction files
111
+ - [Dynamic Tools](docs/dynamic-tools.md) - Creating custom tools to extend acai
112
+ - [Architecture](ARCHITECTURE.md) - Internal architecture and flow diagrams
113
+ - [Contributing](CONTRIBUTING.md) - Development setup, scripts, and code style
780
114
 
781
- * **[ARCHITECTURE.md](ARCHITECTURE.md):** Provides a comprehensive overview of the project's architecture, including file descriptions and Mermaid flow diagrams.
782
- * **[AGENTS.md](AGENTS.md):** Contains specific rules and guidelines for the AI agent's behavior within this project.
783
- * **In-app `/help` command:** Use `/help` within the Acai REPL for a list of available commands and their usage.
784
- * **`source/commands/` directory:** Review the TypeScript files in this directory to understand how each REPL command is implemented.
785
- * **`source/tools/` directory:** Explore the available tools that the AI can leverage.
786
-
787
- ## 🤝 Contributing
788
-
789
- We welcome contributions! Please see our [CONTRIBUTING.md](CONTRIBUTING.md) (if it exists, otherwise remove this line) for guidelines on how to contribute.
790
-
791
- ## 📄 License
115
+ ## License
792
116
 
793
117
  This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
794
-
795
- ## 📞 Contact
796
-
797
- For questions or feedback, please open an issue on the GitHub repository.
798
- ```