karnel-termux 0.0.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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +454 -0
  3. package/install.sh +272 -0
  4. package/karnel/bin/karnel +77 -0
  5. package/karnel/cli/commands/brain.sh +1553 -0
  6. package/karnel/cli/commands/cleanup.sh +66 -0
  7. package/karnel/cli/commands/doctor.sh +1528 -0
  8. package/karnel/cli/commands/env.sh +233 -0
  9. package/karnel/cli/commands/help.sh +8 -0
  10. package/karnel/cli/commands/ia.sh +502 -0
  11. package/karnel/cli/commands/init.sh +1274 -0
  12. package/karnel/cli/commands/install.sh +718 -0
  13. package/karnel/cli/commands/list.sh +399 -0
  14. package/karnel/cli/commands/open.sh +106 -0
  15. package/karnel/cli/commands/pg.sh +719 -0
  16. package/karnel/cli/commands/reinstall.sh +663 -0
  17. package/karnel/cli/commands/show.sh +90 -0
  18. package/karnel/cli/commands/start.sh +54 -0
  19. package/karnel/cli/commands/status.sh +96 -0
  20. package/karnel/cli/commands/uninstall.sh +668 -0
  21. package/karnel/cli/commands/update.sh +723 -0
  22. package/karnel/cli/commands/upgrade.sh +40 -0
  23. package/karnel/cli/commands/version.sh +3 -0
  24. package/karnel/cli/commands/voice.sh +230 -0
  25. package/karnel/cli/karnel.sh +706 -0
  26. package/karnel/modules/ai.sh +135 -0
  27. package/karnel/modules/auto.sh +114 -0
  28. package/karnel/modules/db.sh +132 -0
  29. package/karnel/modules/deploy.sh +74 -0
  30. package/karnel/modules/dev.sh +148 -0
  31. package/karnel/modules/editor.sh +115 -0
  32. package/karnel/modules/lang.sh +124 -0
  33. package/karnel/modules/npm.sh +146 -0
  34. package/karnel/modules/shell.sh +338 -0
  35. package/karnel/modules/ui.sh +139 -0
  36. package/karnel/modules/voice.sh +118 -0
  37. package/karnel/tools/ai/all.sh +209 -0
  38. package/karnel/tools/ai/antigravity-cli/README.md +45 -0
  39. package/karnel/tools/ai/antigravity-cli/bin/agy +28 -0
  40. package/karnel/tools/ai/antigravity-cli/helper/agy_helper.c +39 -0
  41. package/karnel/tools/ai/antigravity-cli/install.sh +469 -0
  42. package/karnel/tools/ai/claude-code/README.md +45 -0
  43. package/karnel/tools/ai/claude-code/bin/claude +29 -0
  44. package/karnel/tools/ai/claude-code/helper/claude_helper.c +42 -0
  45. package/karnel/tools/ai/claude-code/install.sh +278 -0
  46. package/karnel/tools/ai/cline/install.sh +160 -0
  47. package/karnel/tools/ai/codegraph/README.md +43 -0
  48. package/karnel/tools/ai/codegraph/bin/codegraph +5 -0
  49. package/karnel/tools/ai/codegraph/install.sh +160 -0
  50. package/karnel/tools/ai/codex/README.md +44 -0
  51. package/karnel/tools/ai/codex/install.sh +104 -0
  52. package/karnel/tools/ai/command-code/README.md +62 -0
  53. package/karnel/tools/ai/command-code/install.sh +136 -0
  54. package/karnel/tools/ai/crush/README.md +17 -0
  55. package/karnel/tools/ai/crush/install.sh +89 -0
  56. package/karnel/tools/ai/ctx7/README.md +26 -0
  57. package/karnel/tools/ai/ctx7/install.sh +61 -0
  58. package/karnel/tools/ai/engram/README.md +44 -0
  59. package/karnel/tools/ai/engram/install.sh +127 -0
  60. package/karnel/tools/ai/freebuff/README.md +52 -0
  61. package/karnel/tools/ai/freebuff/bin/freebuff +28 -0
  62. package/karnel/tools/ai/freebuff/helper/freebuff_helper.c +47 -0
  63. package/karnel/tools/ai/freebuff/install.sh +303 -0
  64. package/karnel/tools/ai/gemini-cli/README.md +46 -0
  65. package/karnel/tools/ai/gemini-cli/install.sh +111 -0
  66. package/karnel/tools/ai/gentle-ai/README.md +42 -0
  67. package/karnel/tools/ai/gentle-ai/install.sh +253 -0
  68. package/karnel/tools/ai/gentle-ai/termux-patches.go +256 -0
  69. package/karnel/tools/ai/gga/README.md +49 -0
  70. package/karnel/tools/ai/gga/install.sh +134 -0
  71. package/karnel/tools/ai/hermes-agent/README.md +50 -0
  72. package/karnel/tools/ai/hermes-agent/install.sh +120 -0
  73. package/karnel/tools/ai/kilocode-cli/README.md +45 -0
  74. package/karnel/tools/ai/kilocode-cli/bin/kilocode +21 -0
  75. package/karnel/tools/ai/kilocode-cli/helper/kilocode_helper.c +47 -0
  76. package/karnel/tools/ai/kilocode-cli/install.sh +179 -0
  77. package/karnel/tools/ai/kimchi-code/README.md +53 -0
  78. package/karnel/tools/ai/kimchi-code/install.sh +221 -0
  79. package/karnel/tools/ai/kimi-code/README.md +45 -0
  80. package/karnel/tools/ai/kimi-code/install.sh +111 -0
  81. package/karnel/tools/ai/kiro/README.md +17 -0
  82. package/karnel/tools/ai/kiro/install.sh +134 -0
  83. package/karnel/tools/ai/mimocode/README.md +43 -0
  84. package/karnel/tools/ai/mimocode/bin/mimo +28 -0
  85. package/karnel/tools/ai/mimocode/helper/mimocode_helper.c +47 -0
  86. package/karnel/tools/ai/mimocode/install.sh +287 -0
  87. package/karnel/tools/ai/minimax-cli/README.md +45 -0
  88. package/karnel/tools/ai/minimax-cli/install.sh +111 -0
  89. package/karnel/tools/ai/mistral-vibe/README.md +46 -0
  90. package/karnel/tools/ai/mistral-vibe/install.sh +119 -0
  91. package/karnel/tools/ai/odysseus/README.md +35 -0
  92. package/karnel/tools/ai/odysseus/install.sh +198 -0
  93. package/karnel/tools/ai/ollama/README.md +44 -0
  94. package/karnel/tools/ai/ollama/install.sh +78 -0
  95. package/karnel/tools/ai/omni-route/README.md +111 -0
  96. package/karnel/tools/ai/omni-route/install.sh +165 -0
  97. package/karnel/tools/ai/openclaude/README.md +46 -0
  98. package/karnel/tools/ai/openclaude/install.sh +110 -0
  99. package/karnel/tools/ai/openclaw/README.md +47 -0
  100. package/karnel/tools/ai/openclaw/install.sh +112 -0
  101. package/karnel/tools/ai/opencode/README.md +51 -0
  102. package/karnel/tools/ai/opencode/bin/opencode +28 -0
  103. package/karnel/tools/ai/opencode/helper/opencode_helper.c +57 -0
  104. package/karnel/tools/ai/opencode/install.sh +290 -0
  105. package/karnel/tools/ai/openspec/README.md +34 -0
  106. package/karnel/tools/ai/openspec/install.sh +61 -0
  107. package/karnel/tools/ai/pi/README.md +46 -0
  108. package/karnel/tools/ai/pi/install.sh +104 -0
  109. package/karnel/tools/ai/qwen-code/README.md +45 -0
  110. package/karnel/tools/ai/qwen-code/install.sh +111 -0
  111. package/karnel/tools/auto/all.sh +57 -0
  112. package/karnel/tools/auto/n8n/README.md +47 -0
  113. package/karnel/tools/auto/n8n/install.sh +102 -0
  114. package/karnel/tools/db/all.sh +61 -0
  115. package/karnel/tools/db/mariadb/README.md +43 -0
  116. package/karnel/tools/db/mariadb/install.sh +65 -0
  117. package/karnel/tools/db/mongodb/README.md +42 -0
  118. package/karnel/tools/db/mongodb/install.sh +73 -0
  119. package/karnel/tools/db/postgresql/README.md +45 -0
  120. package/karnel/tools/db/postgresql/install.sh +65 -0
  121. package/karnel/tools/db/redis/README.md +46 -0
  122. package/karnel/tools/db/redis/install.sh +64 -0
  123. package/karnel/tools/db/sqlite/README.md +44 -0
  124. package/karnel/tools/db/sqlite/install.sh +65 -0
  125. package/karnel/tools/deploy/all.sh +43 -0
  126. package/karnel/tools/deploy/netlify/install.sh +41 -0
  127. package/karnel/tools/deploy/railway/install.sh +109 -0
  128. package/karnel/tools/deploy/vercel/install.sh +43 -0
  129. package/karnel/tools/dev/all.sh +77 -0
  130. package/karnel/tools/dev/bat/README.md +44 -0
  131. package/karnel/tools/dev/bat/install.sh +82 -0
  132. package/karnel/tools/dev/bc/README.md +44 -0
  133. package/karnel/tools/dev/bc/install.sh +82 -0
  134. package/karnel/tools/dev/cloudflared/README.md +43 -0
  135. package/karnel/tools/dev/cloudflared/install.sh +82 -0
  136. package/karnel/tools/dev/curl/README.md +43 -0
  137. package/karnel/tools/dev/curl/install.sh +82 -0
  138. package/karnel/tools/dev/fzf/README.md +44 -0
  139. package/karnel/tools/dev/fzf/install.sh +82 -0
  140. package/karnel/tools/dev/gh/README.md +43 -0
  141. package/karnel/tools/dev/gh/install.sh +82 -0
  142. package/karnel/tools/dev/html2text/README.md +44 -0
  143. package/karnel/tools/dev/html2text/install.sh +82 -0
  144. package/karnel/tools/dev/imagemagick/README.md +44 -0
  145. package/karnel/tools/dev/imagemagick/install.sh +82 -0
  146. package/karnel/tools/dev/jq/README.md +44 -0
  147. package/karnel/tools/dev/jq/install.sh +82 -0
  148. package/karnel/tools/dev/lsd/README.md +44 -0
  149. package/karnel/tools/dev/lsd/install.sh +82 -0
  150. package/karnel/tools/dev/make/README.md +44 -0
  151. package/karnel/tools/dev/make/install.sh +82 -0
  152. package/karnel/tools/dev/ncurses/README.md +42 -0
  153. package/karnel/tools/dev/ncurses/install.sh +82 -0
  154. package/karnel/tools/dev/openssh/README.md +43 -0
  155. package/karnel/tools/dev/openssh/install.sh +75 -0
  156. package/karnel/tools/dev/proot/README.md +43 -0
  157. package/karnel/tools/dev/proot/install.sh +82 -0
  158. package/karnel/tools/dev/shfmt/README.md +44 -0
  159. package/karnel/tools/dev/shfmt/install.sh +82 -0
  160. package/karnel/tools/dev/tmate/README.md +44 -0
  161. package/karnel/tools/dev/tmate/install.sh +82 -0
  162. package/karnel/tools/dev/tmux/README.md +43 -0
  163. package/karnel/tools/dev/tmux/install.sh +75 -0
  164. package/karnel/tools/dev/translate/README.md +44 -0
  165. package/karnel/tools/dev/translate/install.sh +82 -0
  166. package/karnel/tools/dev/tree/README.md +44 -0
  167. package/karnel/tools/dev/tree/install.sh +82 -0
  168. package/karnel/tools/dev/udocker/README.md +44 -0
  169. package/karnel/tools/dev/udocker/install.sh +82 -0
  170. package/karnel/tools/dev/wget/README.md +44 -0
  171. package/karnel/tools/dev/wget/install.sh +82 -0
  172. package/karnel/tools/editor/all.sh +59 -0
  173. package/karnel/tools/editor/code-server/README.md +42 -0
  174. package/karnel/tools/editor/code-server/install.sh +74 -0
  175. package/karnel/tools/editor/neovim/README.md +43 -0
  176. package/karnel/tools/editor/neovim/install.sh +64 -0
  177. package/karnel/tools/editor/nvchad/README.md +45 -0
  178. package/karnel/tools/editor/nvchad/install.sh +105 -0
  179. package/karnel/tools/lang/all.sh +63 -0
  180. package/karnel/tools/lang/clang/README.md +43 -0
  181. package/karnel/tools/lang/clang/install.sh +79 -0
  182. package/karnel/tools/lang/golang/README.md +43 -0
  183. package/karnel/tools/lang/golang/install.sh +79 -0
  184. package/karnel/tools/lang/nodejs/README.md +43 -0
  185. package/karnel/tools/lang/nodejs/install.sh +79 -0
  186. package/karnel/tools/lang/perl/README.md +43 -0
  187. package/karnel/tools/lang/perl/install.sh +79 -0
  188. package/karnel/tools/lang/php/README.md +43 -0
  189. package/karnel/tools/lang/php/install.sh +79 -0
  190. package/karnel/tools/lang/python/README.md +43 -0
  191. package/karnel/tools/lang/python/install.sh +79 -0
  192. package/karnel/tools/lang/rust/README.md +43 -0
  193. package/karnel/tools/lang/rust/install.sh +79 -0
  194. package/karnel/tools/npm/all.sh +90 -0
  195. package/karnel/tools/npm/live-server/README.md +43 -0
  196. package/karnel/tools/npm/live-server/install.sh +96 -0
  197. package/karnel/tools/npm/localtunnel/README.md +43 -0
  198. package/karnel/tools/npm/localtunnel/install.sh +112 -0
  199. package/karnel/tools/npm/markserv/README.md +43 -0
  200. package/karnel/tools/npm/markserv/install.sh +95 -0
  201. package/karnel/tools/npm/ncu/README.md +43 -0
  202. package/karnel/tools/npm/ncu/install.sh +95 -0
  203. package/karnel/tools/npm/nestjs/README.md +43 -0
  204. package/karnel/tools/npm/nestjs/install.sh +95 -0
  205. package/karnel/tools/npm/ngrok/README.md +44 -0
  206. package/karnel/tools/npm/ngrok/install.sh +95 -0
  207. package/karnel/tools/npm/prettier/README.md +43 -0
  208. package/karnel/tools/npm/prettier/install.sh +95 -0
  209. package/karnel/tools/npm/psqlformat/README.md +43 -0
  210. package/karnel/tools/npm/psqlformat/install.sh +95 -0
  211. package/karnel/tools/npm/turbopack/README.md +8 -0
  212. package/karnel/tools/npm/turbopack/install.sh +42 -0
  213. package/karnel/tools/npm/typescript/README.md +43 -0
  214. package/karnel/tools/npm/typescript/install.sh +95 -0
  215. package/karnel/tools/npm/vercel/README.md +43 -0
  216. package/karnel/tools/npm/vercel/install.sh +95 -0
  217. package/karnel/tools/shell/all.sh +67 -0
  218. package/karnel/tools/shell/better-npm/README.md +43 -0
  219. package/karnel/tools/shell/better-npm/install.sh +85 -0
  220. package/karnel/tools/shell/fzf-tab/README.md +44 -0
  221. package/karnel/tools/shell/fzf-tab/install.sh +85 -0
  222. package/karnel/tools/shell/history-substring/README.md +43 -0
  223. package/karnel/tools/shell/history-substring/install.sh +85 -0
  224. package/karnel/tools/shell/powerlevel10k/README.md +43 -0
  225. package/karnel/tools/shell/powerlevel10k/install.sh +85 -0
  226. package/karnel/tools/shell/you-should-use/README.md +43 -0
  227. package/karnel/tools/shell/you-should-use/install.sh +85 -0
  228. package/karnel/tools/shell/zsh-autopair/README.md +44 -0
  229. package/karnel/tools/shell/zsh-autopair/install.sh +85 -0
  230. package/karnel/tools/shell/zsh-autosuggestions/README.md +43 -0
  231. package/karnel/tools/shell/zsh-autosuggestions/install.sh +85 -0
  232. package/karnel/tools/shell/zsh-completions/README.md +43 -0
  233. package/karnel/tools/shell/zsh-completions/install.sh +85 -0
  234. package/karnel/tools/shell/zsh-defer/README.md +43 -0
  235. package/karnel/tools/shell/zsh-defer/install.sh +85 -0
  236. package/karnel/tools/shell/zsh-syntax-highlighting/README.md +43 -0
  237. package/karnel/tools/shell/zsh-syntax-highlighting/install.sh +72 -0
  238. package/karnel/tools/ui/all.sh +61 -0
  239. package/karnel/tools/ui/banner/README.md +42 -0
  240. package/karnel/tools/ui/banner/install.sh +160 -0
  241. package/karnel/tools/ui/cursor/README.md +42 -0
  242. package/karnel/tools/ui/cursor/install.sh +58 -0
  243. package/karnel/tools/ui/extra-keys/README.md +43 -0
  244. package/karnel/tools/ui/extra-keys/install.sh +62 -0
  245. package/karnel/tools/ui/font/README.md +43 -0
  246. package/karnel/tools/ui/font/install.sh +63 -0
  247. package/karnel/tools/voice/all.sh +27 -0
  248. package/karnel/tools/voice/install.sh +10 -0
  249. package/karnel/tools/voice/uninstall.sh +8 -0
  250. package/karnel/utils/banner.sh +492 -0
  251. package/karnel/utils/bootstrap.sh +25 -0
  252. package/karnel/utils/colors.sh +33 -0
  253. package/karnel/utils/dialogrc +30 -0
  254. package/karnel/utils/env.sh +53 -0
  255. package/karnel/utils/log.sh +567 -0
  256. package/karnel/utils/version.sh +205 -0
  257. package/package.json +42 -0
  258. package/scripts/npm-install.js +60 -0
