@nanocollective/nanocoder 1.23.0 → 1.24.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (440) hide show
  1. package/LICENSE.md +1 -15
  2. package/README.md +25 -884
  3. package/assets/nanocoder-vscode.vsix +0 -0
  4. package/dist/ai-sdk-client/ai-sdk-client.d.ts +3 -2
  5. package/dist/ai-sdk-client/ai-sdk-client.d.ts.map +1 -1
  6. package/dist/ai-sdk-client/ai-sdk-client.js +16 -2
  7. package/dist/ai-sdk-client/ai-sdk-client.js.map +1 -1
  8. package/dist/ai-sdk-client/chat/chat-handler.d.ts +2 -1
  9. package/dist/ai-sdk-client/chat/chat-handler.d.ts.map +1 -1
  10. package/dist/ai-sdk-client/chat/chat-handler.js +37 -70
  11. package/dist/ai-sdk-client/chat/chat-handler.js.map +1 -1
  12. package/dist/ai-sdk-client/chat/streaming-handler.d.ts +2 -2
  13. package/dist/ai-sdk-client/chat/streaming-handler.d.ts.map +1 -1
  14. package/dist/ai-sdk-client/chat/streaming-handler.js +4 -23
  15. package/dist/ai-sdk-client/chat/streaming-handler.js.map +1 -1
  16. package/dist/ai-sdk-client/error-handling/error-parser.d.ts.map +1 -1
  17. package/dist/ai-sdk-client/error-handling/error-parser.js +7 -2
  18. package/dist/ai-sdk-client/error-handling/error-parser.js.map +1 -1
  19. package/dist/ai-sdk-client/providers/provider-factory.d.ts +2 -1
  20. package/dist/ai-sdk-client/providers/provider-factory.d.ts.map +1 -1
  21. package/dist/ai-sdk-client/providers/provider-factory.js +55 -0
  22. package/dist/ai-sdk-client/providers/provider-factory.js.map +1 -1
  23. package/dist/app/App.d.ts +1 -1
  24. package/dist/app/App.d.ts.map +1 -1
  25. package/dist/app/App.js +66 -50
  26. package/dist/app/App.js.map +1 -1
  27. package/dist/app/components/chat-input.d.ts +4 -1
  28. package/dist/app/components/chat-input.d.ts.map +1 -1
  29. package/dist/app/components/chat-input.js +4 -3
  30. package/dist/app/components/chat-input.js.map +1 -1
  31. package/dist/app/components/modal-selectors.d.ts +6 -7
  32. package/dist/app/components/modal-selectors.d.ts.map +1 -1
  33. package/dist/app/components/modal-selectors.js +11 -7
  34. package/dist/app/components/modal-selectors.js.map +1 -1
  35. package/dist/app/components/settings-selector.d.ts.map +1 -1
  36. package/dist/app/components/settings-selector.js +3 -3
  37. package/dist/app/components/settings-selector.js.map +1 -1
  38. package/dist/app/helpers.d.ts.map +1 -1
  39. package/dist/app/helpers.js +2 -4
  40. package/dist/app/helpers.js.map +1 -1
  41. package/dist/app/index.d.ts +0 -1
  42. package/dist/app/index.d.ts.map +1 -1
  43. package/dist/app/index.js +0 -1
  44. package/dist/app/index.js.map +1 -1
  45. package/dist/app/types.d.ts +2 -0
  46. package/dist/app/types.d.ts.map +1 -1
  47. package/dist/app/utils/app-util.d.ts +1 -5
  48. package/dist/app/utils/app-util.d.ts.map +1 -1
  49. package/dist/app/utils/app-util.js +60 -460
  50. package/dist/app/utils/app-util.js.map +1 -1
  51. package/dist/app/utils/handlers/compact-handler.d.ts +6 -0
  52. package/dist/app/utils/handlers/compact-handler.d.ts.map +1 -0
  53. package/dist/app/utils/handlers/compact-handler.js +148 -0
  54. package/dist/app/utils/handlers/compact-handler.js.map +1 -0
  55. package/dist/app/utils/handlers/context-max-handler.d.ts +11 -0
  56. package/dist/app/utils/handlers/context-max-handler.d.ts.map +1 -0
  57. package/dist/app/utils/handlers/context-max-handler.js +102 -0
  58. package/dist/app/utils/handlers/context-max-handler.js.map +1 -0
  59. package/dist/app/utils/handlers/create-handler.d.ts +17 -0
  60. package/dist/app/utils/handlers/create-handler.d.ts.map +1 -0
  61. package/dist/app/utils/handlers/create-handler.js +112 -0
  62. package/dist/app/utils/handlers/create-handler.js.map +1 -0
  63. package/dist/app/utils/handlers/session-handler.d.ts +8 -0
  64. package/dist/app/utils/handlers/session-handler.d.ts.map +1 -0
  65. package/dist/app/utils/handlers/session-handler.js +99 -0
  66. package/dist/app/utils/handlers/session-handler.js.map +1 -0
  67. package/dist/auth/github-copilot.d.ts +44 -0
  68. package/dist/auth/github-copilot.d.ts.map +1 -0
  69. package/dist/auth/github-copilot.js +178 -0
  70. package/dist/auth/github-copilot.js.map +1 -0
  71. package/dist/cli.js +83 -3
  72. package/dist/cli.js.map +1 -1
  73. package/dist/client-factory.d.ts +1 -1
  74. package/dist/client-factory.d.ts.map +1 -1
  75. package/dist/client-factory.js +39 -8
  76. package/dist/client-factory.js.map +1 -1
  77. package/dist/commands/compact.d.ts +1 -6
  78. package/dist/commands/compact.d.ts.map +1 -1
  79. package/dist/commands/compact.js +2 -13
  80. package/dist/commands/compact.js.map +1 -1
  81. package/dist/commands/context-max.d.ts +1 -2
  82. package/dist/commands/context-max.d.ts.map +1 -1
  83. package/dist/commands/context-max.js +2 -9
  84. package/dist/commands/context-max.js.map +1 -1
  85. package/dist/commands/copilot-login-command.d.ts +3 -0
  86. package/dist/commands/copilot-login-command.d.ts.map +1 -0
  87. package/dist/commands/copilot-login-command.js +9 -0
  88. package/dist/commands/copilot-login-command.js.map +1 -0
  89. package/dist/commands/copilot-login.d.ts +9 -0
  90. package/dist/commands/copilot-login.d.ts.map +1 -0
  91. package/dist/commands/copilot-login.js +70 -0
  92. package/dist/commands/copilot-login.js.map +1 -0
  93. package/dist/commands/create-stub-command.d.ts +8 -0
  94. package/dist/commands/create-stub-command.d.ts.map +1 -0
  95. package/dist/commands/create-stub-command.js +14 -0
  96. package/dist/commands/create-stub-command.js.map +1 -0
  97. package/dist/commands/explorer.d.ts +1 -2
  98. package/dist/commands/explorer.d.ts.map +1 -1
  99. package/dist/commands/explorer.js +2 -9
  100. package/dist/commands/explorer.js.map +1 -1
  101. package/dist/commands/help.d.ts.map +1 -1
  102. package/dist/commands/help.js +1 -1
  103. package/dist/commands/help.js.map +1 -1
  104. package/dist/commands/ide.d.ts +1 -2
  105. package/dist/commands/ide.d.ts.map +1 -1
  106. package/dist/commands/ide.js +2 -9
  107. package/dist/commands/ide.js.map +1 -1
  108. package/dist/commands/index.d.ts +2 -0
  109. package/dist/commands/index.d.ts.map +1 -1
  110. package/dist/commands/index.js +2 -0
  111. package/dist/commands/index.js.map +1 -1
  112. package/dist/commands/init.d.ts.map +1 -1
  113. package/dist/commands/init.js +2 -1
  114. package/dist/commands/init.js.map +1 -1
  115. package/dist/commands/model.d.ts +1 -2
  116. package/dist/commands/model.d.ts.map +1 -1
  117. package/dist/commands/model.js +2 -10
  118. package/dist/commands/model.js.map +1 -1
  119. package/dist/commands/provider.d.ts +1 -2
  120. package/dist/commands/provider.d.ts.map +1 -1
  121. package/dist/commands/provider.js +2 -10
  122. package/dist/commands/provider.js.map +1 -1
  123. package/dist/commands/resume.d.ts +8 -0
  124. package/dist/commands/resume.d.ts.map +1 -0
  125. package/dist/commands/resume.js +11 -0
  126. package/dist/commands/resume.js.map +1 -0
  127. package/dist/commands/settings.d.ts +1 -2
  128. package/dist/commands/settings.d.ts.map +1 -1
  129. package/dist/commands/settings.js +2 -10
  130. package/dist/commands/settings.js.map +1 -1
  131. package/dist/commands/status.d.ts +1 -2
  132. package/dist/commands/status.d.ts.map +1 -1
  133. package/dist/commands/status.js +2 -10
  134. package/dist/commands/status.js.map +1 -1
  135. package/dist/components/assistant-message.d.ts.map +1 -1
  136. package/dist/components/assistant-message.js +2 -27
  137. package/dist/components/assistant-message.js.map +1 -1
  138. package/dist/components/provider-selector.d.ts.map +1 -1
  139. package/dist/components/provider-selector.js +4 -3
  140. package/dist/components/provider-selector.js.map +1 -1
  141. package/dist/components/session-selector.d.ts +12 -0
  142. package/dist/components/session-selector.d.ts.map +1 -0
  143. package/dist/components/session-selector.js +108 -0
  144. package/dist/components/session-selector.js.map +1 -0
  145. package/dist/components/text-input.d.ts +2 -1
  146. package/dist/components/text-input.d.ts.map +1 -1
  147. package/dist/components/text-input.js +11 -6
  148. package/dist/components/text-input.js.map +1 -1
  149. package/dist/components/tool-confirmation.d.ts.map +1 -1
  150. package/dist/components/tool-confirmation.js +9 -6
  151. package/dist/components/tool-confirmation.js.map +1 -1
  152. package/dist/components/ui/styled-title.js +2 -2
  153. package/dist/components/ui/styled-title.js.map +1 -1
  154. package/dist/components/user-input.d.ts +3 -1
  155. package/dist/components/user-input.d.ts.map +1 -1
  156. package/dist/components/user-input.js +35 -23
  157. package/dist/components/user-input.js.map +1 -1
  158. package/dist/components/user-message.d.ts.map +1 -1
  159. package/dist/components/user-message.js +1 -23
  160. package/dist/components/user-message.js.map +1 -1
  161. package/dist/components/vscode-extension-prompt.d.ts +6 -1
  162. package/dist/components/vscode-extension-prompt.d.ts.map +1 -1
  163. package/dist/components/vscode-extension-prompt.js +80 -36
  164. package/dist/components/vscode-extension-prompt.js.map +1 -1
  165. package/dist/config/copilot-credentials.d.ts +27 -0
  166. package/dist/config/copilot-credentials.d.ts.map +1 -0
  167. package/dist/config/copilot-credentials.js +81 -0
  168. package/dist/config/copilot-credentials.js.map +1 -0
  169. package/dist/config/index.d.ts +0 -2
  170. package/dist/config/index.d.ts.map +1 -1
  171. package/dist/config/index.js +63 -27
  172. package/dist/config/index.js.map +1 -1
  173. package/dist/config/mcp-config-loader.d.ts +2 -3
  174. package/dist/config/mcp-config-loader.d.ts.map +1 -1
  175. package/dist/config/mcp-config-loader.js +136 -181
  176. package/dist/config/mcp-config-loader.js.map +1 -1
  177. package/dist/config/nanocoder-tools-config.js +2 -2
  178. package/dist/config/nanocoder-tools-config.js.map +1 -1
  179. package/dist/config/themes.d.ts.map +1 -1
  180. package/dist/config/themes.js +9 -766
  181. package/dist/config/themes.js.map +1 -1
  182. package/dist/config/validation.d.ts.map +1 -1
  183. package/dist/config/validation.js +0 -19
  184. package/dist/config/validation.js.map +1 -1
  185. package/dist/custom-commands/parser.d.ts.map +1 -1
  186. package/dist/custom-commands/parser.js +0 -9
  187. package/dist/custom-commands/parser.js.map +1 -1
  188. package/dist/hooks/chat-handler/conversation/conversation-loop.d.ts +5 -0
  189. package/dist/hooks/chat-handler/conversation/conversation-loop.d.ts.map +1 -1
  190. package/dist/hooks/chat-handler/conversation/conversation-loop.js +78 -97
  191. package/dist/hooks/chat-handler/conversation/conversation-loop.js.map +1 -1
  192. package/dist/hooks/chat-handler/conversation/tool-executor.d.ts +7 -2
  193. package/dist/hooks/chat-handler/conversation/tool-executor.d.ts.map +1 -1
  194. package/dist/hooks/chat-handler/conversation/tool-executor.js +112 -42
  195. package/dist/hooks/chat-handler/conversation/tool-executor.js.map +1 -1
  196. package/dist/hooks/chat-handler/types.d.ts +3 -0
  197. package/dist/hooks/chat-handler/types.d.ts.map +1 -1
  198. package/dist/hooks/chat-handler/useChatHandler.d.ts +1 -1
  199. package/dist/hooks/chat-handler/useChatHandler.d.ts.map +1 -1
  200. package/dist/hooks/chat-handler/useChatHandler.js +7 -1
  201. package/dist/hooks/chat-handler/useChatHandler.js.map +1 -1
  202. package/dist/hooks/useAppHandlers.d.ts +8 -1
  203. package/dist/hooks/useAppHandlers.d.ts.map +1 -1
  204. package/dist/hooks/useAppHandlers.js +119 -13
  205. package/dist/hooks/useAppHandlers.js.map +1 -1
  206. package/dist/hooks/useAppInitialization.d.ts +5 -3
  207. package/dist/hooks/useAppInitialization.d.ts.map +1 -1
  208. package/dist/hooks/useAppInitialization.js +51 -30
  209. package/dist/hooks/useAppInitialization.js.map +1 -1
  210. package/dist/hooks/useAppState.d.ts +15 -10
  211. package/dist/hooks/useAppState.d.ts.map +1 -1
  212. package/dist/hooks/useAppState.js +37 -28
  213. package/dist/hooks/useAppState.js.map +1 -1
  214. package/dist/hooks/useModeHandlers.d.ts +8 -14
  215. package/dist/hooks/useModeHandlers.d.ts.map +1 -1
  216. package/dist/hooks/useModeHandlers.js +31 -101
  217. package/dist/hooks/useModeHandlers.js.map +1 -1
  218. package/dist/hooks/useNonInteractiveMode.d.ts +7 -0
  219. package/dist/hooks/useNonInteractiveMode.d.ts.map +1 -1
  220. package/dist/hooks/useNonInteractiveMode.js +39 -2
  221. package/dist/hooks/useNonInteractiveMode.js.map +1 -1
  222. package/dist/hooks/useSessionAutosave.d.ts +16 -0
  223. package/dist/hooks/useSessionAutosave.d.ts.map +1 -0
  224. package/dist/hooks/useSessionAutosave.js +133 -0
  225. package/dist/hooks/useSessionAutosave.js.map +1 -0
  226. package/dist/hooks/useToolHandler.d.ts +2 -1
  227. package/dist/hooks/useToolHandler.d.ts.map +1 -1
  228. package/dist/hooks/useToolHandler.js +9 -3
  229. package/dist/hooks/useToolHandler.js.map +1 -1
  230. package/dist/mcp/mcp-client.d.ts.map +1 -1
  231. package/dist/mcp/mcp-client.js +3 -2
  232. package/dist/mcp/mcp-client.js.map +1 -1
  233. package/dist/mcp/transport-factory.d.ts.map +1 -1
  234. package/dist/mcp/transport-factory.js +4 -36
  235. package/dist/mcp/transport-factory.js.map +1 -1
  236. package/dist/models/models-dev-client.d.ts.map +1 -1
  237. package/dist/models/models-dev-client.js +21 -14
  238. package/dist/models/models-dev-client.js.map +1 -1
  239. package/dist/session/session-manager.d.ts +57 -0
  240. package/dist/session/session-manager.d.ts.map +1 -0
  241. package/dist/session/session-manager.js +361 -0
  242. package/dist/session/session-manager.js.map +1 -0
  243. package/dist/test-utils/render-with-theme.d.ts.map +1 -1
  244. package/dist/test-utils/render-with-theme.js +2 -1
  245. package/dist/test-utils/render-with-theme.js.map +1 -1
  246. package/dist/tool-calling/tool-parser.d.ts +3 -2
  247. package/dist/tool-calling/tool-parser.d.ts.map +1 -1
  248. package/dist/tool-calling/tool-parser.js +6 -27
  249. package/dist/tool-calling/tool-parser.js.map +1 -1
  250. package/dist/tools/execute-bash.d.ts.map +1 -1
  251. package/dist/tools/execute-bash.js +5 -0
  252. package/dist/tools/execute-bash.js.map +1 -1
  253. package/dist/tools/fetch-url.d.ts.map +1 -1
  254. package/dist/tools/fetch-url.js +11 -2
  255. package/dist/tools/fetch-url.js.map +1 -1
  256. package/dist/tools/file-ops/copy-file.d.ts.map +1 -1
  257. package/dist/tools/file-ops/copy-file.js +6 -36
  258. package/dist/tools/file-ops/copy-file.js.map +1 -1
  259. package/dist/tools/file-ops/create-directory.d.ts.map +1 -1
  260. package/dist/tools/file-ops/create-directory.js +2 -19
  261. package/dist/tools/file-ops/create-directory.js.map +1 -1
  262. package/dist/tools/file-ops/delete-file.d.ts.map +1 -1
  263. package/dist/tools/file-ops/delete-file.js +6 -20
  264. package/dist/tools/file-ops/delete-file.js.map +1 -1
  265. package/dist/tools/file-ops/move-file.d.ts.map +1 -1
  266. package/dist/tools/file-ops/move-file.js +6 -36
  267. package/dist/tools/file-ops/move-file.js.map +1 -1
  268. package/dist/tools/file-ops/string-replace-preview.d.ts +10 -0
  269. package/dist/tools/file-ops/string-replace-preview.d.ts.map +1 -0
  270. package/dist/tools/file-ops/string-replace-preview.js +171 -0
  271. package/dist/tools/file-ops/string-replace-preview.js.map +1 -0
  272. package/dist/tools/file-ops/string-replace.d.ts.map +1 -1
  273. package/dist/tools/file-ops/string-replace.js +9 -292
  274. package/dist/tools/file-ops/string-replace.js.map +1 -1
  275. package/dist/tools/file-ops/write-file.d.ts.map +1 -1
  276. package/dist/tools/file-ops/write-file.js +7 -66
  277. package/dist/tools/file-ops/write-file.js.map +1 -1
  278. package/dist/tools/find-files.d.ts.map +1 -1
  279. package/dist/tools/find-files.js +1 -0
  280. package/dist/tools/find-files.js.map +1 -1
  281. package/dist/tools/git/git-diff.d.ts.map +1 -1
  282. package/dist/tools/git/git-diff.js +1 -0
  283. package/dist/tools/git/git-diff.js.map +1 -1
  284. package/dist/tools/git/git-log.d.ts.map +1 -1
  285. package/dist/tools/git/git-log.js +1 -0
  286. package/dist/tools/git/git-log.js.map +1 -1
  287. package/dist/tools/git/git-status.d.ts.map +1 -1
  288. package/dist/tools/git/git-status.js +1 -0
  289. package/dist/tools/git/git-status.js.map +1 -1
  290. package/dist/tools/index.d.ts +1 -0
  291. package/dist/tools/index.d.ts.map +1 -1
  292. package/dist/tools/index.js +7 -0
  293. package/dist/tools/index.js.map +1 -1
  294. package/dist/tools/list-directory.d.ts.map +1 -1
  295. package/dist/tools/list-directory.js +2 -1
  296. package/dist/tools/list-directory.js.map +1 -1
  297. package/dist/tools/lsp-get-diagnostics.d.ts.map +1 -1
  298. package/dist/tools/lsp-get-diagnostics.js +1 -5
  299. package/dist/tools/lsp-get-diagnostics.js.map +1 -1
  300. package/dist/tools/read-file.d.ts.map +1 -1
  301. package/dist/tools/read-file.js +1 -0
  302. package/dist/tools/read-file.js.map +1 -1
  303. package/dist/tools/search-file-contents.d.ts.map +1 -1
  304. package/dist/tools/search-file-contents.js +124 -32
  305. package/dist/tools/search-file-contents.js.map +1 -1
  306. package/dist/tools/tasks/list-tasks.d.ts.map +1 -1
  307. package/dist/tools/tasks/list-tasks.js +1 -0
  308. package/dist/tools/tasks/list-tasks.js.map +1 -1
  309. package/dist/tools/tool-manager.d.ts +10 -0
  310. package/dist/tools/tool-manager.d.ts.map +1 -1
  311. package/dist/tools/tool-manager.js +16 -2
  312. package/dist/tools/tool-manager.js.map +1 -1
  313. package/dist/tools/tool-registry.d.ts +9 -1
  314. package/dist/tools/tool-registry.d.ts.map +1 -1
  315. package/dist/tools/tool-registry.js +17 -1
  316. package/dist/tools/tool-registry.js.map +1 -1
  317. package/dist/tools/web-search.d.ts.map +1 -1
  318. package/dist/tools/web-search.js +1 -0
  319. package/dist/tools/web-search.js.map +1 -1
  320. package/dist/types/app.d.ts +3 -0
  321. package/dist/types/app.d.ts.map +1 -1
  322. package/dist/types/commands.d.ts +1 -2
  323. package/dist/types/commands.d.ts.map +1 -1
  324. package/dist/types/config.d.ts +11 -15
  325. package/dist/types/config.d.ts.map +1 -1
  326. package/dist/types/core.d.ts +13 -3
  327. package/dist/types/core.d.ts.map +1 -1
  328. package/dist/types/core.js.map +1 -1
  329. package/dist/types/markdown-parser.d.ts +2 -10
  330. package/dist/types/markdown-parser.d.ts.map +1 -1
  331. package/dist/types/mcp.d.ts +2 -28
  332. package/dist/types/mcp.d.ts.map +1 -1
  333. package/dist/types/ui.d.ts +1 -1
  334. package/dist/types/ui.d.ts.map +1 -1
  335. package/dist/utils/ansi-truncate.d.ts +6 -0
  336. package/dist/utils/ansi-truncate.d.ts.map +1 -0
  337. package/dist/utils/ansi-truncate.js +39 -0
  338. package/dist/utils/ansi-truncate.js.map +1 -0
  339. package/dist/utils/installation-detector.d.ts +6 -0
  340. package/dist/utils/installation-detector.d.ts.map +1 -1
  341. package/dist/utils/installation-detector.js +33 -19
  342. package/dist/utils/installation-detector.js.map +1 -1
  343. package/dist/utils/logging/health-monitor/checks/memory-check.d.ts.map +1 -1
  344. package/dist/utils/logging/health-monitor/checks/memory-check.js +2 -1
  345. package/dist/utils/logging/health-monitor/checks/memory-check.js.map +1 -1
  346. package/dist/utils/logging/health-monitor/core/health-monitor.d.ts.map +1 -1
  347. package/dist/utils/logging/health-monitor/core/health-monitor.js +3 -2
  348. package/dist/utils/logging/health-monitor/core/health-monitor.js.map +1 -1
  349. package/dist/utils/logging/performance.d.ts.map +1 -1
  350. package/dist/utils/logging/performance.js +21 -17
  351. package/dist/utils/logging/performance.js.map +1 -1
  352. package/dist/utils/logging/pino-logger.d.ts.map +1 -1
  353. package/dist/utils/logging/pino-logger.js +7 -8
  354. package/dist/utils/logging/pino-logger.js.map +1 -1
  355. package/dist/utils/logging/redaction.d.ts.map +1 -1
  356. package/dist/utils/logging/redaction.js +2 -0
  357. package/dist/utils/logging/redaction.js.map +1 -1
  358. package/dist/utils/logging/request-tracker.d.ts.map +1 -1
  359. package/dist/utils/logging/request-tracker.js +6 -5
  360. package/dist/utils/logging/request-tracker.js.map +1 -1
  361. package/dist/utils/logging/safe-process.d.ts +16 -0
  362. package/dist/utils/logging/safe-process.d.ts.map +1 -0
  363. package/dist/utils/logging/safe-process.js +37 -0
  364. package/dist/utils/logging/safe-process.js.map +1 -0
  365. package/dist/utils/logging/types.d.ts +0 -3
  366. package/dist/utils/logging/types.d.ts.map +1 -1
  367. package/dist/utils/message-builder.d.ts +0 -5
  368. package/dist/utils/message-builder.d.ts.map +1 -1
  369. package/dist/utils/message-builder.js +0 -8
  370. package/dist/utils/message-builder.js.map +1 -1
  371. package/dist/utils/path-validation.d.ts.map +1 -1
  372. package/dist/utils/path-validation.js +3 -1
  373. package/dist/utils/path-validation.js.map +1 -1
  374. package/dist/utils/path-validators.d.ts +16 -0
  375. package/dist/utils/path-validators.d.ts.map +1 -0
  376. package/dist/utils/path-validators.js +55 -0
  377. package/dist/utils/path-validators.js.map +1 -0
  378. package/dist/utils/prompt-processor.d.ts.map +1 -1
  379. package/dist/utils/prompt-processor.js +1 -3
  380. package/dist/utils/prompt-processor.js.map +1 -1
  381. package/dist/utils/response-formatter.d.ts.map +1 -1
  382. package/dist/utils/response-formatter.js +2 -17
  383. package/dist/utils/response-formatter.js.map +1 -1
  384. package/dist/utils/text-wrapping.d.ts +8 -0
  385. package/dist/utils/text-wrapping.d.ts.map +1 -0
  386. package/dist/utils/text-wrapping.js +29 -0
  387. package/dist/utils/text-wrapping.js.map +1 -0
  388. package/dist/utils/tool-approval.d.ts +6 -0
  389. package/dist/utils/tool-approval.d.ts.map +1 -0
  390. package/dist/utils/tool-approval.js +15 -0
  391. package/dist/utils/tool-approval.js.map +1 -0
  392. package/dist/utils/tool-result-display.d.ts +20 -1
  393. package/dist/utils/tool-result-display.d.ts.map +1 -1
  394. package/dist/utils/tool-result-display.js +96 -3
  395. package/dist/utils/tool-result-display.js.map +1 -1
  396. package/dist/vscode/extension-installer.d.ts +34 -7
  397. package/dist/vscode/extension-installer.d.ts.map +1 -1
  398. package/dist/vscode/extension-installer.js +151 -64
  399. package/dist/vscode/extension-installer.js.map +1 -1
  400. package/dist/vscode/index.d.ts +1 -1
  401. package/dist/vscode/index.d.ts.map +1 -1
  402. package/dist/vscode/index.js +1 -1
  403. package/dist/vscode/index.js.map +1 -1
  404. package/dist/wizards/mcp-wizard.d.ts.map +1 -1
  405. package/dist/wizards/mcp-wizard.js +2 -1
  406. package/dist/wizards/mcp-wizard.js.map +1 -1
  407. package/dist/wizards/provider-wizard.d.ts.map +1 -1
  408. package/dist/wizards/provider-wizard.js +4 -2
  409. package/dist/wizards/provider-wizard.js.map +1 -1
  410. package/dist/wizards/steps/location-step.d.ts.map +1 -1
  411. package/dist/wizards/steps/location-step.js +2 -1
  412. package/dist/wizards/steps/location-step.js.map +1 -1
  413. package/dist/wizards/steps/mcp-step.d.ts.map +1 -1
  414. package/dist/wizards/steps/mcp-step.js +2 -1
  415. package/dist/wizards/steps/mcp-step.js.map +1 -1
  416. package/dist/wizards/steps/provider-step.d.ts.map +1 -1
  417. package/dist/wizards/steps/provider-step.js +4 -1
  418. package/dist/wizards/steps/provider-step.js.map +1 -1
  419. package/dist/wizards/steps/summary-step.d.ts.map +1 -1
  420. package/dist/wizards/steps/summary-step.js +2 -1
  421. package/dist/wizards/steps/summary-step.js.map +1 -1
  422. package/dist/wizards/templates/mcp-templates.d.ts +0 -8
  423. package/dist/wizards/templates/mcp-templates.d.ts.map +1 -1
  424. package/dist/wizards/templates/mcp-templates.js.map +1 -1
  425. package/dist/wizards/templates/provider-templates.d.ts.map +1 -1
  426. package/dist/wizards/templates/provider-templates.js +59 -0
  427. package/dist/wizards/templates/provider-templates.js.map +1 -1
  428. package/dist/wizards/validation.d.ts.map +1 -1
  429. package/dist/wizards/validation.js +0 -1
  430. package/dist/wizards/validation.js.map +1 -1
  431. package/package.json +20 -12
  432. package/source/config/themes.json +787 -0
  433. package/dist/ai-sdk-client/chat/tool-processor.d.ts +0 -10
  434. package/dist/ai-sdk-client/chat/tool-processor.d.ts.map +0 -1
  435. package/dist/ai-sdk-client/chat/tool-processor.js +0 -58
  436. package/dist/ai-sdk-client/chat/tool-processor.js.map +0 -1
  437. package/dist/tool-calling/json-parser.d.ts +0 -28
  438. package/dist/tool-calling/json-parser.d.ts.map +0 -1
  439. package/dist/tool-calling/json-parser.js +0 -219
  440. package/dist/tool-calling/json-parser.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Nanocoder
