@shareai-lab/kode 1.0.70 → 1.0.73

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 (278) hide show
  1. package/README.md +342 -75
  2. package/README.zh-CN.md +292 -0
  3. package/cli.js +62 -0
  4. package/package.json +49 -25
  5. package/scripts/postinstall.js +56 -0
  6. package/src/ProjectOnboarding.tsx +198 -0
  7. package/src/Tool.ts +82 -0
  8. package/src/commands/agents.tsx +3401 -0
  9. package/src/commands/approvedTools.ts +53 -0
  10. package/src/commands/bug.tsx +20 -0
  11. package/src/commands/clear.ts +43 -0
  12. package/src/commands/compact.ts +120 -0
  13. package/src/commands/config.tsx +19 -0
  14. package/src/commands/cost.ts +18 -0
  15. package/src/commands/ctx_viz.ts +209 -0
  16. package/src/commands/doctor.ts +24 -0
  17. package/src/commands/help.tsx +19 -0
  18. package/src/commands/init.ts +37 -0
  19. package/src/commands/listen.ts +42 -0
  20. package/src/commands/login.tsx +51 -0
  21. package/src/commands/logout.tsx +40 -0
  22. package/src/commands/mcp.ts +41 -0
  23. package/src/commands/model.tsx +40 -0
  24. package/src/commands/modelstatus.tsx +20 -0
  25. package/src/commands/onboarding.tsx +34 -0
  26. package/src/commands/pr_comments.ts +59 -0
  27. package/src/commands/refreshCommands.ts +54 -0
  28. package/src/commands/release-notes.ts +34 -0
  29. package/src/commands/resume.tsx +31 -0
  30. package/src/commands/review.ts +49 -0
  31. package/src/commands/terminalSetup.ts +221 -0
  32. package/src/commands.ts +139 -0
  33. package/src/components/ApproveApiKey.tsx +93 -0
  34. package/src/components/AsciiLogo.tsx +13 -0
  35. package/src/components/AutoUpdater.tsx +148 -0
  36. package/src/components/Bug.tsx +367 -0
  37. package/src/components/Config.tsx +293 -0
  38. package/src/components/ConsoleOAuthFlow.tsx +327 -0
  39. package/src/components/Cost.tsx +23 -0
  40. package/src/components/CostThresholdDialog.tsx +46 -0
  41. package/src/components/CustomSelect/option-map.ts +42 -0
  42. package/src/components/CustomSelect/select-option.tsx +78 -0
  43. package/src/components/CustomSelect/select.tsx +152 -0
  44. package/src/components/CustomSelect/theme.ts +45 -0
  45. package/src/components/CustomSelect/use-select-state.ts +414 -0
  46. package/src/components/CustomSelect/use-select.ts +35 -0
  47. package/src/components/FallbackToolUseRejectedMessage.tsx +15 -0
  48. package/src/components/FileEditToolUpdatedMessage.tsx +66 -0
  49. package/src/components/Help.tsx +215 -0
  50. package/src/components/HighlightedCode.tsx +33 -0
  51. package/src/components/InvalidConfigDialog.tsx +113 -0
  52. package/src/components/Link.tsx +32 -0
  53. package/src/components/LogSelector.tsx +86 -0
  54. package/src/components/Logo.tsx +145 -0
  55. package/src/components/MCPServerApprovalDialog.tsx +100 -0
  56. package/src/components/MCPServerDialogCopy.tsx +25 -0
  57. package/src/components/MCPServerMultiselectDialog.tsx +109 -0
  58. package/src/components/Message.tsx +221 -0
  59. package/src/components/MessageResponse.tsx +15 -0
  60. package/src/components/MessageSelector.tsx +211 -0
  61. package/src/components/ModeIndicator.tsx +88 -0
  62. package/src/components/ModelConfig.tsx +301 -0
  63. package/src/components/ModelListManager.tsx +227 -0
  64. package/src/components/ModelSelector.tsx +3386 -0
  65. package/src/components/ModelStatusDisplay.tsx +230 -0
  66. package/src/components/Onboarding.tsx +274 -0
  67. package/src/components/PressEnterToContinue.tsx +11 -0
  68. package/src/components/PromptInput.tsx +740 -0
  69. package/src/components/SentryErrorBoundary.ts +33 -0
  70. package/src/components/Spinner.tsx +129 -0
  71. package/src/components/StickerRequestForm.tsx +16 -0
  72. package/src/components/StructuredDiff.tsx +191 -0
  73. package/src/components/TextInput.tsx +259 -0
  74. package/src/components/TodoItem.tsx +11 -0
  75. package/src/components/TokenWarning.tsx +31 -0
  76. package/src/components/ToolUseLoader.tsx +40 -0
  77. package/src/components/TrustDialog.tsx +106 -0
  78. package/src/components/binary-feedback/BinaryFeedback.tsx +63 -0
  79. package/src/components/binary-feedback/BinaryFeedbackOption.tsx +111 -0
  80. package/src/components/binary-feedback/BinaryFeedbackView.tsx +172 -0
  81. package/src/components/binary-feedback/utils.ts +220 -0
  82. package/src/components/messages/AssistantBashOutputMessage.tsx +22 -0
  83. package/src/components/messages/AssistantLocalCommandOutputMessage.tsx +49 -0
  84. package/src/components/messages/AssistantRedactedThinkingMessage.tsx +19 -0
  85. package/src/components/messages/AssistantTextMessage.tsx +144 -0
  86. package/src/components/messages/AssistantThinkingMessage.tsx +40 -0
  87. package/src/components/messages/AssistantToolUseMessage.tsx +133 -0
  88. package/src/components/messages/TaskProgressMessage.tsx +32 -0
  89. package/src/components/messages/TaskToolMessage.tsx +58 -0
  90. package/src/components/messages/UserBashInputMessage.tsx +28 -0
  91. package/src/components/messages/UserCommandMessage.tsx +30 -0
  92. package/src/components/messages/UserKodingInputMessage.tsx +28 -0
  93. package/src/components/messages/UserPromptMessage.tsx +35 -0
  94. package/src/components/messages/UserTextMessage.tsx +39 -0
  95. package/src/components/messages/UserToolResultMessage/UserToolCanceledMessage.tsx +12 -0
  96. package/src/components/messages/UserToolResultMessage/UserToolErrorMessage.tsx +36 -0
  97. package/src/components/messages/UserToolResultMessage/UserToolRejectMessage.tsx +31 -0
  98. package/src/components/messages/UserToolResultMessage/UserToolResultMessage.tsx +57 -0
  99. package/src/components/messages/UserToolResultMessage/UserToolSuccessMessage.tsx +35 -0
  100. package/src/components/messages/UserToolResultMessage/utils.tsx +56 -0
  101. package/src/components/permissions/BashPermissionRequest/BashPermissionRequest.tsx +121 -0
  102. package/src/components/permissions/FallbackPermissionRequest.tsx +153 -0
  103. package/src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx +182 -0
  104. package/src/components/permissions/FileEditPermissionRequest/FileEditToolDiff.tsx +77 -0
  105. package/src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx +164 -0
  106. package/src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.tsx +83 -0
  107. package/src/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.tsx +240 -0
  108. package/src/components/permissions/PermissionRequest.tsx +101 -0
  109. package/src/components/permissions/PermissionRequestTitle.tsx +69 -0
  110. package/src/components/permissions/hooks.ts +44 -0
  111. package/src/components/permissions/toolUseOptions.ts +59 -0
  112. package/src/components/permissions/utils.ts +23 -0
  113. package/src/constants/betas.ts +5 -0
  114. package/src/constants/claude-asterisk-ascii-art.tsx +238 -0
  115. package/src/constants/figures.ts +4 -0
  116. package/src/constants/keys.ts +3 -0
  117. package/src/constants/macros.ts +8 -0
  118. package/src/constants/modelCapabilities.ts +179 -0
  119. package/src/constants/models.ts +1025 -0
  120. package/src/constants/oauth.ts +18 -0
  121. package/src/constants/product.ts +17 -0
  122. package/src/constants/prompts.ts +177 -0
  123. package/src/constants/releaseNotes.ts +7 -0
  124. package/src/context/PermissionContext.tsx +149 -0
  125. package/src/context.ts +278 -0
  126. package/src/cost-tracker.ts +84 -0
  127. package/src/entrypoints/cli.tsx +1518 -0
  128. package/src/entrypoints/mcp.ts +176 -0
  129. package/src/history.ts +25 -0
  130. package/src/hooks/useApiKeyVerification.ts +59 -0
  131. package/src/hooks/useArrowKeyHistory.ts +55 -0
  132. package/src/hooks/useCanUseTool.ts +138 -0
  133. package/src/hooks/useCancelRequest.ts +39 -0
  134. package/src/hooks/useDoublePress.ts +42 -0
  135. package/src/hooks/useExitOnCtrlCD.ts +31 -0
  136. package/src/hooks/useInterval.ts +25 -0
  137. package/src/hooks/useLogMessages.ts +16 -0
  138. package/src/hooks/useLogStartupTime.ts +12 -0
  139. package/src/hooks/useNotifyAfterTimeout.ts +65 -0
  140. package/src/hooks/usePermissionRequestLogging.ts +44 -0
  141. package/src/hooks/useTerminalSize.ts +49 -0
  142. package/src/hooks/useTextInput.ts +318 -0
  143. package/src/hooks/useUnifiedCompletion.ts +1404 -0
  144. package/src/messages.ts +38 -0
  145. package/src/permissions.ts +268 -0
  146. package/src/query.ts +707 -0
  147. package/src/screens/ConfigureNpmPrefix.tsx +197 -0
  148. package/src/screens/Doctor.tsx +219 -0
  149. package/src/screens/LogList.tsx +68 -0
  150. package/src/screens/REPL.tsx +798 -0
  151. package/src/screens/ResumeConversation.tsx +68 -0
  152. package/src/services/adapters/base.ts +38 -0
  153. package/src/services/adapters/chatCompletions.ts +90 -0
  154. package/src/services/adapters/responsesAPI.ts +170 -0
  155. package/src/services/browserMocks.ts +66 -0
  156. package/src/services/claude.ts +2083 -0
  157. package/src/services/customCommands.ts +704 -0
  158. package/src/services/fileFreshness.ts +377 -0
  159. package/src/services/gpt5ConnectionTest.ts +340 -0
  160. package/src/services/mcpClient.ts +564 -0
  161. package/src/services/mcpServerApproval.tsx +50 -0
  162. package/src/services/mentionProcessor.ts +273 -0
  163. package/src/services/modelAdapterFactory.ts +69 -0
  164. package/src/services/notifier.ts +40 -0
  165. package/src/services/oauth.ts +357 -0
  166. package/src/services/openai.ts +1305 -0
  167. package/src/services/responseStateManager.ts +90 -0
  168. package/src/services/sentry.ts +3 -0
  169. package/src/services/statsig.ts +171 -0
  170. package/src/services/statsigStorage.ts +86 -0
  171. package/src/services/systemReminder.ts +507 -0
  172. package/src/services/vcr.ts +161 -0
  173. package/src/test/testAdapters.ts +96 -0
  174. package/src/tools/ArchitectTool/ArchitectTool.tsx +122 -0
  175. package/src/tools/ArchitectTool/prompt.ts +15 -0
  176. package/src/tools/AskExpertModelTool/AskExpertModelTool.tsx +569 -0
  177. package/src/tools/BashTool/BashTool.tsx +243 -0
  178. package/src/tools/BashTool/BashToolResultMessage.tsx +38 -0
  179. package/src/tools/BashTool/OutputLine.tsx +49 -0
  180. package/src/tools/BashTool/prompt.ts +174 -0
  181. package/src/tools/BashTool/utils.ts +56 -0
  182. package/src/tools/FileEditTool/FileEditTool.tsx +315 -0
  183. package/src/tools/FileEditTool/prompt.ts +51 -0
  184. package/src/tools/FileEditTool/utils.ts +58 -0
  185. package/src/tools/FileReadTool/FileReadTool.tsx +404 -0
  186. package/src/tools/FileReadTool/prompt.ts +7 -0
  187. package/src/tools/FileWriteTool/FileWriteTool.tsx +297 -0
  188. package/src/tools/FileWriteTool/prompt.ts +10 -0
  189. package/src/tools/GlobTool/GlobTool.tsx +119 -0
  190. package/src/tools/GlobTool/prompt.ts +8 -0
  191. package/src/tools/GrepTool/GrepTool.tsx +147 -0
  192. package/src/tools/GrepTool/prompt.ts +11 -0
  193. package/src/tools/MCPTool/MCPTool.tsx +107 -0
  194. package/src/tools/MCPTool/prompt.ts +3 -0
  195. package/src/tools/MemoryReadTool/MemoryReadTool.tsx +127 -0
  196. package/src/tools/MemoryReadTool/prompt.ts +3 -0
  197. package/src/tools/MemoryWriteTool/MemoryWriteTool.tsx +89 -0
  198. package/src/tools/MemoryWriteTool/prompt.ts +3 -0
  199. package/src/tools/MultiEditTool/MultiEditTool.tsx +366 -0
  200. package/src/tools/MultiEditTool/prompt.ts +45 -0
  201. package/src/tools/NotebookEditTool/NotebookEditTool.tsx +298 -0
  202. package/src/tools/NotebookEditTool/prompt.ts +3 -0
  203. package/src/tools/NotebookReadTool/NotebookReadTool.tsx +258 -0
  204. package/src/tools/NotebookReadTool/prompt.ts +3 -0
  205. package/src/tools/StickerRequestTool/StickerRequestTool.tsx +93 -0
  206. package/src/tools/StickerRequestTool/prompt.ts +19 -0
  207. package/src/tools/TaskTool/TaskTool.tsx +466 -0
  208. package/src/tools/TaskTool/constants.ts +1 -0
  209. package/src/tools/TaskTool/prompt.ts +92 -0
  210. package/src/tools/ThinkTool/ThinkTool.tsx +54 -0
  211. package/src/tools/ThinkTool/prompt.ts +12 -0
  212. package/src/tools/TodoWriteTool/TodoWriteTool.tsx +290 -0
  213. package/src/tools/TodoWriteTool/prompt.ts +63 -0
  214. package/src/tools/lsTool/lsTool.tsx +272 -0
  215. package/src/tools/lsTool/prompt.ts +2 -0
  216. package/src/tools.ts +63 -0
  217. package/src/types/PermissionMode.ts +120 -0
  218. package/src/types/RequestContext.ts +72 -0
  219. package/src/types/conversation.ts +51 -0
  220. package/src/types/logs.ts +58 -0
  221. package/src/types/modelCapabilities.ts +64 -0
  222. package/src/types/notebook.ts +87 -0
  223. package/src/utils/Cursor.ts +436 -0
  224. package/src/utils/PersistentShell.ts +373 -0
  225. package/src/utils/advancedFuzzyMatcher.ts +290 -0
  226. package/src/utils/agentLoader.ts +284 -0
  227. package/src/utils/agentStorage.ts +97 -0
  228. package/src/utils/array.ts +3 -0
  229. package/src/utils/ask.tsx +99 -0
  230. package/src/utils/auth.ts +13 -0
  231. package/src/utils/autoCompactCore.ts +223 -0
  232. package/src/utils/autoUpdater.ts +318 -0
  233. package/src/utils/betas.ts +20 -0
  234. package/src/utils/browser.ts +14 -0
  235. package/src/utils/cleanup.ts +72 -0
  236. package/src/utils/commands.ts +261 -0
  237. package/src/utils/commonUnixCommands.ts +161 -0
  238. package/src/utils/config.ts +942 -0
  239. package/src/utils/conversationRecovery.ts +55 -0
  240. package/src/utils/debugLogger.ts +1123 -0
  241. package/src/utils/diff.ts +42 -0
  242. package/src/utils/env.ts +57 -0
  243. package/src/utils/errors.ts +21 -0
  244. package/src/utils/exampleCommands.ts +109 -0
  245. package/src/utils/execFileNoThrow.ts +51 -0
  246. package/src/utils/expertChatStorage.ts +136 -0
  247. package/src/utils/file.ts +402 -0
  248. package/src/utils/fileRecoveryCore.ts +71 -0
  249. package/src/utils/format.tsx +44 -0
  250. package/src/utils/fuzzyMatcher.ts +328 -0
  251. package/src/utils/generators.ts +62 -0
  252. package/src/utils/git.ts +92 -0
  253. package/src/utils/globalLogger.ts +77 -0
  254. package/src/utils/http.ts +10 -0
  255. package/src/utils/imagePaste.ts +38 -0
  256. package/src/utils/json.ts +13 -0
  257. package/src/utils/log.ts +382 -0
  258. package/src/utils/markdown.ts +213 -0
  259. package/src/utils/messageContextManager.ts +289 -0
  260. package/src/utils/messages.tsx +939 -0
  261. package/src/utils/model.ts +836 -0
  262. package/src/utils/permissions/filesystem.ts +118 -0
  263. package/src/utils/responseState.ts +23 -0
  264. package/src/utils/ripgrep.ts +167 -0
  265. package/src/utils/secureFile.ts +559 -0
  266. package/src/utils/sessionState.ts +49 -0
  267. package/src/utils/state.ts +25 -0
  268. package/src/utils/style.ts +29 -0
  269. package/src/utils/terminal.ts +50 -0
  270. package/src/utils/theme.ts +133 -0
  271. package/src/utils/thinking.ts +144 -0
  272. package/src/utils/todoStorage.ts +431 -0
  273. package/src/utils/tokens.ts +43 -0
  274. package/src/utils/toolExecutionController.ts +163 -0
  275. package/src/utils/unaryLogging.ts +26 -0
  276. package/src/utils/user.ts +37 -0
  277. package/src/utils/validate.ts +165 -0
  278. package/cli.mjs +0 -1803