@@ -0,0 +1,723 @@
1
+ #!/data/data/com.termux/files/usr/bin/bash
2
+
3
+ import "@/utils/log"
4
+ import "@/utils/colors"
5
+
6
+ update_main() {
7
+
8
+ if [[ $# -eq 0 ]]; then
9
+ echo
10
+ box "Karnel Update"
11
+ echo
12
+ log_info "Usage: karnel update <target>"
13
+ log_info "Usage: karnel update <target> --tool1 --tool2"
14
+ echo
15
+ log_info "Available targets:"
16
+ echo
17
+ list_item "karnel - Update only Karnel-Termux framework"
18
+ list_item "lang - Update language packages (pkg upgrade)"
19
+ list_item "db - Update databases"
20
+ list_item "ai - Update AI tools (npm/pip/pkg)"
21
+ list_item "editor - Update Neovim configuration"
22
+ list_item "dev - Update development tools"
23
+ list_item "npm - Update Node.js global modules"
24
+ list_item "shell - Update ZSH plugins"
25
+ list_item "ui - Update Termux UI"
26
+ list_item "auto - Update Automation Tools"
27
+ echo
28
+ log_info "Update specific tools with flags:"
29
+ echo
30
+ list_item "karnel update ai --qwen-code --ollama"
31
+ list_item "karnel update db --postgresql --sqlite"
32
+ list_item "Run ${D_CYAN}karnel list <target>${NC} to see all available tools"
33
+ echo
34
+ return
35
+ fi
36
+
37
+ # Separate module target from tool flags
38
+ local module_target=""
39
+ local -a tool_flags=()
40
+
41
+ for arg in "$@"; do
42
+ if [[ "$arg" == --* ]]; then
43
+ local flag="${arg#--}"
44
+ tool_flags+=("$flag")
45
+ elif [[ -z "$module_target" ]]; then
46
+ module_target="$arg"
47
+ fi
48
+ done
49
+
50
+ # If no module target specified, show error
51
+ if [[ -z "$module_target" ]]; then
52
+ log_error "No target specified"
53
+ echo "Run 'karnel update' to see available targets"
54
+ return 1
55
+ fi
56
+
57
+ # If no tool flags, update entire module (original behavior)
58
+ if [[ ${#tool_flags[@]} -eq 0 ]]; then
59
+ _update_full_module "$module_target"
60
+ else
61
+ # Update specific tools
62
+ _update_specific_tools "$module_target" "${tool_flags[@]}"
63
+ fi
64
+ }
65
+
66
+ # Update entire module (original behavior)
67
+ _update_full_module() {
68
+ local target="$1"
69
+
70
+ case "$target" in
71
+ core|karnel)
72
+ update_karnel
73
+ ;;
74
+ lang)
75
+ import "@/modules/lang"
76
+ update_lang
77
+ ;;
78
+ db)
79
+ import "@/modules/db"
80
+ update_db
81
+ ;;
82
+ ai)
83
+ import "@/modules/ai"
84
+ update_ai
85
+ ;;
86
+ editor)
87
+ import "@/modules/editor"
88
+ update_editor
89
+ ;;
90
+ dev)
91
+ import "@/modules/dev"
92
+ update_dev
93
+ ;;
94
+ npm)
95
+ import "@/modules/npm"
96
+ update_npm
97
+ ;;
98
+ shell)
99
+ import "@/modules/shell"
100
+ update_shell
101
+ ;;
102
+ ui)
103
+ import "@/modules/ui"
104
+ update_ui
105
+ ;;
106
+ auto)
107
+ import "@/modules/auto"
108
+ update_auto
109
+ ;;
110
+ *)
111
+ log_warn "Unknown update target: $target"
112
+ echo "Run 'karnel update' to see available targets"
113
+ ;;
114
+ esac
115
+ }
116
+
117
+ # Update specific tools within a module
118
+ _update_specific_tools() {
119
+ local module="$1"
120
+ shift
121
+ local -a tools=("$@")
122
+
123
+ case "$module" in
124
+ ai)
125
+ import "@/tools/ai/all"
126
+ local updated_count=0
127
+ local failed_count=0
128
+
129
+ for tool in "${tools[@]}"; do
130
+ case "$tool" in
131
+ qwen-code)
132
+ update_qwen_code
133
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
134
+ ;;
135
+ gemini-cli)
136
+ update_gemini_cli
137
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
138
+ ;;
139
+ claude-code)
140
+ update_claude_code
141
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
142
+ ;;
143
+ mistral-vibe)
144
+ update_mistral_vibe
145
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
146
+ ;;
147
+ openclaude)
148
+ update_openclaude
149
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
150
+ ;;
151
+ openclaw)
152
+ update_openclaw
153
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
154
+ ;;
155
+ ollama)
156
+ update_ollama
157
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
158
+ ;;
159
+ codex)
160
+ update_codex
161
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
162
+ ;;
163
+ opencode)
164
+ update_opencode
165
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
166
+ ;;
167
+ kilocode-cli)
168
+ update_kilocode_cli
169
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
170
+ ;;
171
+ kimchi)
172
+ update_kimchi
173
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
174
+ ;;
175
+ mimocode)
176
+ update_mimocode
177
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
178
+ ;;
179
+ engram)
180
+ update_engram
181
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
182
+ ;;
183
+ codegraph)
184
+ update_codegraph
185
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
186
+ ;;
187
+ pi)
188
+ update_pi
189
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
190
+ ;;
191
+ antigravity-cli)
192
+ update_antigravity_cli
193
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
194
+ ;;
195
+ minimax-cli)
196
+ update_minimax_cli
197
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
198
+ ;;
199
+ gentle-ai)
200
+ update_gentle_ai
201
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
202
+ ;;
203
+ gga)
204
+ update_gga
205
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
206
+ ;;
207
+ hermes-agent)
208
+ update_hermes_agent
209
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
210
+ ;;
211
+ kimi-code)
212
+ update_kimi_code
213
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
214
+ ;;
215
+ command-code)
216
+ update_command_code
217
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
218
+ ;;
219
+ freebuff)
220
+ update_freebuff
221
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
222
+ ;;
223
+ ctx7)
224
+ update_ctx7
225
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
226
+ ;;
227
+ openspec)
228
+ update_openspec
229
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
230
+ ;;
231
+ *)
232
+ log_warn "Unknown AI tool: --$tool"
233
+ ;;
234
+ esac
235
+ done
236
+
237
+ echo
238
+ if [[ $updated_count -gt 0 ]]; then
239
+ log_success "$updated_count AI tool(s) updated"
240
+ fi
241
+ if [[ $failed_count -gt 0 ]]; then
242
+ log_warn "$failed_count tool(s) failed to update"
243
+ fi
244
+ echo
245
+ ;;
246
+ db)
247
+ import "@/tools/db/all"
248
+ local updated_count=0
249
+ local failed_count=0
250
+
251
+ for tool in "${tools[@]}"; do
252
+ case "$tool" in
253
+ postgresql)
254
+ update_postgresql
255
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
256
+ ;;
257
+ mariadb)
258
+ update_mariadb
259
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
260
+ ;;
261
+ sqlite)
262
+ update_sqlite
263
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
264
+ ;;
265
+ mongodb)
266
+ update_mongodb
267
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
268
+ ;;
269
+ redis)
270
+ update_redis
271
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
272
+ ;;
273
+ *)
274
+ log_warn "Unknown database: --$tool"
275
+ ;;
276
+ esac
277
+ done
278
+
279
+ echo
280
+ if [[ $updated_count -gt 0 ]]; then
281
+ log_success "$updated_count database(s) updated"
282
+ fi
283
+ if [[ $failed_count -gt 0 ]]; then
284
+ log_warn "$failed_count database(s) failed to update"
285
+ fi
286
+ echo
287
+ ;;
288
+ dev)
289
+ import "@/tools/dev/all"
290
+ local updated_count=0
291
+ local failed_count=0
292
+
293
+ for tool in "${tools[@]}"; do
294
+ case "$tool" in
295
+ gh)
296
+ update_gh
297
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
298
+ ;;
299
+ wget)
300
+ update_wget
301
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
302
+ ;;
303
+ curl)
304
+ update_curl
305
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
306
+ ;;
307
+ lsd)
308
+ update_lsd
309
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
310
+ ;;
311
+ bat)
312
+ update_bat
313
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
314
+ ;;
315
+ proot)
316
+ update_proot
317
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
318
+ ;;
319
+ ncurses)
320
+ update_ncurses
321
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
322
+ ;;
323
+ tmate)
324
+ update_tmate
325
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
326
+ ;;
327
+ tmux)
328
+ update_tmux
329
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
330
+ ;;
331
+ openssh)
332
+ update_openssh
333
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
334
+ ;;
335
+ cloudflared)
336
+ update_cloudflared
337
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
338
+ ;;
339
+ translate)
340
+ update_translate
341
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
342
+ ;;
343
+ html2text)
344
+ update_html2text
345
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
346
+ ;;
347
+ jq)
348
+ update_jq
349
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
350
+ ;;
351
+ bc)
352
+ update_bc
353
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
354
+ ;;
355
+ tree)
356
+ update_tree
357
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
358
+ ;;
359
+ fzf)
360
+ update_fzf
361
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
362
+ ;;
363
+ imagemagick)
364
+ update_imagemagick
365
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
366
+ ;;
367
+ shfmt)
368
+ update_shfmt
369
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
370
+ ;;
371
+ make)
372
+ update_make
373
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
374
+ ;;
375
+ udocker)
376
+ update_udocker
377
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
378
+ ;;
379
+ *)
380
+ log_warn "Unknown tool: --$tool"
381
+ ;;
382
+ esac
383
+ done
384
+
385
+ echo
386
+ if [[ $updated_count -gt 0 ]]; then
387
+ log_success "$updated_count tool(s) updated"
388
+ fi
389
+ if [[ $failed_count -gt 0 ]]; then
390
+ log_warn "$failed_count tool(s) failed to update"
391
+ fi
392
+ echo
393
+ ;;
394
+ npm)
395
+ import "@/tools/npm/all"
396
+ local updated_count=0
397
+ local failed_count=0
398
+
399
+ for tool in "${tools[@]}"; do
400
+ case "$tool" in
401
+ typescript)
402
+ update_typescript
403
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
404
+ ;;
405
+ nestjs)
406
+ update_nestjs
407
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
408
+ ;;
409
+ prettier)
410
+ update_prettier
411
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
412
+ ;;
413
+ live-server)
414
+ update_live_server
415
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
416
+ ;;
417
+ localtunnel)
418
+ update_localtunnel
419
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
420
+ ;;
421
+ vercel)
422
+ update_vercel
423
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
424
+ ;;
425
+ markserv)
426
+ update_markserv
427
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
428
+ ;;
429
+ psqlformat)
430
+ update_psqlformat
431
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
432
+ ;;
433
+ ncu)
434
+ update_ncu
435
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
436
+ ;;
437
+ ngrok)
438
+ update_ngrok
439
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
440
+ ;;
441
+ turbopack)
442
+ update_turbopack
443
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
444
+ ;;
445
+ *)
446
+ log_warn "Unknown node module: --$tool"
447
+ ;;
448
+ esac
449
+ done
450
+
451
+ echo
452
+ if [[ $updated_count -gt 0 ]]; then
453
+ log_success "$updated_count Node.js module(s) updated"
454
+ fi
455
+ if [[ $failed_count -gt 0 ]]; then
456
+ log_warn "$failed_count module(s) failed to update"
457
+ fi
458
+ echo
459
+ ;;
460
+ lang)
461
+ import "@/tools/lang/all"
462
+ local updated_count=0
463
+ local failed_count=0
464
+
465
+ for tool in "${tools[@]}"; do
466
+ case "$tool" in
467
+ nodejs)
468
+ update_npmjs
469
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
470
+ ;;
471
+ python)
472
+ update_python
473
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
474
+ ;;
475
+ perl)
476
+ update_perl
477
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
478
+ ;;
479
+ php)
480
+ update_php
481
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
482
+ ;;
483
+ rust)
484
+ update_rust
485
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
486
+ ;;
487
+ clang)
488
+ update_clang
489
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
490
+ ;;
491
+ golang)
492
+ update_golang
493
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
494
+ ;;
495
+ *)
496
+ log_warn "Unknown language: --$tool"
497
+ ;;
498
+ esac
499
+ done
500
+
501
+ echo
502
+ if [[ $updated_count -gt 0 ]]; then
503
+ log_success "$updated_count language(s) updated"
504
+ fi
505
+ if [[ $failed_count -gt 0 ]]; then
506
+ log_warn "$failed_count language(s) failed to update"
507
+ fi
508
+ echo
509
+ ;;
510
+ shell)
511
+ import "@/tools/shell/all"
512
+ local updated_count=0
513
+ local failed_count=0
514
+
515
+ for tool in "${tools[@]}"; do
516
+ case "$tool" in
517
+ powerlevel10k)
518
+ update_powerlevel10k
519
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
520
+ ;;
521
+ zsh-defer)
522
+ update_zsh_defer
523
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
524
+ ;;
525
+ zsh-autosuggestions)
526
+ update_zsh_autosuggestions
527
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
528
+ ;;
529
+ zsh-syntax-highlighting)
530
+ update_zsh_syntax_highlighting
531
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
532
+ ;;
533
+ history-substring)
534
+ update_history_substring
535
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
536
+ ;;
537
+ zsh-completions)
538
+ update_zsh_completions
539
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
540
+ ;;
541
+ fzf-tab)
542
+ update_fzf_tab
543
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
544
+ ;;
545
+ you-should-use)
546
+ update_you_should_use
547
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
548
+ ;;
549
+ zsh-autopair)
550
+ update_zsh_autopair
551
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
552
+ ;;
553
+ better-npm)
554
+ update_better_npm
555
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
556
+ ;;
557
+ *)
558
+ log_warn "Unknown plugin: --$tool"
559
+ ;;
560
+ esac
561
+ done
562
+
563
+ echo
564
+ if [[ $updated_count -gt 0 ]]; then
565
+ log_success "$updated_count plugin(s) updated"
566
+ fi
567
+ if [[ $failed_count -gt 0 ]]; then
568
+ log_warn "$failed_count plugin(s) failed to update"
569
+ fi
570
+ echo
571
+ ;;
572
+ editor)
573
+ import "@/tools/editor/all"
574
+ local updated_count=0
575
+ local failed_count=0
576
+
577
+ for tool in "${tools[@]}"; do
578
+ case "$tool" in
579
+ neovim)
580
+ update_neovim
581
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
582
+ ;;
583
+ nvchad)
584
+ update_nvchad
585
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
586
+ ;;
587
+ *)
588
+ log_warn "Unknown editor component: --$tool"
589
+ ;;
590
+ esac
591
+ done
592
+
593
+ echo
594
+ if [[ $updated_count -gt 0 ]]; then
595
+ log_success "$updated_count editor component(s) updated"
596
+ fi
597
+ if [[ $failed_count -gt 0 ]]; then
598
+ log_warn "$failed_count component(s) failed to update"
599
+ fi
600
+ echo
601
+ ;;
602
+ ui)
603
+ import "@/tools/ui/all"
604
+ local updated_count=0
605
+ local failed_count=0
606
+
607
+ for tool in "${tools[@]}"; do
608
+ case "$tool" in
609
+ font)
610
+ update_font
611
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
612
+ ;;
613
+ extra-keys)
614
+ update_extra_keys
615
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
616
+ ;;
617
+ cursor)
618
+ update_cursor
619
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
620
+ ;;
621
+ banner)
622
+ update_banner
623
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
624
+ ;;
625
+ *)
626
+ log_warn "Unknown UI component: --$tool"
627
+ ;;
628
+ esac
629
+ done
630
+
631
+ echo
632
+ if [[ $updated_count -gt 0 ]]; then
633
+ log_success "$updated_count UI component(s) updated"
634
+ fi
635
+ if [[ $failed_count -gt 0 ]]; then
636
+ log_warn "$failed_count component(s) failed to update"
637
+ fi
638
+ echo
639
+ ;;
640
+ auto)
641
+ import "@/tools/auto/all"
642
+ local updated_count=0
643
+ local failed_count=0
644
+
645
+ for tool in "${tools[@]}"; do
646
+ case "$tool" in
647
+ n8n)
648
+ update_n8n
649
+ case $? in 0) ((updated_count++));; 1) ((failed_count++));; esac
650
+ ;;
651
+ *)
652
+ log_warn "Unknown automation tool: --$tool"
653
+ ;;
654
+ esac
655
+ done
656
+
657
+ echo
658
+ if [[ $updated_count -gt 0 ]]; then
659
+ log_success "$updated_count automation tool(s) updated"
660
+ fi
661
+ if [[ $failed_count -gt 0 ]]; then
662
+ log_warn "$failed_count tool(s) failed to update"
663
+ fi
664
+ echo
665
+ ;;
666
+ *)
667
+ log_warn "Unknown update target: $module"
668
+ echo "Run 'karnel update' to see available targets"
669
+ ;;
670
+ esac
671
+ }
672
+
673
+ # Actualizar Karnel-Termux
674
+ update_karnel() {
675
+ separator
676
+ box "◈ UPDATING KARNEL-TERMUX ◈"
677
+ separator
678
+ echo
679
+
680
+ if [[ -d "$KARNEL_PATH/../.git" ]]; then
681
+ loading "Updating Karnel-Termux" _update_karnel_repo
682
+ local rc=$?
683
+
684
+ echo
685
+ if [[ $rc -eq 0 ]]; then
686
+ log_success "Karnel-Termux updated"
687
+ elif [[ $rc -eq 2 ]]; then
688
+ log_success "Karnel-Termux is already up to date"
689
+ else
690
+ log_error "Failed to update Karnel-Termux"
691
+ log_info "Check your internet connection or run git pull manually"
692
+ fi
693
+
694
+ rm -f "$KARNEL_CACHE/new_version" "$KARNEL_CACHE/last_version_check"
695
+ else
696
+ log_warn "Not a git repository, cannot update"
697
+ log_info "If you installed via curl, reinstall with:"
698
+ echo " curl -fsSL https://raw.githubusercontent.com/israelmarques1024-dotcom/karnel-termux/main/install.sh | bash"
699
+ fi
700
+
701
+ echo
702
+ }
703
+
704
+ _update_karnel_repo() {
705
+ local repo_dir="$KARNEL_PATH/.."
706
+ local old_head
707
+
708
+ old_head=$(git -C "$repo_dir" rev-parse HEAD 2>/dev/null)
709
+
710
+ if ! git -C "$repo_dir" pull --ff-only &>/dev/null; then
711
+ return 1
712
+ fi
713
+
714
+ if [[ "$(git -C "$repo_dir" rev-parse HEAD 2>/dev/null)" == "$old_head" ]]; then
715
+ return 2
716
+ fi
717
+
718
+ git -C "$repo_dir" log --oneline --no-decorate "$old_head..HEAD" 2>/dev/null | while IFS= read -r line; do
719
+ printf " ${CYAN}▸${NC} %s\n" "$line"
720
+ done
721
+
722
+ return 0
723
+ }