2
2
 
3
- A local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter. Built with privacy and control in mind, Nanocoder supports multiple AI providers with tool support for file operations and command execution.
3
+ A local-first CLI coding agent built by the [Nano Collective](https://github.com/Nano-Collective) a community collective building AI tooling not for profit, but for the community. Everything we build is open, transparent, and driven by the people who use it. AI done right.
4
+
5
+ Nanocoder brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter. Built with privacy and control in mind, it supports multiple AI providers with tool support for file operations and command execution.
4
6
 
5
7
  ![Example](./.github/assets/example.gif)
6
8
 
@@ -14,906 +16,45 @@ A local-first CLI coding agent that brings the power of agentic coding tools lik
14
16
  ![Stars](https://github.com/Nano-Collective/nanocoder/raw/main/badges/stars.svg)
15
17
  ![Forks](https://github.com/Nano-Collective/nanocoder/raw/main/badges/forks.svg)
16
18
 
17
-
18
- ## Table of Contents
19
-
20
- - [FAQs](#faqs)
21
- - [Installation](#installation)
22
- - [For Users](#for-users)
23
- - [For Development](#for-development)
24
- - [Usage](#usage)
25
- - [Interactive Mode](#interactive-mode)
26
- - [Non-Interactive Mode](#non-interactive-mode)
27
- - [Configuration](#configuration)
28
- - [AI Provider Setup](#ai-provider-setup)
29
- - [MCP (Model Context Protocol) Servers](#mcp-model-context-protocol-servers)
30
- - [User Preferences](#user-preferences)
31
- - [Application Data Directory](#application-data-directory)
32
- - [Commands](#commands)
33
- - [Built-in Commands](#built-in-commands)
34
- - [Custom Commands](#custom-commands)
35
- - [Features](#features)
36
- - [Multi-Provider Support](#multi-provider-support)
37
- - [Advanced Tool System](#advanced-tool-system)
38
- - [Custom Command System](#custom-command-system)
39
- - [Enhanced User Experience](#enhanced-user-experience)
40
- - [Keyboard Shortcuts](#keyboard-shortcuts)
41
- - [Developer Features](#developer-features)
42
- - [VS Code Extension](#vs-code-extension)
43
- - [Community](#community)
44
-
45
- ## FAQs
46
-
47
- ### What is Nanocoder?
48
-
49
- Nanocoder is a local-first CLI coding agent that brings the power of agentic coding tools like Claude Code and Gemini CLI to local models or controlled APIs like OpenRouter. Built with privacy and control in mind, Nanocoder supports any AI provider that has an OpenAI compatible end-point, tool and non-tool calling models.
50
-
51
- ### How is this different to OpenCode?
52
-
53
- This comes down to philosophy. OpenCode is a great tool, but it's owned and managed by a venture-backed company that restricts community and open-source involvement to the outskirts. With Nanocoder, the focus is on building a true community-led project where anyone can contribute openly and directly. We believe AI is too powerful to be in the hands of big corporations and everyone should have access to it.
54
-
55
- We also strongly believe in the "local-first" approach, where your data, models, and processing stay on your machine whenever possible to ensure maximum privacy and user control. Beyond that, we're actively pushing to develop advancements and frameworks for small, local models to be effective at coding locally.
56
-
57
- Not everyone will agree with this philosophy, and that's okay. We believe in fostering an inclusive community that's focused on open collaboration and privacy-first AI coding tools.
58
-
59
- ### I want to be involved, how do I start?
60
-
61
- Firstly, we would love for you to be involved. You can get started contributing to Nanocoder in several ways, check out the [Community](#community) section of this README.
62
-
63
- ## Installation
64
-
65
- ### For Users
66
-
67
- #### NPM
68
-
69
- Install globally and use anywhere:
19
+ ## Quick Start
70
20
 
71
21
  ```bash
72
22
  npm install -g @nanocollective/nanocoder
73
- ```
74
-
75
- Then run in any directory:
76
-
77
- ```bash
78
- nanocoder
79
- ```
80
-
81
- #### Homebrew (macOS/Linux)
82
-
83
- First, tap the repository:
84
-
85
- ```bash
86
- brew tap nano-collective/nanocoder https://github.com/Nano-Collective/nanocoder
87
- ```
88
-
89
- Then install:
90
-
91
- ```bash
92
- brew install nanocoder
93
- ```
94
-
95
- Run in any directory:
96
-
97
- ```bash
98
23
  nanocoder
99
24
  ```
100
25
 
101
- To update:
102
-
103
- ```bash
104
- # Update Homebrew's tap cache first (important!)
105
- brew update
106
-
107
- # Then upgrade nanocoder
108
- brew upgrade nanocoder
109
- ```
110
-
111
- > **Note**: If `brew upgrade nanocoder` shows the old version is already installed, run `brew update` first. Homebrew caches tap formulas locally and only refreshes them during `brew update`. Without updating the tap cache, you'll see the cached (older) version even if a newer formula exists in the repository.
112
-
113
- #### Nix Flakes
114
-
115
- Run Nanocoder directly using:
116
-
117
- ```bash
118
- # If you have flakes enabled in your Nix config:
119
- nix run github:Nano-Collective/nanocoder
120
-
121
- # If you don't have flakes enabled:
122
- nix run --extra-experimental-features 'nix-command flakes' github:Nano-Collective/nanocoder
123
- ```
124
-
125
- Or install from `packages` output:
126
-
127
- ```nix
128
- # flake.nix
129
- {
130
- inputs = {
131
- nanocoder = {
132
- url = "github:Nano-Collective/nanocoder";
133
- inputs.nixpkgs.follows = "nixpkgs";
134
- };
135
- };
136
- }
137
-
138
- # configuration.nix
139
- { pkgs, inputs, system, ... }: {
140
- environment.systemPackages = [
141
- inputs.nanocoder.packages."${system}".default
142
- ];
143
- }
144
- ```
145
-
146
- ### For Development
147
-
148
- If you want to contribute or modify Nanocoder:
149
-
150
- **Prerequisites:**
151
-
152
- - Node.js 20+
153
- - pnpm
154
-
155
- **Setup:**
156
-
157
- 1. Clone and install dependencies:
158
-
159
- ```bash
160
- git clone [repo-url]
161
- cd nanocoder
162
- pnpm install
163
- ```
164
-
165
- 2. Build the project:
166
-
167
- ```bash
168
- pnpm run build
169
- ```
170
-
171
- 3. Run locally:
26
+ Also available via [Homebrew](docs/getting-started/installation.md#homebrew-macoslinux) and [Nix Flakes](docs/getting-started/installation.md#nix-flakes).
172
27
 
173
- ```bash
174
- pnpm run start
175
- ```
28
+ ### CLI Flags
176
29
 
177
- Or build and run in one command:
30
+ Specify provider and model directly:
178
31
 
179
32
  ```bash
180
- pnpm run dev
181
- ```
182
-
183
- ## Usage
184
-
185
- ### CLI Options
33
+ # Non-interactive mode with specific provider/model
34
+ nanocoder --provider openrouter --model google/gemini-3.1-flash run "analyze src/app.ts"
186
35
 
187
- Nanocoder supports standard CLI arguments for quick information and help:
36
+ # Interactive mode starting with specific provider
37
+ nanocoder --provider ollama --model llama3.1
188
38
 
189
- ```bash
190
- # Show version information
191
- nanocoder --version
192
- nanocoder -v
193
-
194
- # Show help and available options
195
- nanocoder --help
196
- nanocoder -h
39
+ # Flags can appear before or after 'run' command
40
+ nanocoder run --provider openrouter "refactor database module"
197
41
  ```
198
42
 
199
- **CLI Options Reference:**
200
-
201
- | Option | Short | Description |
202
- |--------|-------|-------------|
203
- | `--version` | `-v` | Display the installed version number |
204
- | `--help` | `-h` | Show usage information and available options |
205
- | `--vscode` | | Run in VS Code mode (for extension) |
206
- | `--vscode-port` | | Specify VS Code server port |
207
- | `run` | | Run in non-interactive mode |
208
-
209
- **Common Use Cases:**
210
-
211
- ```bash
212
- # Check version in scripts
213
- echo "Nanocoder version: $(nanocoder --version)"
214
-
215
- # Get help in CI/CD pipelines
216
- nanocoder --help
217
-
218
- # Quick version check
219
- nanocoder -v
220
-
221
- # Discover available options
222
- nanocoder -h
223
- ```
224
-
225
- ### Interactive Mode
226
-
227
- To start Nanocoder in interactive mode (the default), simply run:
228
-
229
- ```bash
230
- nanocoder
231
- ```
232
-
233
- This will open an interactive chat session where you can:
234
-
235
- - Chat with the AI about your code
236
- - Use slash commands (e.g., `/help`, `/model`, `/status`)
237
- - Execute bash commands with `!`
238
- - Tag files with `@`
239
- - Review and approve tool executions
240
- - Switch between different models and providers
241
-
242
- ### Non-Interactive Mode
243
-
244
- For automated tasks, scripting, or CI/CD pipelines, use the `run` command:
245
-
246
- ```bash
247
- nanocoder run "your prompt here"
248
- ```
249
-
250
- **Examples:**
251
-
252
- ```bash
253
- # Simple task
254
- nanocoder run "analyze the code in src/app.ts"
255
-
256
- # Code generation
257
- nanocoder run "create a new React component for user login"
258
-
259
- # Testing
260
- nanocoder run "write unit tests for all functions in utils.js"
261
-
262
- # Refactoring
263
- nanocoder run "refactor the database connection to use a connection pool"
264
- ```
265
-
266
- **Non-interactive mode behavior:**
267
-
268
- - Automatically executes the given prompt
269
- - Runs in auto-accept mode (tools execute without confirmation)
270
- - Displays all output and tool execution results
271
- - Exits automatically when the task is complete
272
-
273
- **Note:** When using non-interactive mode with VS Code integration, place any flags (like `--vscode` or `--vscode-port`) before the `run` command:
274
-
275
- ```bash
276
- nanocoder --vscode run "your prompt"
277
- ```
278
-
279
- ## Configuration
280
-
281
- ### AI Provider Setup
282
-
283
- Nanocoder supports any OpenAI-compatible API through a unified provider configuration.
284
-
285
- **Configuration Methods:**
286
-
287
- 1. **Interactive Setup (Recommended for new users)**: Run `/setup-providers` inside Nanocoder for a guided wizard with provider templates. The wizard allows you to:
288
- - Choose between project-level or global configuration
289
- - Select from common provider templates (Ollama, OpenRouter, LM Studio, Kimi Code, etc.)
290
- - Add custom OpenAI-compatible providers manually
291
- - Edit or delete existing providers
292
- - Fetch available models automatically from your provider
293
- 2. **Manual Configuration**: Create an `agents.config.json` file (see below for locations)
294
-
295
- > **Note**: The `/setup-providers` wizard requires at least one provider to be configured before saving. You cannot exit without adding a provider.
296
-
297
- **Configuration File Locations:**
298
-
299
- Nanocoder looks for configuration in the following order (first found wins):
300
-
301
- 1. **Project-level** (highest priority): `agents.config.json` in your current working directory
302
-
303
- - Use this for project-specific providers, models, or API keys
304
- - Perfect for team sharing or repository-specific configurations
305
-
306
- 2. **User-level (preferred)**: Platform-specific configuration directory
307
-
308
- - **macOS**: `~/Library/Preferences/nanocoder/agents.config.json`
309
- - **Linux/Unix**: `~/.config/nanocoder/agents.config.json`
310
- - **Windows**: `%APPDATA%\nanocoder\agents.config.json`
311
- - Your global default configuration
312
- - Used when no project-level config exists
313
-
314
- You can override this global configuration directory by setting `NANOCODER_CONFIG_DIR`. When set, Nanocoder will look for `agents.config.json` and related config files directly in this directory.
315
-
316
- 3. **User-level (legacy)**: `~/.agents.config.json`
317
- - Supported for backward compatibility
318
- - Recommended to migrate to platform-specific location above
319
-
320
- **Example Configuration** (`agents.config.json`):
321
-
322
- ```json
323
- {
324
- "nanocoder": {
325
- "providers": [
326
- {
327
- "name": "llama-cpp",
328
- "baseUrl": "http://localhost:8080/v1",
329
- "models": ["qwen3-coder:a3b", "deepseek-v3.1"]
330
- },
331
- {
332
- "name": "Ollama",
333
- "baseUrl": "http://localhost:11434/v1",
334
- "models": ["qwen2.5-coder:14b", "llama3.2"]
335
- },
336
- {
337
- "name": "OpenRouter",
338
- "baseUrl": "https://openrouter.ai/api/v1",
339
- "apiKey": "your-openrouter-api-key",
340
- "models": ["openai/gpt-4o-mini", "anthropic/claude-3-haiku"]
341
- },
342
- {
343
- "name": "LM Studio",
344
- "baseUrl": "http://localhost:1234/v1",
345
- "models": ["local-model"]
346
- },
347
- {
348
- "name": "Z.ai",
349
- "baseUrl": "https://api.z.ai/api/paas/v4/",
350
- "apiKey": "your-z.ai-api-key",
351
- "models": ["glm-4.7", "glm-4.5", "glm-4.5-air"]
352
- },
353
- {
354
- "name": "Z.ai Coding Subscription",
355
- "baseUrl": "https://api.z.ai/api/coding/paas/v4/",
356
- "apiKey": "your-z.ai-coding-api-key",
357
- "models": ["glm-4.7", "glm-4.5", "glm-4.5-air"]
358
- },
359
- {
360
- "name": "GitHub Models",
361
- "baseUrl": "https://models.github.ai/inference",
362
- "apiKey": "your-github-pat",
363
- "models": ["openai/gpt-4o-mini", "meta/llama-3.1-70b-instruct"]
364
- },
365
- {
366
- "name": "Poe",
367
- "baseUrl": "https://api.poe.com/v1",
368
- "apiKey": "your-poe-api-key",
369
- "models": ["Claude-Sonnet-4", "GPT-4o", "Gemini-2.5-Pro"]
370
- },
371
- {
372
- "name": "Gemini",
373
- "sdkProvider": "google",
374
- "baseUrl": "https://generativelanguage.googleapis.com/v1beta",
375
- "apiKey": "your-gemini-api-key",
376
- "models": ["gemini-3-flash-preview", "gemini-3-pro-preview"]
377
- }
378
- ]
379
- }
380
- }
381
- ```
382
-
383
- **Common Provider Examples:**
384
-
385
- - **llama.cpp server**: `"baseUrl": "http://localhost:8080/v1"`
386
- - **llama-swap**: `"baseUrl": "http://localhost:9292/v1"`
387
- - **Ollama (Local)**: `"baseUrl": "http://localhost:11434/v1"`
388
- - **OpenRouter (Cloud)**: `"baseUrl": "https://openrouter.ai/api/v1"`
389
- - **LM Studio**: `"baseUrl": "http://localhost:1234/v1"`
390
- - **vLLM**: `"baseUrl": "http://localhost:8000/v1"`
391
- - **LocalAI**: `"baseUrl": "http://localhost:8080/v1"`
392
- - **OpenAI**: `"baseUrl": "https://api.openai.com/v1"`
393
- - **Poe**: `"baseUrl": "https://api.poe.com/v1"` (get API key from [poe.com/api_key](https://poe.com/api_key))
394
- - **GitHub Models**: `"baseUrl": "https://models.github.ai/inference"` (requires PAT with `models:read` scope)
395
- - **Z.ai**: `"baseUrl": "https://api.z.ai/api/paas/v4/"`
396
- - **Z.ai Coding**: `"baseUrl": "https://api.z.ai/api/coding/paas/v4/"`
397
- - **Kimi Code**: `"sdkProvider": "anthroopic"`, `"baseUrl": "https://api.kimi.com/coding/v1"`
398
- - **Google Gemini**: `"sdkProvider": "google"` (get API key from [aistudio.google.com/apikey](https://aistudio.google.com/apikey))
399
-
400
- **Provider Configuration:**
401
-
402
- - `name`: Display name used in `/provider` command
403
- - `baseUrl`: OpenAI-compatible API endpoint
404
- - `apiKey`: API key (optional, may not be required)
405
- - `models`: Available model list for `/model` command
406
- - `disableToolModels`: List of model names to disable tool calling for (optional)
407
- - `sdkProvider`: AI SDK provider package to use (optional, defaults to `openai-compatible`)
408
- - `openai-compatible`: Default, works with any OpenAI-compatible API
409
- - `google`: Use `@ai-sdk/google` for native Google Gemini support (required for Gemini 3 models with tool calling)
410
- - `anthropic`: Use `@ai-sdk/anthropic` for providers that require it like Kimi Coding
411
-
412
- **Environment Variables:**
413
-
414
- Keep API keys out of version control using environment variables. Variables are loaded from shell environment (`.bashrc`, `.zshrc`) or `.env` file in your working directory.
415
-
416
- - `NANOCODER_CONFIG_DIR`: Override the global configuration directory.
417
- - `NANOCODER_CONTEXT_LIMIT`: Set a default context limit (in tokens) for models not found on models.dev. This is used as a fallback when the model's context window is unknown, enabling auto-compact and `/usage` to work correctly.
418
- - `NANOCODER_DATA_DIR`: Override the application data directory used for internal data like usage statistics.
419
-
420
- **Syntax:** `$VAR_NAME`, `${VAR_NAME}`, or `${VAR_NAME:-default}`
421
- **Supported in:** `baseUrl`, `apiKey`, `models`, `disableToolModels`, `MCP server`, `command`, `args`, `env`
422
-
423
- See `.env.example` for setup instructions
424
-
425
- **Timeout Configuration:**
426
-
427
- Nanocoder allows you to configure timeouts for your AI providers to handle long-running requests.
428
-
429
- - `requestTimeout`: (Optional) The application-level timeout in milliseconds. This is the total time the application will wait for a response from the provider. If not set, it defaults to 2 minutes (120,000 ms). Set to `-1` to disable this timeout.
430
- - `socketTimeout`: (Optional) The socket-level timeout in milliseconds. This controls the timeout for the underlying network connection. If not set, it will use the value of `requestTimeout`. Set to `-1` to disable this timeout.
431
-
432
- It is recommended to set both `requestTimeout` and `socketTimeout` to the same value for consistent behavior. For very long-running requests, you can disable timeouts by setting both to `-1`.
433
-
434
- - `connectionPool`: (Optional) An object to configure the connection pooling behavior for the underlying socket connection.
435
- - `idleTimeout`: (Optional) The timeout in milliseconds for how long an idle connection should be kept alive in the pool. Defaults to 4 seconds (4,000 ms).
436
- - `cumulativeMaxIdleTimeout`: (Optional) The maximum time in milliseconds a connection can be idle. Defaults to 10 minutes (600,000 ms).
437
-
438
- **Example with Timeouts:**
439
-
440
- ```json
441
- {
442
- "nanocoder": {
443
- "providers": [
444
- {
445
- "name": "llama-cpp",
446
- "baseUrl": "http://localhost:8080/v1",
447
- "models": ["qwen3-coder:a3b", "deepseek-v3.1"],
448
- "requestTimeout": -1,
449
- "socketTimeout": -1,
450
- "connectionPool": {
451
- "idleTimeout": 30000,
452
- "cumulativeMaxIdleTimeout": 3600000
453
- }
454
- }
455
- ]
456
- }
457
- }
458
- ```
459
-
460
- **Troubleshooting Context Length Issues:**
461
-
462
- If you experience the model repeating tool calls or getting into loops (especially with multi-turn conversations), this is often caused by insufficient context length settings in your local AI provider:
463
-
464
- - **LM Studio**: Increase "Context Length" in Settings → Model Settings (recommended: 8192 or higher)
465
- - **Ollama**: Set context length with `OLLAMA_NUM_CTX=8192`
466
- - **llama.cpp**: Use `--ctx-size 8192` or higher when starting the server
467
- - **vLLM**: Set `--max-model-len 8192` when launching
468
-
469
- Tool-calling conversations require more context to track the history of tool calls and their results. If the context window is too small, the model may lose track of previous actions and repeat them indefinitely.
470
-
471
- ### Logging Configuration
43
+ ## Documentation
472
44
 
473
- Nanocoder now includes comprehensive structured logging with Pino, providing enterprise-grade logging capabilities including correlation tracking, performance monitoring, and security features.
45
+ Full documentation is available online at **[docs.nanocollective.org](https://docs.nanocollective.org/nanocoder/docs)** or in the [docs/](docs/) folder:
474
46
 
475
- **Logging Configuration Options:**
476
-
477
- ```bash
478
- # Environment Variables
479
- NANOCODER_LOG_LEVEL=debug # Log level (trace, debug, info, warn, error, fatal)
480
- NANOCODER_LOG_TO_FILE=true # Enable file logging
481
- NANOCODER_LOG_TO_CONSOLE=true # Enable console logging
482
- NANOCODER_LOG_DIR=/var/log/nanocoder # Log directory
483
- NANOCODER_CORRELATION_ENABLED=true # Enable correlation tracking
484
- ```
485
-
486
- **Features:**
487
- - Structured JSON logging with metadata support
488
- - Correlation tracking across components
489
- - Automatic PII detection and redaction
490
- - Performance monitoring and metrics
491
- - Production-ready file rotation and compression
492
-
493
- **Default Log File Locations:**
494
-
495
- When `NANOCODER_LOG_TO_FILE=true` is set, logs are stored in platform-specific locations:
496
-
497
- - **macOS**: `~/Library/Preferences/nanocoder/logs`
498
- - **Linux/Unix**: `~/.config/nanocoder/logs/nanocoder/`
499
- - **Windows**: `%APPDATA%\nanocoder\logs\`
500
-
501
- You can override the default location using `NANOCODER_LOG_DIR` environment variable.
502
-
503
- For complete documentation, see [Pino Logging Guide](docs/pino-logging.md).
504
-
505
- ### MCP (Model Context Protocol) Servers
506
-
507
- Nanocoder supports MCP servers to extend its capabilities with additional tools. Configure servers using `.mcp.json` files at project or global level.
508
-
509
- **Quick Start:**
510
-
511
- 1. Run `/setup-mcp` for an interactive wizard with templates
512
- 2. Or create `.mcp.json` in your project root:
513
-
514
- ```json
515
- {
516
- "mcpServers": {
517
- "filesystem": {
518
- "transport": "stdio",
519
- "command": "npx",
520
- "args": ["-y", "@modelcontextprotocol/server-filesystem", "./src"],
521
- "alwaysAllow": ["list_directory", "read_file"]
522
- },
523
- "github": {
524
- "transport": "stdio",
525
- "command": "npx",
526
- "args": ["-y", "@modelcontextprotocol/server-github"],
527
- "env": { "GITHUB_TOKEN": "$GITHUB_TOKEN" }
528
- }
529
- }
530
- }
531
- ```
532
-
533
- **Key Features:**
534
-
535
- - **Transport types**: `stdio` (local), `http`, `websocket` (remote)
536
- - **Auto-approve tools**: Use `alwaysAllow` to skip confirmation for trusted tools
537
- - **Environment variables**: Use `$VAR` or `${VAR:-default}` syntax
538
- - **Hierarchical config**: Project-level (`.mcp.json`) overrides global (`~/.config/nanocoder/.mcp.json`)
539
-
540
- **Commands:**
541
-
542
- - `/setup-mcp` - Interactive configuration wizard (supports `Ctrl+E` for manual editing)
543
- - `/mcp` - Show connected servers and their tools
544
-
545
- Popular MCP servers: Filesystem, GitHub, Brave Search, Context7, DeepWiki, and [many more](https://github.com/modelcontextprotocol/servers).
546
-
547
- > **Full documentation**: See the [MCP Configuration Guide](docs/mcp-configuration.md) for detailed setup, examples, and troubleshooting.
548
-
549
- ### User Preferences
550
-
551
- Nanocoder automatically saves your preferences to remember your choices across sessions.
552
-
553
- **Preferences File Locations:**
554
-
555
- Preferences follow the same location hierarchy as configuration files:
556
-
557
- 1. **Project-level**: `nanocoder-preferences.json` in your current working directory (overrides user-level)
558
- 2. **User-level**: Platform-specific application data directory:
559
- - **macOS**: `~/Library/Preferences/nanocoder/nanocoder-preferences.json`
560
- - **Linux/Unix**: `~/.config/nanocoder/nanocoder-preferences.json`
561
- - **Windows**: `%APPDATA%\nanocoder\nanocoder-preferences.json`
562
- 3. **Legacy**: `~/.nanocoder-preferences.json` (backward compatibility)
563
-
564
- **What gets saved automatically:**
565
-
566
- - **Last provider used**: The AI provider you last selected (by name from your configuration)
567
- - **Last model per provider**: Your preferred model for each provider
568
- - **Session continuity**: Automatically switches back to your preferred provider/model when restarting
569
- - **Last theme used**: The theme you last selected
570
-
571
- **Manual management:**
572
-
573
- - View current preferences: The file is human-readable JSON
574
- - Reset preferences: Delete any `nanocoder-preferences.json` to start fresh
575
-
576
- ### Application Data Directory
577
-
578
- Nanocoder stores internal application data (such as usage statistics) in a separate application data directory:
579
-
580
- - **macOS**: `~/Library/Application Support/nanocoder`
581
- - **Linux/Unix**: `$XDG_DATA_HOME/nanocoder` or `~/.local/share/nanocoder`
582
- - **Windows**: `%APPDATA%\nanocoder`
583
-
584
- You can override this directory using `NANOCODER_DATA_DIR`.
585
-
586
- ### Commands
587
-
588
- #### Built-in Commands
589
-
590
- - `/help` - Show available commands
591
- - `/init` - Initialize project with intelligent analysis, create AGENTS.md and configuration files. Use `/init --force` to regenerate AGENTS.md if it already exists.
592
- - `/setup-providers` - Interactive wizard for configuring AI providers with templates
593
- - `/setup-mcp` - Interactive wizard for configuring MCP servers with templates
594
- - `/clear` - Clear chat history
595
- - `/model` - Switch between available models
596
- - `/provider` - Switch between configured AI providers
597
- - `/status` - Display current status (CWD, provider, model, theme, available updates, AGENTS setup)
598
- - `/tasks` - Manage task list for tracking complex work (see [Task Management](#task-management) section)
599
- - `/model-database` - Browse coding models from OpenRouter (searchable, filterable by open/proprietary)
600
- - `/settings` - Interactive menu to access Nanocoder theme settings (theme, title-shape, nanocoder-shape) and commands
601
- - `/mcp` - Show connected MCP servers and their tools
602
- - `/custom-commands` - List all custom commands
603
- - `/checkpoint` - Save and restore conversation snapshots (see [Checkpointing](#checkpointing) section)
604
- - `/compact` - Compress message history to reduce context usage (see [Context Compression](docs/context-compression.md))
605
- - `/context-max` - Set maximum context length for the current session (useful for models not listed on models.dev)
606
- - `/exit` - Exit the application
607
- - `/export` - Export current session to markdown file
608
- - `/update` - Update Nanocoder to the latest version
609
- - `/usage` – Get current model context usage visually
610
- - `/lsp` – List connected LSP servers
611
- - `/schedule` – Schedule recurring AI tasks (see [Scheduled Tasks](#scheduled-tasks) section)
612
- - `/explorer` - Interactive file browser to navigate, preview, and select files for context
613
- - `/ide` - Connect to an IDE for live integration (e.g., VS Code diff previews)
614
- - `!command` - Execute bash commands directly without leaving Nanocoder (output becomes context for the LLM)
615
- - `@file` - Include file contents in messages automatically via fuzzy search as you type
616
-
617
- #### Checkpointing
618
-
619
- Nanocoder supports conversation checkpointing, allowing you to save snapshots of your coding sessions and restore them later. This is perfect for experimenting with different approaches or preserving important milestones.
620
-
621
- **Checkpoint Commands:**
622
-
623
- - `/checkpoint create [name]` - Create a checkpoint with optional custom name
624
-
625
- - Auto-generates timestamp-based name if not provided
626
- - Captures conversation history, modified files, and AI model configuration
627
- - Example: `/checkpoint create feature-auth-v1`
628
-
629
- - `/checkpoint list` - List all available checkpoints
630
-
631
- - Shows checkpoint name, creation time, message count, and files changed
632
- - Sorted by creation date (newest first)
633
-
634
- - `/checkpoint load [name]` - Restore files from a checkpoint
635
-
636
- - **Without name**: Shows interactive list to select checkpoint
637
- - **With name**: Directly loads the specified checkpoint
638
- - Prompts "Create backup before loading? (Y/n)" if current session has messages
639
- - Press Y (or Enter) to auto-backup, N to skip, Esc to cancel
640
- - Note: Conversation history restore requires restarting Nanocoder
641
- - Example: `/checkpoint load` (interactive) or `/checkpoint load feature-auth-v1`
642
-
643
- - `/checkpoint delete <name>` - Delete a checkpoint permanently
644
- - Removes checkpoint and all associated data
645
- - Example: `/checkpoint delete old-checkpoint`
646
-
647
- **What gets saved:**
648
-
649
- - Complete conversation history
650
- - Modified files with their content (detected via git)
651
- - Active provider and model configuration
652
- - Timestamp and metadata
653
-
654
- **Storage location:**
655
-
656
- - Checkpoints are stored in `.nanocoder/checkpoints/` in your project directory
657
- - Each project has its own checkpoints
658
- - Consider adding `.nanocoder/checkpoints` to your `.gitignore`
659
-
660
- **Example workflow:**
661
-
662
- ```bash
663
- # Create a checkpoint before trying a new approach
664
- /checkpoint create before-refactor
665
-
666
- # Make some experimental changes...
667
- # If things go wrong, restore the checkpoint
668
- /checkpoint load before-refactor
669
-
670
- # Or if things went well, create a new checkpoint
671
- /checkpoint create after-refactor
672
-
673
- # List all checkpoints to see your progress
674
- /checkpoint list
675
- ```
676
-
677
- #### Task Management
678
-
679
- Nanocoder provides a task management system for tracking complex multi-step work. Tasks persist in `.nanocoder/tasks.json` and are useful for both users and AI models to track progress on involved tasks.
680
-
681
- The LLM has access to task management tools (`create_task`, `list_tasks`, `update_task`, `delete_task`) and will automatically use them to track progress on complex work. You don't need to manually create tasks if you don't want to - the AI will manage them for you.
682
-
683
- **Task Commands:**
684
-
685
- - `/tasks` - Show all tasks with their status
686
- - `/tasks add <title>` - Add a new task (also works: `/tasks <title>`)
687
- - `/tasks remove <number>` - Remove a task by number (alias: `/tasks rm <number>`)
688
- - `/tasks clear` - Clear all tasks
689
-
690
- **Examples:**
691
-
692
- ```bash
693
- # View current tasks
694
- /tasks
695
-
696
- # Add a new task
697
- /tasks add Implement user authentication
698
-
699
- # Or simply type the task title
700
- /tasks Implement user authentication
701
-
702
- # Remove a task (note the number)
703
- /tasks remove 1
704
-
705
- # Clear all tasks
706
- /tasks clear
707
- ```
708
-
709
- **Storage:**
710
-
711
- - Tasks are stored in `.nanocoder/tasks.json` in your project directory
712
- - Tasks are automatically cleared when Nanocoder starts (to keep the task list fresh)
713
- - Tasks are also cleared when using the `/clear` command
714
- - Consider adding `.nanocoder/tasks.json` to your `.gitignore` if you want to exclude it from version control
715
-
716
- #### Scheduled Tasks
717
-
718
- Nanocoder supports scheduling recurring AI tasks using cron expressions. This is useful for automating routine coding tasks like dependency updates, code reviews, or daily standup summaries.
719
-
720
- **Quick Start:**
721
-
722
- ```bash
723
- # Create a new scheduled task file
724
- /schedule create deps-update
725
-
726
- # Add a schedule for it (every Monday at 9am)
727
- /schedule add "0 9 * * MON" deps-update
728
-
729
- # Start the scheduler
730
- /schedule start
731
- ```
732
-
733
- **Commands:**
734
-
735
- - `/schedule create <name>` - Create a new scheduled task file
736
- - `/schedule add "<cron>" <name>` - Add a schedule for a task (`.md` extension inferred)
737
- - `/schedule list` - Show all configured schedules
738
- - `/schedule remove <id>` - Remove a schedule by ID
739
- - `/schedule logs [id]` - Show execution logs
740
- - `/schedule start` - Enter scheduler mode to run scheduled tasks
741
-
742
- > **Full documentation**: See the [Scheduled Tasks Guide](docs/scheduler.md) for detailed usage, examples, and tips.
743
-
744
- #### File Explorer
745
-
746
- The `/explorer` command opens an interactive file browser for navigating your project, previewing files with syntax highlighting, and selecting multiple files to add as context.
747
-
748
- **Navigation:**
749
-
750
- | Key | Action |
751
- |-----|--------|
752
- | ↑/↓ | Navigate through files and directories |
753
- | Enter | Expand/collapse directory or preview file |
754
- | Space | Toggle file/directory selection |
755
- | / | Enter search mode (filters all files including nested) |
756
- | Backspace | Collapse current directory |
757
- | Esc | Exit explorer (selected files are added to input) |
758
-
759
- **Features:**
760
-
761
- - **Tree view**: Browse your project structure with expandable directories
762
- - **File preview**: View file contents with syntax highlighting before selecting
763
- - **Compressed indentation**: Preview displays content with compressed indentation (tabs/4-spaces become 2-spaces) for narrow terminals
764
- - **Multi-select**: Select multiple files to add as context at once
765
- - **Directory selection**: Press Space on a directory to select all files within it
766
- - **Search**: Press `/` to filter files by name across the entire tree
767
- - **Token estimation**: Shows estimated token count for selected files with warning for large selections (10k+ tokens)
768
- - **VS Code integration**: When running with `--vscode`, previewing a file also opens it in VS Code for full-featured viewing
769
-
770
- **Selection indicators:**
771
-
772
- - `✓` - File or directory fully selected
773
- - `◐` - Directory partially selected (some files within)
774
- - `✗` - File not selected (in preview mode)
775
- - `v` / `>` - Directory expanded / collapsed
776
-
777
- **Example workflow:**
778
-
779
- ```bash
780
- # Open the file explorer
781
- /explorer
782
-
783
- # Navigate to src/components, expand it
784
- # Select multiple component files with Space
785
- # Press Esc to add them to your input as @file mentions
786
- ```
787
-
788
- #### Custom Commands
789
-
790
- Nanocoder supports custom commands defined as markdown files in `.nanocoder/commands/`. Define reusable AI prompts with parameters, aliases, and auto-injection support, organized per project.
791
-
792
- ```bash
793
- # Create a command with AI assistance
794
- /commands create review-code
795
-
796
- # Or create the file manually in .nanocoder/commands/review-code.md
797
- ```
798
-
799
- **Example** (`.nanocoder/commands/test.md`):
800
-
801
- ```markdown
802
- ---
803
- description: Generate comprehensive unit tests
804
- aliases: [unittest, test-gen]
805
- parameters: [filename]
806
- ---
807
-
808
- Generate comprehensive unit tests for {{filename}}.
809
- ```
810
-
811
- **Usage**: `/test src/utils.ts`
812
-
813
- **Commands**: `/commands` (list), `/commands show <name>`, `/commands refresh`, `/commands create <name>`
814
-
815
- **Pre-installed**: `/test`, `/review`, `/refactor:dry`, `/refactor:solid`
816
-
817
- > **Full documentation**: See the [Custom Commands Guide](docs/custom-commands.md) for frontmatter reference, auto-injection, resources, namespaces, and more.
818
-
819
- ## Features
820
-
821
- ### Multi-Provider Support
822
-
823
- - **Universal OpenAI compatibility**: Works with any OpenAI-compatible API
824
- - **Local providers**: Ollama, LM Studio, vLLM, LocalAI, llama.cpp
825
- - **Cloud providers**: OpenRouter, OpenAI, and other hosted services
826
- - **Smart fallback**: Automatically switches to available providers if one fails
827
- - **Per-provider preferences**: Remembers your preferred model for each provider
828
- - **Dynamic configuration**: Add any provider with just a name and endpoint
829
-
830
- ### Advanced Tool System
831
-
832
- - **Built-in tools**: File operations, bash command execution
833
- - **MCP (Model Context Protocol) servers**: Extend capabilities with any MCP-compatible tool
834
- - **Dynamic tool loading**: Tools are loaded on-demand from configured MCP servers
835
- - **Tool approval**: Optional confirmation before executing potentially destructive operations
836
-
837
- ### Custom Command System
838
-
839
- - **Markdown-based commands**: Define reusable prompts in `.nanocoder/commands/`
840
- - **AI-assisted creation**: `/commands create <name>` scaffolds a command and helps you write it
841
- - **Template variables**: Use `{{parameter}}` syntax for dynamic content
842
- - **Auto-injection**: Commands with tags/triggers are automatically injected into context when relevant
843
- - **Namespace organization**: Organize commands in folders (e.g., `refactor/dry.md` becomes `/refactor:dry`)
844
- - **Rich metadata**: YAML frontmatter for descriptions, aliases, parameters, and [more](docs/custom-commands.md)
845
-
846
- ### Enhanced User Experience
847
-
848
- - **Smart autocomplete**: Tab completion for commands with real-time suggestions
849
- - **Colorized output**: Syntax highlighting and structured display
850
- - **Session persistence**: Maintains context and preferences across sessions
851
- - **Real-time streaming**: Live token-by-token streaming of AI responses
852
- - **Real-time indicators**: Shows token usage, timing, and processing status
853
- - **First-time directory security disclaimer**: Prompts on first run and stores a per-project trust decision to prevent accidental exposure of local code or secrets.
854
- - **Development modes**: Three modes to control tool execution behavior (toggle with Shift+Tab)
855
- - **Normal mode**: Standard tool confirmation flow - review potentially dangerous tool calls before execution
856
- - **Auto-accept mode**: Automatically accepts more tool calls without confirmation for faster workflows
857
- - **Plan mode**: AI suggests actions but doesn't execute tools - useful for planning and exploration
858
-
859
- ### Keyboard Shortcuts
860
-
861
- | Action | Shortcut | Notes |
862
- |--------|----------|-------|
863
- | Submit prompt | Enter | |
864
- | New line (multi-line input) | Ctrl+J | Most reliable across terminals |
865
- | New line (multi-line input) | Shift+Enter | Terminal-dependent |
866
- | New line (multi-line input) | Option/Alt+Enter | VS Code integrated terminal |
867
- | Toggle development mode | Shift+Tab | Cycles through normal/auto-accept/plan |
868
- | Cancel AI response | Esc | While AI is processing |
869
- | Clear input | Esc (twice) | Press Esc twice to clear current input |
870
- | History navigation | ↑/↓ | Navigate through prompt history |
871
-
872
- > **Note on multi-line input**: Terminal support for Shift+Enter / Option/Alt+Enter varies in terminals and operating systems. If one of these shortcuts doesn't work in your terminal, try and use Ctrl+J which sends a literal newline character and works more reliably across platforms and software.
873
-
874
- ### Developer Features
875
-
876
- - **TypeScript-first**: Full type safety and IntelliSense support
877
- - **Extensible architecture**: Plugin-style system for adding new capabilities
878
- - **Project-specific config**: Different settings per project via `agents.config.json`
879
- - **Error resilience**: Graceful handling of provider failures and network issues
880
-
881
- ## VS Code Extension
882
-
883
- Nanocoder includes a VS Code extension that provides live diff previews of file changes directly in your editor. When the AI suggests file modifications, you can see exactly what will change before approving.
884
-
885
- To get started, run Nanocoder with the `--vscode` flag:
886
-
887
- ```bash
888
- nanocoder --vscode
889
- ```
890
-
891
- For full documentation including installation options, configuration, and troubleshooting, see the [VS Code Extension Guide](docs/vscode-extension.md).
47
+ - **[Getting Started](docs/getting-started/index.md)** - Installation, setup, and first steps
48
+ - **[Configuration](docs/configuration/index.md)** - AI providers, MCP servers, preferences, logging, timeouts
49
+ - **[Features](docs/features/index.md)** - Custom commands, checkpointing, development modes, task management, and more
50
+ - **[Commands Reference](docs/commands.md)** - Complete list of built-in slash commands
51
+ - **[Keyboard Shortcuts](docs/keyboard-shortcuts.md)** - Full shortcut reference
52
+ - **[Community](docs/community.md)** - Contributing, Discord, and how to help
892
53
 
893
54
  ## Community
894
55
 
895
- We're a small community-led team building Nanocoder and would love your help! Whether you're interested in contributing code, documentation, or just being part of our community, there are several ways to get involved.
896
-
897
- **If you want to contribute to the code:**
898
-
899
- - Read our detailed [CONTRIBUTING.md](CONTRIBUTING.md) guide for information on development setup, coding standards, and how to submit your changes.
900
-
901
- **If you want to be part of our community or help with other aspects like design or marketing:**
902
-
903
- - Join our Discord server to connect with other users, ask questions, share ideas, and get help: [Join our Discord server](https://discord.gg/ktPDV6rekE)
904
-
905
- - Head to our GitHub issues or discussions to open and join current conversations with others in the community.
906
-
907
- **What does Nanocoder need help with?**
908
-
909
- Nanocoder could benefit from help all across the board. Such as:
910
-
911
- - Adding support for new AI providers
912
- - Improving tool functionality
913
- - Enhancing the user experience
914
- - Writing documentation
915
- - Reporting bugs or suggesting features
916
- - Marketing and getting the word out
917
- - Design and building more great software
56
+ The Nano Collective is a community collective building AI tooling for the community, not for profit. We'd love your help!
918
57
 
919
- All contributions and community participation are welcome!
58
+ - **Contributing**: See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines
59
+ - **Discord**: [Join our server](https://discord.gg/ktPDV6rekE) to connect with other users and contributors
60
+ - **GitHub**: Open issues or join discussions on our repository