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,139 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+ import "@/utils/colors"
5
+
6
+ TERMUX_DIR="$HOME/.termux"
7
+ TERMUX_ASSETS_DIR="$(dirname "$KARNEL_PATH")/assets"
8
+ LOG_FILE="$KARNEL_CACHE/install_ui.log"
9
+
10
+ setup_ui() {
11
+ separator
12
+ box "Configuring Termux UI"
13
+ separator
14
+ echo
15
+
16
+ mkdir -p "$(dirname "$LOG_FILE")"
17
+
18
+ if [[ ! -d "$TERMUX_DIR" ]]; then
19
+ mkdir -p "$TERMUX_DIR"
20
+ log_info "Created Termux directory: $TERMUX_DIR"
21
+ fi
22
+
23
+ local rc=0
24
+ _setup_ui_wrapper || rc=$?
25
+ separator
26
+ if [ "$rc" -eq 0 ]; then
27
+ log_success "Termux UI configuration completed"
28
+ else
29
+ log_warn "$rc UI component(s) failed to configure"
30
+ fi
31
+ separator
32
+ echo
33
+ list_item "Cursor: Green (#00FF00)"
34
+ list_item "Extra-keys: Custom layout with navigation"
35
+ list_item "Font: Meslo Nerd Font"
36
+ list_item "Banner: Karnel startup banner"
37
+ echo
38
+ log_warn "Please restart Termux to apply all changes"
39
+ echo
40
+ }
41
+
42
+ _setup_ui_wrapper() {
43
+ import "@/tools/ui/all"
44
+ install_all_ui_components
45
+ return $?
46
+ }
47
+
48
+ uninstall_ui() {
49
+ if [[ ! -d "$TERMUX_DIR" ]]; then
50
+ log_info "Termux UI Configuration is not installed"
51
+ return 0
52
+ fi
53
+ separator
54
+ box "Uninstalling Termux UI Configuration"
55
+ separator
56
+ echo
57
+
58
+ mkdir -p "$(dirname "$LOG_FILE")"
59
+
60
+ local rc=0
61
+ _uninstall_ui_wrapper || rc=$?
62
+ echo
63
+ separator
64
+ if [ "$rc" -eq 0 ]; then
65
+ log_success "Termux UI configuration uninstalled"
66
+ else
67
+ log_warn "$rc UI component(s) failed to uninstall"
68
+ fi
69
+ separator
70
+ echo
71
+ log_warn "Please restart Termux to apply changes"
72
+ echo
73
+ }
74
+
75
+ _uninstall_ui_wrapper() {
76
+ import "@/tools/ui/all"
77
+ uninstall_all_ui_components
78
+ return $?
79
+ }
80
+
81
+ update_ui() {
82
+ separator
83
+ box "Updating Termux UI Configuration"
84
+ separator
85
+ echo
86
+
87
+ mkdir -p "$(dirname "$LOG_FILE")"
88
+
89
+ local rc=0
90
+ _update_ui_wrapper || rc=$?
91
+ echo
92
+ separator
93
+ if [ "$rc" -eq 0 ]; then
94
+ log_success "Termux UI configuration updated"
95
+ else
96
+ log_warn "$rc UI component(s) failed to update"
97
+ fi
98
+ separator
99
+ echo
100
+ }
101
+
102
+ _update_ui_wrapper() {
103
+ import "@/tools/ui/all"
104
+ update_all_ui_components
105
+ return $?
106
+ }
107
+
108
+ reinstall_ui() {
109
+ separator
110
+ box "Reinstalling Termux UI Configuration"
111
+ separator
112
+ echo
113
+
114
+ mkdir -p "$(dirname "$LOG_FILE")"
115
+
116
+ local rc=0
117
+ _reinstall_ui_wrapper || rc=$?
118
+ separator
119
+ if [ "$rc" -eq 0 ]; then
120
+ log_success "Termux UI configuration reinstalled"
121
+ else
122
+ log_warn "$rc UI component(s) failed to reinstall"
123
+ fi
124
+ separator
125
+ echo
126
+ list_item "Cursor: Green (#00FF00)"
127
+ list_item "Extra-keys: Custom layout with navigation"
128
+ list_item "Font: Meslo Nerd Font"
129
+ list_item "Banner: Karnel startup banner"
130
+ echo
131
+ log_warn "Please restart Termux to apply all changes"
132
+ echo
133
+ }
134
+
135
+ _reinstall_ui_wrapper() {
136
+ import "@/tools/ui/all"
137
+ reinstall_all_ui_components
138
+ return $?
139
+ }
@@ -0,0 +1,118 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+ import "@/utils/colors"
5
+
6
+ LOG_FILE="$KARNEL_CACHE/install_voice.log"
7
+
8
+ install_voice() {
9
+ separator
10
+ box "Installing Voice Support"
11
+ separator
12
+ echo
13
+
14
+ log_info "Installing Termux:API and dependencies for voice capture..."
15
+
16
+ mkdir -p "$(dirname "$LOG_FILE")"
17
+
18
+ loading "Installing Termux:API" _install_voice_deps
19
+ log_success "Voice dependencies installed"
20
+
21
+ local rc=0
22
+ _install_voice_shell || rc=$?
23
+ if [ "$rc" -eq 0 ]; then
24
+ log_success "Voice support installed successfully"
25
+ else
26
+ log_warn "$rc voice component(s) failed to install"
27
+ fi
28
+ separator
29
+ echo
30
+ list_item "Termux:API (speech-to-text, clipboard)"
31
+ list_item "Termux:API app (Android APK)"
32
+ list_item "Voice CLI: ${D_CYAN}karnel voice [agent]${NC}"
33
+ list_item "Install Termux:API app from: ${D_CYAN}https://kerneltermux.vercel.app/termux/api${NC}"
34
+ echo
35
+ }
36
+
37
+ _install_voice_deps() {
38
+ pkg install termux-api -y &>"$LOG_FILE"
39
+ }
40
+
41
+ _install_voice_shell() {
42
+ import "@/tools/voice/all"
43
+ install_all_voice_components
44
+ return $?
45
+ }
46
+
47
+ uninstall_voice() {
48
+ separator
49
+ box "Uninstalling Voice Support"
50
+ separator
51
+ echo
52
+
53
+ log_info "Removing voice components..."
54
+
55
+ local rc=0
56
+ _uninstall_voice_wrapper || rc=$?
57
+ if [ "$rc" -eq 0 ]; then
58
+ log_success "Voice support uninstalled"
59
+ else
60
+ log_warn "$rc voice component(s) failed to uninstall"
61
+ fi
62
+ }
63
+
64
+ _uninstall_voice_wrapper() {
65
+ import "@/tools/voice/all"
66
+ uninstall_all_voice_components
67
+ return $?
68
+ }
69
+
70
+ update_voice() {
71
+ separator
72
+ box "Updating Voice Support"
73
+ separator
74
+ echo
75
+
76
+ log_info "Updating voice configuration..."
77
+ local rc=0
78
+ _update_voice_wrapper || rc=$?
79
+ if [ "$rc" -eq 0 ]; then
80
+ log_success "Voice support updated"
81
+ else
82
+ log_warn "$rc voice component(s) failed to update"
83
+ fi
84
+ }
85
+
86
+ _update_voice_wrapper() {
87
+ import "@/tools/voice/all"
88
+ update_all_voice_components
89
+ return $?
90
+ }
91
+
92
+ reinstall_voice() {
93
+ separator
94
+ box "Reinstalling Voice Support"
95
+ separator
96
+ echo
97
+
98
+ log_info "Reinstalling voice dependencies..."
99
+
100
+ local rc=0
101
+ _reinstall_voice_wrapper || rc=$?
102
+ if [ "$rc" -eq 0 ]; then
103
+ log_success "Voice support reinstalled successfully"
104
+ else
105
+ log_warn "$rc voice component(s) failed to reinstall"
106
+ fi
107
+ separator
108
+ echo
109
+ list_item "Termux:API (speech-to-text, clipboard)"
110
+ list_item "Voice CLI: ${D_CYAN}karnel voice [agent]${NC}"
111
+ echo
112
+ }
113
+
114
+ _reinstall_voice_wrapper() {
115
+ import "@/tools/voice/all"
116
+ reinstall_all_voice_components
117
+ return $?
118
+ }
@@ -0,0 +1,209 @@
1
+ #!/usr/bin/env bash
2
+
3
+ # =============================================================================
4
+ # Karnel AI Tools Orchestrator
5
+ # =============================================================================
6
+ # Este arquivo importa TODOS os scripts de instalação individuais de ferramentas
7
+ # AI e expõe funções de lote: install_all, uninstall_all, update_all, reinstall_all
8
+ # =============================================================================
9
+
10
+ import "@/utils/log"
11
+ import "@/utils/colors"
12
+
13
+ # KARNEL_CACHE e PREFIX são definidos via env.sh
14
+ # Exportados aqui apenas como fallback para scripts que carregam all.sh diretamente
15
+ : "${KARNEL_CACHE:=$HOME/.cache/karnel}"
16
+ : "${PREFIX:=/data/data/com.termux/files/usr}"
17
+
18
+ # ---- Progress helpers (replicados do log.sh para consistência) ----
19
+
20
+ # ---- AI TOOLS REGISTRY ----
21
+ # Fonte única da verdade para todas as ferramentas AI.
22
+ # Cada registro contém:
23
+ # id = identificador único (usado em --flags, nomes de função)
24
+ # name = nome de exibição
25
+ # binary = nome(s) do(s) binário(s) para validação pós-instalação
26
+ # install_fn = nome da função install (gerado automaticamente)
27
+ # uninstall_fn = nome da função uninstall (gerado automaticamente)
28
+ # update_fn = nome da função update (gerado automaticamente)
29
+
30
+ AI_TOOLS_REGISTRY=(
31
+ "qwen-code:Qwen Code:qwen"
32
+ "gemini-cli:Gemini CLI:gemini"
33
+ "claude-code:Claude Code:claude"
34
+ "mistral-vibe:Mistral Vibe:vibe"
35
+ "openclaude:OpenClaude:openclaude"
36
+ "openclaw:OpenClaw:openclaw"
37
+ "ollama:Ollama:ollama"
38
+ "codex:Codex CLI:codex"
39
+ "opencode:OpenCode:opencode"
40
+ "mimocode:MiMo Code:mimo"
41
+ "engram:Engram:engram"
42
+ "codegraph:CodeGraph:codegraph"
43
+ "pi:Pi Coding Agent:pi"
44
+ "antigravity-cli:Antigravity CLI:agy"
45
+ "minimax-cli:Minimax CLI:mmx"
46
+ "gentle-ai:Gentle AI:gentle-ai"
47
+ "gga:GGA:gga"
48
+ "hermes-agent:Hermes Agent:hermes"
49
+ "kimi-code:Kimi Code:kimi"
50
+ "command-code:Command Code:command-code"
51
+ "freebuff:Freebuff:freebuff"
52
+ "kilocode-cli:Kilo Code CLI:kilocode,kilo"
53
+ "kiro:Kiro CLI:kiro,kiro-cli"
54
+ "crush:Crush CLI:crush"
55
+ "cline:Cline CLI:cline"
56
+ "odysseus:Odysseus:odysseus"
57
+ "kimchi-code:Kimchi CLI:kimchi"
58
+ "omni-route:omniRoute:omni-route"
59
+ "ctx7:Context7 Documentation Provider:ctx7"
60
+ "openspec:OpenSpec SDD Framework:openspec"
61
+ )
62
+
63
+ # ---- IMPORTAR TODOS OS SCRIPTS INDIVIDUAIS ----
64
+ # Cada tool/***/install.sh define install_*, uninstall_*, update_*, reinstall_*
65
+ _import_all_ai_tools() {
66
+ local tools_dir="$KARNEL_PATH/tools/ai"
67
+ for entry in "$tools_dir"/*/install.sh; do
68
+ if [[ -f "$entry" ]]; then
69
+ source "$entry"
70
+ fi
71
+ done
72
+ }
73
+ _import_all_ai_tools
74
+ unset -f _import_all_ai_tools
75
+
76
+ # ---- HELPERS DE VALIDAÇÃO PÓS-INSTALAÇÃO ----
77
+
78
+ # Verifica se pelo menos um dos binários existe no PATH
79
+ _validate_tool_installed() {
80
+ local binaries="$1"
81
+ local tool_name="$2"
82
+ IFS=',' read -ra bins <<< "$binaries"
83
+ for bin in "${bins[@]}"; do
84
+ if command -v "$bin" &>/dev/null; then
85
+ # Verificação extra: se for um stub (shell script que só mostra erro), considera falha
86
+ local bin_path
87
+ bin_path=$(command -v "$bin")
88
+ if [[ -f "$bin_path" ]]; then
89
+ local first_line
90
+ first_line=$(head -1 "$bin_path" 2>/dev/null)
91
+ # Stubs geralmente começam com #! e contêm "offline" ou "unreachable"
92
+ if [[ "$first_line" == "#!"* ]]; then
93
+ if grep -qiE "offline|unreachable|not.available|stub|indisponivel|inacessivel" "$bin_path" 2>/dev/null; then
94
+ log_warn "$tool_name: instalado como stub offline (instalação real indisponível)"
95
+ return 2
96
+ fi
97
+ fi
98
+ fi
99
+ return 0
100
+ fi
101
+ done
102
+ return 1
103
+ }
104
+
105
+ # Valida que o binário realmente executa (tenta --version ou --help)
106
+ _validate_tool_executable() {
107
+ local binary="$1"
108
+ local tool_name="$2"
109
+ if command -v "$binary" &>/dev/null; then
110
+ # Tenta executar com --version (ignora exit code, só verifica se não crasha)
111
+ "$binary" --version &>/dev/null || "$binary" --help &>/dev/null || "$binary" -h &>/dev/null || true
112
+ return 0
113
+ fi
114
+ return 1
115
+ }
116
+
117
+ # ---- FUNÇÕES DE LOTE ----
118
+
119
+ _all_ai_tools_action() {
120
+ local action="$1" # install, uninstall, update, reinstall
121
+ local action_label="$2" # Instalando, Removendo, Atualizando, Reinstalando
122
+ local total=${#AI_TOOLS_REGISTRY[@]}
123
+ local current=0
124
+ local success_count=0
125
+ local failed_count=0
126
+ local skipped_count=0
127
+
128
+ progress_start "$total" "${action_label} ferramentas IA..."
129
+
130
+ for entry in "${AI_TOOLS_REGISTRY[@]}"; do
131
+ IFS=':' read -r id name binaries <<< "$entry"
132
+ local func_name="${action}_${id//-/_}"
133
+
134
+ ((current++))
135
+
136
+ if declare -f "$func_name" &>/dev/null; then
137
+ "$func_name"
138
+ local rc=$?
139
+
140
+ case $rc in
141
+ 0)
142
+ # Pós-validação apenas para install
143
+ if [[ "$action" == "install" ]]; then
144
+ _validate_tool_installed "$binaries" "$name"
145
+ local validate_rc=$?
146
+ if [[ $validate_rc -eq 0 ]]; then
147
+ ((success_count++))
148
+ elif [[ $validate_rc -eq 2 ]]; then
149
+ # Stub instalado - conta como sucesso parcial
150
+ ((success_count++))
151
+ else
152
+ log_warn "$name: binário não encontrado no PATH após instalação"
153
+ ((failed_count++))
154
+ fi
155
+ else
156
+ ((success_count++))
157
+ fi
158
+ ;;
159
+ 1)
160
+ ((failed_count++))
161
+ ;;
162
+ 2)
163
+ ((skipped_count++))
164
+ ;;
165
+ esac
166
+ else
167
+ log_warn "Função não encontrada: $func_name"
168
+ ((failed_count++))
169
+ fi
170
+
171
+ progress_update "$current" "$total"
172
+ done
173
+
174
+ progress_done "$total"
175
+
176
+ echo
177
+ if [[ $success_count -gt 0 ]]; then
178
+ log_success "$success_count ferramenta(s) ${action_label,,} com sucesso"
179
+ fi
180
+ if [[ $skipped_count -gt 0 ]]; then
181
+ log_info "$skipped_count ferramenta(s) já estavam no estado desejado"
182
+ fi
183
+ if [[ $failed_count -gt 0 ]]; then
184
+ log_warn "$failed_count ferramenta(s) falharam ao ${action_label,,}"
185
+ fi
186
+ echo
187
+
188
+ return $failed_count
189
+ }
190
+
191
+ install_all_ai_tools() {
192
+ log_info "Instalando todas as ferramentas AI..."
193
+ _all_ai_tools_action "install" "Instalando"
194
+ }
195
+
196
+ uninstall_all_ai_tools() {
197
+ log_info "Removendo todas as ferramentas AI..."
198
+ _all_ai_tools_action "uninstall" "Removendo"
199
+ }
200
+
201
+ update_all_ai_tools() {
202
+ log_info "Atualizando todas as ferramentas AI..."
203
+ _all_ai_tools_action "update" "Atualizando"
204
+ }
205
+
206
+ reinstall_all_ai_tools() {
207
+ log_info "Reinstalando todas as ferramentas AI..."
208
+ _all_ai_tools_action "reinstall" "Reinstalando"
209
+ }
@@ -0,0 +1,45 @@
1
+ # Antigravity CLI
2
+
3
+ Lightweight, terminal-first surface for Antigravity agents
4
+
5
+ **Package:** antigravity-cli
6
+ **Author:** israel marques
7
+ **Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
8
+ **Official:** https://antigravity.google
9
+ **Type:** AI workflow assistant (Binary + glibc bootstrapper)
10
+ **License:** MIT
11
+
12
+ ## Description
13
+
14
+ Antigravity CLI is the lightweight, fast, terminal-first surface to work with Antigravity agents. It uses VA39 memory patches for Android ARM64 compatibility and runs via a glibc bootstrapper for native performance.
15
+
16
+ ## Dependencies
17
+
18
+ - glibc-repo, glibc, clang, python, jq, curl, tar
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ karnel install ai --antigravity-cli
24
+ ```
25
+
26
+ ## Uninstall
27
+
28
+ ```bash
29
+ karnel uninstall ai --antigravity-cli
30
+ ```
31
+
32
+ ## Update
33
+
34
+ ```bash
35
+ karnel update ai --antigravity-cli
36
+ ```
37
+
38
+ ## Notes
39
+
40
+ - Binary downloaded from official Antigravity manifest
41
+ - VA39 memory patches applied automatically for Android ARM64 compatibility
42
+ - C bootstrapper compiles via clang for ELF loading
43
+ - Data directory: `~/.local/share/karnel-data/antigravity-cli/`
44
+ - Command: `agy`
45
+
@@ -0,0 +1,28 @@
1
+ #!/data/data/com.termux/files/usr/bin/bash
2
+
3
+ UBUNTU_ROOTFS="__UBUNTU_ROOTFS__"
4
+
5
+ EXCLUDE_REGEX="^(PATH|LD_PRELOAD|LD_LIBRARY_PATH|PREFIX|HOME|PWD|OLDPWD|SHELL|IFS|_|SHLVL|PROMPT_COMMAND|TERMCAP|LS_COLORS|TERM)="
6
+
7
+ ENV_ARGS=()
8
+ while IFS= read -r line; do
9
+ if [[ -n "$line" && ! "$line" =~ $EXCLUDE_REGEX ]]; then
10
+ ENV_ARGS+=("--env" "$line")
11
+ fi
12
+ done < <(env)
13
+
14
+ ENV_ARGS+=(
15
+ "--env" "SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt"
16
+ "--env" "TERM=$TERM"
17
+ "--env" "HOME=/root"
18
+ )
19
+
20
+ unset LD_PRELOAD
21
+ proot-distro login \
22
+ "${ENV_ARGS[@]}" \
23
+ --termux-home \
24
+ --shared-tmp \
25
+ --bind "$UBUNTU_ROOTFS/root/.local:/root/.local" \
26
+ --work-dir "$PWD" \
27
+ ubuntu \
28
+ -- /root/.local/bin/agy.va39 "$@"
@@ -0,0 +1,39 @@
1
+ #include <stdlib.h>
2
+ #include <unistd.h>
3
+ #include <string.h>
4
+ #include <libgen.h>
5
+ #include <limits.h>
6
+ #include <stdio.h>
7
+
8
+ int main(int argc, char** argv) {
9
+ unsetenv("LD_PRELOAD");
10
+ unsetenv("LD_LIBRARY_PATH");
11
+
12
+ setenv("GODEBUG", "netdns=cgo", 1);
13
+ setenv("SSL_CERT_FILE", "/data/data/com.termux/files/usr/etc/tls/cert.pem", 1);
14
+
15
+ char* loader = "/data/data/com.termux/files/usr/glibc/lib/ld-linux-aarch64.so.1";
16
+ char real_bin[] = "/data/data/com.termux/files/home/.local/share/karnel-data/antigravity-cli/agy.va39";
17
+ char lib_path[] = "/data/data/com.termux/files/usr/glibc/lib";
18
+
19
+ char** new_argv = malloc((argc + 4) * sizeof(char*));
20
+ if (!new_argv) {
21
+ return 1;
22
+ }
23
+
24
+ new_argv[0] = loader;
25
+ new_argv[1] = "--library-path";
26
+ new_argv[2] = lib_path;
27
+ new_argv[3] = real_bin;
28
+
29
+ for (int i = 1; i < argc; i++) {
30
+ new_argv[i + 3] = argv[i];
31
+ }
32
+ new_argv[argc + 3] = NULL;
33
+
34
+ execv(loader, new_argv);
35
+
36
+ perror("execv");
37
+ free(new_argv);
38
+ return 1;
39
+ }