package/README.md CHANGED
@@ -1,120 +1,387 @@
1
- # Kode With Agent
1
+ # Kode - AI Assistant for Your Terminal
2
2
 
3
- You can see this as open-cc for everyone, agent-system design is in [./system-design.md](./system-design.md)
3
+ [![npm version](https://badge.fury.io/js/@shareai-lab%2Fkode.svg)](https://www.npmjs.com/package/@shareai-lab/kode)
4
+ [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
5
+ [![AGENTS.md](https://img.shields.io/badge/AGENTS.md-Compatible-brightgreen)](https://agents.md)
6
+
7
+ [中文文档](README.zh-CN.md) | [Contributing](CONTRIBUTING.md) | [Documentation](docs/)
8
+
9
+ ## 🤝 AGENTS.md Standard Support
10
+
11
+ **Kode proudly supports the [AGENTS.md standard protocol](https://agents.md) initiated by OpenAI** - a simple, open format for guiding programming agents that's used by 20k+ open source projects.
12
+
13
+ ### Full Compatibility with Multiple Standards
14
+
15
+ - ✅ **AGENTS.md** - Native support for the OpenAI-initiated standard format
16
+ - ✅ **CLAUDE.md** - Full backward compatibility with Claude Code configurations
17
+ - ✅ **Subagent System** - Advanced agent delegation and task orchestration
18
+ - ✅ **Cross-platform** - Works with 20+ AI models and providers
19
+
20
+ Use `# Your documentation request` to generate and maintain your AGENTS.md file automatically, while maintaining full compatibility with existing Claude Code workflows.
21
+
22
+ ## Overview
23
+
24
+ Kode is a powerful AI assistant that lives in your terminal. It can understand your codebase, edit files, run commands, and handle entire workflows for you.
4
25
 
5
26
  ## Features
6
27
 
7
- - 🛠️ **Code Analysis & Fixes** - Analyzes and improves your codebase
8
- - 📖 **Code Explanation** - Explains complex functions and logic
9
- - 🧪 **Test Execution** - Runs tests and shell commands
10
- - 🔧 **Workflow Automation** - Handles entire development workflows
11
- - 🤖 **Multi-Model Support** - Works with any OpenAI-compatible API
12
- - 🎯 **Many Built-in Tools** - File operations, shell execution, notebooks, and more
13
- - 💾 **Smart Checkpoints** - Intelligent project state management and recovery
14
- - 🌿 **Worktree Workflows** - Isolated development environments for features
28
+ ### Core Capabilities
29
+ - 🤖 **AI-Powered Assistance** - Uses advanced AI models to understand and respond to your requests
30
+ - 🔄 **Multi-Model Collaboration** - Flexibly switch and combine multiple AI models to leverage their unique strengths
31
+ - 🦜 **Expert Model Consultation** - Use `@ask-model-name` to consult specific AI models for specialized analysis
32
+ - 👤 **Intelligent Agent System** - Use `@run-agent-name` to delegate tasks to specialized subagents
33
+ - 📝 **Code Editing** - Directly edit files with intelligent suggestions and improvements
34
+ - 🔍 **Codebase Understanding** - Analyzes your project structure and code relationships
35
+ - 🚀 **Command Execution** - Run shell commands and see results in real-time
36
+ - 🛠️ **Workflow Automation** - Handle complex development tasks with simple prompts
37
+
38
+ ### 🎯 Advanced Intelligent Completion System
39
+ Our state-of-the-art completion system provides unparalleled coding assistance:
40
+
41
+ #### Smart Fuzzy Matching
42
+ - **Hyphen-Aware Matching** - Type `dao` to match `run-agent-dao-qi-harmony-designer`
43
+ - **Abbreviation Support** - `dq` matches `dao-qi`, `nde` matches `node`
44
+ - **Numeric Suffix Handling** - `py3` intelligently matches `python3`
45
+ - **Multi-Algorithm Fusion** - Combines 7+ matching algorithms for best results
46
+
47
+ #### Intelligent Context Detection
48
+ - **No @ Required** - Type `gp5` directly to match `@ask-gpt-5`
49
+ - **Auto-Prefix Addition** - Tab/Enter automatically adds `@` for agents and models
50
+ - **Mixed Completion** - Seamlessly switch between commands, files, agents, and models
51
+ - **Smart Prioritization** - Results ranked by relevance and usage frequency
52
+
53
+ #### Unix Command Optimization
54
+ - **500+ Common Commands** - Curated database of frequently used Unix/Linux commands
55
+ - **System Intersection** - Only shows commands that actually exist on your system
56
+ - **Priority Scoring** - Common commands appear first (git, npm, docker, etc.)
57
+ - **Real-time Loading** - Dynamic command discovery from system PATH
58
+
59
+ ### User Experience
60
+ - 🎨 **Interactive UI** - Beautiful terminal interface with syntax highlighting
61
+ - 🔌 **Tool System** - Extensible architecture with specialized tools for different tasks
62
+ - 💾 **Context Management** - Smart context handling to maintain conversation continuity
63
+ - 📋 **AGENTS.md Integration** - Use `# documentation requests` to auto-generate and maintain project documentation
15
64
 
16
65
  ## Installation
17
66
 
18
67
  ```bash
19
- # Install with npm
20
68
  npm install -g @shareai-lab/kode
69
+ ```
70
+
71
+ After installation, you can use any of these commands:
72
+ - `kode` - Primary command
73
+ - `kwa` - Kode With Agent (alternative)
74
+ - `kd` - Ultra-short alias
75
+
76
+ ## Usage
77
+
78
+ ### Interactive Mode
79
+ Start an interactive session:
80
+ ```bash
81
+ kode
82
+ # or
83
+ kwa
84
+ # or
85
+ kd
86
+ ```
87
+
88
+ ### Non-Interactive Mode
89
+ Get a quick response:
90
+ ```bash
91
+ kode -p "explain this function" main.js
92
+ # or
93
+ kwa -p "explain this function" main.js
94
+ ```
95
+
96
+ ### Using the @ Mention System
21
97
 
22
- # Install with pnpm
23
- pnpm install -g @shareai-lab/kode
98
+ Kode supports a powerful @ mention system for intelligent completions:
24
99
 
25
- # Install with yarn
26
- yarn global add @shareai-lab/kode
100
+ #### 🦜 Expert Model Consultation
101
+ ```bash
102
+ # Consult specific AI models for expert opinions
103
+ @ask-claude-sonnet-4 How should I optimize this React component for performance?
104
+ @ask-gpt-5 What are the security implications of this authentication method?
105
+ @ask-o1-preview Analyze the complexity of this algorithm
106
+ ```
107
+
108
+ #### 👤 Specialized Agent Delegation
109
+ ```bash
110
+ # Delegate tasks to specialized subagents
111
+ @run-agent-simplicity-auditor Review this code for over-engineering
112
+ @run-agent-architect Design a microservices architecture for this system
113
+ @run-agent-test-writer Create comprehensive tests for these modules
27
114
  ```
28
115
 
29
- ## Quick Start
116
+ #### 📁 Smart File References
117
+ ```bash
118
+ # Reference files and directories with auto-completion
119
+ @src/components/Button.tsx
120
+ @docs/api-reference.md
121
+ @.env.example
122
+ ```
123
+
124
+ The @ mention system provides intelligent completions as you type, showing available models, agents, and files.
125
+
126
+ ### AGENTS.md Documentation Mode
127
+
128
+ Use the `#` prefix to generate and maintain your AGENTS.md documentation:
129
+
130
+ ```bash
131
+ # Generate setup instructions
132
+ # How do I set up the development environment?
133
+
134
+ # Create testing documentation
135
+ # What are the testing procedures for this project?
136
+
137
+ # Document deployment process
138
+ # Explain the deployment pipeline and requirements
139
+ ```
140
+
141
+ This mode automatically formats responses as structured documentation and appends them to your AGENTS.md file.
142
+
143
+ ### Docker Usage
144
+
145
+ #### Alternative: Build from local source
146
+
147
+ ```bash
148
+ # Clone the repository
149
+ git clone https://github.com/shareAI-lab/Kode.git
150
+ cd Kode
151
+
152
+ # Build the image locally
153
+ docker build --no-cache -t kode .
154
+
155
+ # Run in your project directory
156
+ cd your-project
157
+ docker run -it --rm \
158
+ -v $(pwd):/workspace \
159
+ -v ~/.kode:/root/.kode \
160
+ -v ~/.kode.json:/root/.kode.json \
161
+ -w /workspace \
162
+ kode
163
+ ```
164
+
165
+ #### Docker Configuration Details
166
+
167
+ The Docker setup includes:
168
+
169
+ - **Volume Mounts**:
170
+ - `$(pwd):/workspace` - Mounts your current project directory
171
+ - `~/.kode:/root/.kode` - Preserves your kode configuration directory between runs
172
+ - `~/.kode.json:/root/.kode.json` - Preserves your kode global configuration file between runs
173
+
174
+ - **Working Directory**: Set to `/workspace` inside the container
175
+
176
+ - **Interactive Mode**: Uses `-it` flags for interactive terminal access
177
+
178
+ - **Cleanup**: `--rm` flag removes the container after exit
179
+
180
+ **Note**: Kode uses both `~/.kode` directory for additional data (like memory files) and `~/.kode.json` file for global configuration.
181
+
182
+ The first time you run the Docker command, it will build the image. Subsequent runs will use the cached image for faster startup.
183
+
184
+ You can use the onboarding to set up the model, or `/model`.
185
+ If you don't see the models you want on the list, you can manually set them in `/config`
186
+ As long as you have an openai-like endpoint, it should work.
30
187
 
31
- 1. **Model Setup**: Use the onboarding flow or `/model` command to configure your AI provider
32
- 2. **Custom Models**: If your model isn't listed, manually configure it via `/config`
33
- 3. **OpenAI-Compatible**: Works with any OpenAI-style endpoint (Ollama, OpenRouter, etc.)
188
+ ### Commands
34
189
 
35
- ## MCP Server Integration
190
+ - `/help` - Show available commands
191
+ - `/model` - Change AI model settings
192
+ - `/config` - Open configuration panel
193
+ - `/cost` - Show token usage and costs
194
+ - `/clear` - Clear conversation history
195
+ - `/init` - Initialize project context
36
196
 
37
- Use Agent Kode as a Model Context Protocol server with Claude Desktop:
197
+ ## Multi-Model Intelligent Collaboration
38
198
 
39
- 1. Find the full path: `which kode`
40
- 2. Add to Claude Desktop config:
41
- ```json
199
+ Unlike official Claude which supports only a single model, Kode implements **true multi-model collaboration**, allowing you to fully leverage the unique strengths of different AI models.
200
+
201
+ ### 🏗️ Core Technical Architecture
202
+
203
+ #### 1. **ModelManager Multi-Model Manager**
204
+ We designed a unified `ModelManager` system that supports:
205
+ - **Model Profiles**: Each model has an independent configuration file containing API endpoints, authentication, context window size, cost parameters, etc.
206
+ - **Model Pointers**: Users can configure default models for different purposes in the `/model` command:
207
+ - `main`: Default model for main Agent
208
+ - `task`: Default model for SubAgent
209
+ - `reasoning`: Reserved for future ThinkTool usage
210
+ - `quick`: Fast model for simple NLP tasks (security identification, title generation, etc.)
211
+ - **Dynamic Model Switching**: Support runtime model switching without restarting sessions, maintaining context continuity
212
+
213
+ #### 2. **TaskTool Intelligent Task Distribution**
214
+ Our specially designed `TaskTool` (Architect tool) implements:
215
+ - **Subagent Mechanism**: Can launch multiple sub-agents to process tasks in parallel
216
+ - **Model Parameter Passing**: Users can specify which model SubAgents should use in their requests
217
+ - **Default Model Configuration**: SubAgents use the model configured by the `task` pointer by default
218
+
219
+ #### 3. **AskExpertModel Expert Consultation Tool**
220
+ We specially designed the `AskExpertModel` tool:
221
+ - **Expert Model Invocation**: Allows temporarily calling specific expert models to solve difficult problems during conversations
222
+ - **Model Isolation Execution**: Expert model responses are processed independently without affecting the main conversation flow
223
+ - **Knowledge Integration**: Integrates expert model insights into the current task
224
+
225
+ #### 🎯 Flexible Model Switching
226
+ - **Tab Key Quick Switch**: Press Tab in the input box to quickly switch the model for the current conversation
227
+ - **`/model` Command**: Use `/model` command to configure and manage multiple model profiles, set default models for different purposes
228
+ - **User Control**: Users can specify specific models for task processing at any time
229
+
230
+ #### 🔄 Intelligent Work Allocation Strategy
231
+
232
+ **Architecture Design Phase**
233
+ - Use **o3 model** or **GPT-5 model** to explore system architecture and formulate sharp and clear technical solutions
234
+ - These models excel in abstract thinking and system design
235
+
236
+ **Solution Refinement Phase**
237
+ - Use **gemini model** to deeply explore production environment design details
238
+ - Leverage its deep accumulation in practical engineering and balanced reasoning capabilities
239
+
240
+ **Code Implementation Phase**
241
+ - Use **Qwen Coder model**, **Kimi k2 model**, **GLM-4.5 model**, or **Claude Sonnet 4 model** for specific code writing
242
+ - These models have strong performance in code generation, file editing, and engineering implementation
243
+ - Support parallel processing of multiple coding tasks through subagents
244
+
245
+ **Problem Solving**
246
+ - When encountering complex problems, consult expert models like **o3 model**, **Claude Opus 4.1 model**, or **Grok 4 model**
247
+ - Obtain deep technical insights and innovative solutions
248
+
249
+ #### 💡 Practical Application Scenarios
250
+
251
+ ```bash
252
+ # Example 1: Architecture Design
253
+ "Use o3 model to help me design a high-concurrency message queue system architecture"
254
+
255
+ # Example 2: Multi-Model Collaboration
256
+ "First use GPT-5 model to analyze the root cause of this performance issue, then use Claude Sonnet 4 model to write optimization code"
257
+
258
+ # Example 3: Parallel Task Processing
259
+ "Use Qwen Coder model as subagent to refactor these three modules simultaneously"
260
+
261
+ # Example 4: Expert Consultation
262
+ "This memory leak issue is tricky, ask Claude Opus 4.1 model separately for solutions"
263
+
264
+ # Example 5: Code Review
265
+ "Have Kimi k2 model review the code quality of this PR"
266
+
267
+ # Example 6: Complex Reasoning
268
+ "Use Grok 4 model to help me derive the time complexity of this algorithm"
269
+
270
+ # Example 7: Solution Design
271
+ "Have GLM-4.5 model design a microservice decomposition plan"
272
+ ```
273
+
274
+ ### 🛠️ Key Implementation Mechanisms
275
+
276
+ #### **Configuration System**
277
+ ```typescript
278
+ // Example of multi-model configuration support
42
279
  {
43
- "mcpServers": {
44
- "agent-kode": {
45
- "command": "/path/to/kode",
46
- "args": ["mcp", "serve"]
47
- }
280
+ "modelProfiles": {
281
+ "o3": { "provider": "openai", "model": "o3", "apiKey": "..." },
282
+ "claude4": { "provider": "anthropic", "model": "claude-sonnet-4", "apiKey": "..." },
283
+ "qwen": { "provider": "alibaba", "model": "qwen-coder", "apiKey": "..." }
284
+ },
285
+ "modelPointers": {
286
+ "main": "claude4", // Main conversation model
287
+ "task": "qwen", // Task execution model
288
+ "reasoning": "o3", // Reasoning model
289
+ "quick": "glm-4.5" // Quick response model
48
290
  }
49
291
  }
50
292
  ```
51
293
 
52
- ## Development
294
+ #### **Cost Tracking System**
295
+ - **Usage Statistics**: Use `/cost` command to view token usage and costs for each model
296
+ - **Multi-Model Cost Comparison**: Track usage costs of different models in real-time
297
+ - **History Records**: Save cost data for each session
53
298
 
54
- ```bash
55
- # Install dependencies
56
- pnpm install
299
+ #### **Context Manager**
300
+ - **Context Inheritance**: Maintain conversation continuity when switching models
301
+ - **Context Window Adaptation**: Automatically adjust based on different models' context window sizes
302
+ - **Session State Preservation**: Ensure information consistency during multi-model collaboration
57
303
 
58
- # Run in development mode
59
- pnpm run dev
304
+ ### 🚀 Advantages of Multi-Model Collaboration
60
305
 
61
- # Build for production
62
- pnpm run build
306
+ 1. **Maximized Efficiency**: Each task is handled by the most suitable model
307
+ 2. **Cost Optimization**: Use lightweight models for simple tasks, powerful models for complex tasks
308
+ 3. **Parallel Processing**: Multiple models can work on different subtasks simultaneously
309
+ 4. **Flexible Switching**: Switch models based on task requirements without restarting sessions
310
+ 5. **Leveraging Strengths**: Combine advantages of different models for optimal overall results
63
311
 
64
- # Debug with verbose logging
65
- NODE_ENV=development pnpm run dev --verbose --debug
66
- ```
312
+ ### 📊 Comparison with Official Implementation
67
313
 
68
- ## Architecture
314
+ | Feature | Kode | Official Claude |
315
+ |---------|------|-----------------|
316
+ | Number of Supported Models | Unlimited, configurable for any model | Only supports single Claude model |
317
+ | Model Switching | ✅ Tab key quick switch | ❌ Requires session restart |
318
+ | Parallel Processing | ✅ Multiple SubAgents work in parallel | ❌ Single-threaded processing |
319
+ | Cost Tracking | ✅ Separate statistics for multiple models | ❌ Single model cost |
320
+ | Task Model Configuration | ✅ Different default models for different purposes | ❌ Same model for all tasks |
321
+ | Expert Consultation | ✅ AskExpertModel tool | ❌ Not supported |
69
322
 
70
- - **React/Ink** - Terminal UI framework
71
- - **18 Core Tools** - File operations, shell execution, AI workflows, checkpoints
72
- - **Multi-Provider** - Anthropic Claude, OpenAI, custom endpoints
73
- - **TypeScript** - Full type safety throughout
74
- - **MCP Compatible** - Model Context Protocol integration
75
- - **Smart Workflows** - Checkpoint system and worktree management
323
+ This multi-model collaboration capability makes Kode a true **AI Development Workbench**, not just a single AI assistant.
76
324
 
77
- ## Advanced Workflows
325
+ ## Development
78
326
 
79
- Agent Kode provides sophisticated development workflow management:
327
+ Kode is built with modern tools and requires [Bun](https://bun.sh) for development.
80
328
 
81
- ### 🎯 Checkpoint System
82
- Intelligent project state management with automatic analysis and recovery:
83
- - **`/checkpoint-save`** - Smart analysis and state preservation
84
- - **`/checkpoint-restore`** - Natural language version recovery
329
+ ### Install Bun
85
330
 
86
- ### 🌿 Worktree Development
87
- Isolated development environments for feature work:
88
- - **`/worktree-create`** - Task-driven environment creation
89
- - **`/worktree-review`** - Comprehensive code quality assessment
90
- - **`/worktree-merge`** - Safe integration with quality gates
331
+ ```bash
332
+ # macOS/Linux
333
+ curl -fsSL https://bun.sh/install | bash
91
334
 
92
- 📚 **[Complete Workflow Documentation](docs/commands/README.md)**
335
+ # Windows
336
+ powershell -c "irm bun.sh/install.ps1 | iex"
337
+ ```
93
338
 
94
- ## Bug Reports
339
+ ### Setup Development Environment
95
340
 
96
- Submit bugs directly from the app using `/bug` - it will open GitHub with pre-filled information.
341
+ ```bash
342
+ # Clone the repository
343
+ git clone https://github.com/shareAI-lab/kode.git
344
+ cd kode
97
345
 
98
- ## Privacy & Data
346
+ # Install dependencies
347
+ bun install
99
348
 
100
- - **No telemetry** - No backend servers except your chosen AI providers
101
- - **Local processing** - All data stays on your machine
102
- - **Open source** - Full transparency in code and data handling
349
+ # Run in development mode
350
+ bun run dev
351
+ ```
103
352
 
104
- ## Repository
353
+ ### Build
105
354
 
106
- - **Homepage**: [https://github.com/shareAI-lab/agent-kode](https://github.com/shareAI-lab/agent-kode)
107
- - **Issues**: [https://github.com/shareAI-lab/agent-kode/issues](https://github.com/shareAI-lab/agent-kode/issues)
355
+ ```bash
356
+ bun run build
357
+ ```
108
358
 
109
- ## License
359
+ ### Testing
360
+
361
+ ```bash
362
+ # Run tests
363
+ bun test
110
364
 
111
- See [LICENSE.md](LICENSE.md) for details.
365
+ # Test the CLI
366
+ ./cli.js --help
367
+ ```
112
368
 
113
- ---
369
+ ## Contributing
114
370
 
115
- **⚠️ Use at your own risk** - This tool executes code and commands on your system.
371
+ We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
372
+
373
+ ## License
374
+
375
+ ISC License - see [LICENSE](LICENSE) for details.
116
376
 
117
377
  ## Thanks
118
- - some code from @dnakov 's anonkode
119
- - some ui learn from gemini-cli
120
- - some system design learn from claude code
378
+
379
+ - Some code from @dnakov's anonkode
380
+ - Some UI learned from gemini-cli
381
+ - Some system design learned from claude code
382
+
383
+ ## Support
384
+
385
+ - 📚 [Documentation](docs/)
386
+ - 🐛 [Report Issues](https://github.com/shareAI-lab/kode/issues)
387
+ - 💬 [Discussions](https://github.com/shareAI-lab/kode/discussions)