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,43 @@
1
+ # Rust
2
+
3
+ Systems programming language with memory safety guarantees
4
+
5
+ **Package:** rust
6
+ **Author:** israel marques
7
+ **Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
8
+ **Official:** https://www.rust-lang.org
9
+ **Type:** Language (pkg)
10
+ **License:** MIT / Apache 2.0
11
+
12
+ ## Description
13
+
14
+ Rust is a multi-paradigm, high-level, general-purpose programming language designed for performance and safety, especially safe concurrency. It enforces memory safety without a garbage collector, making it ideal for systems programming.
15
+
16
+ ## Dependencies
17
+
18
+ - Installed via pkg
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ karnel install lang --rust
24
+ ```
25
+
26
+ ## Uninstall
27
+
28
+ ```bash
29
+ karnel uninstall lang --rust
30
+ ```
31
+
32
+ ## Update
33
+
34
+ ```bash
35
+ karnel update lang --rust
36
+ ```
37
+
38
+ ## Notes
39
+
40
+ - Commands: `rustc`, `cargo`, `rustup`
41
+ - Includes Cargo package manager
42
+ - rustup allows managing multiple toolchains
43
+
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_lang.log"
6
+
7
+ _install_rust_pkg() {
8
+ loading "Installing Rust" _install_rust_pkg_impl
9
+ }
10
+
11
+ _install_rust_pkg_impl() {
12
+ if ! pkg install rust -y &>>"$LOG_FILE"; then
13
+ log_error "Failed to install Rust"
14
+ return 1
15
+ fi
16
+ return 0
17
+ }
18
+
19
+ install_rust() {
20
+ if command -v rust &>/dev/null; then
21
+ log_info "Rust is already installed"
22
+ return 2
23
+ fi
24
+ log_info "Installing Rust..."
25
+
26
+ mkdir -p "$(dirname "$LOG_FILE")"
27
+ _install_rust_pkg || return 1
28
+ log_success "Rust installed"
29
+ return 0
30
+ }
31
+
32
+ _uninstall_rust_pkg() {
33
+ loading "Uninstalling Rust" _uninstall_rust_pkg_impl
34
+ }
35
+
36
+ _uninstall_rust_pkg_impl() {
37
+ if ! pkg uninstall rust -y &>>"$LOG_FILE"; then
38
+ log_error "Failed to uninstall Rust"
39
+ return 1
40
+ fi
41
+ return 0
42
+ }
43
+
44
+ uninstall_rust() {
45
+ if ! command -v rustc &>/dev/null; then
46
+ log_info "Rust is not installed"
47
+ return 2
48
+ fi
49
+ log_info "Uninstalling Rust..."
50
+ mkdir -p "$(dirname "$LOG_FILE")"
51
+ _uninstall_rust_pkg || return 1
52
+ log_success "Rust uninstalled"
53
+ return 0
54
+ }
55
+
56
+ _update_rust_pkg() {
57
+ loading "Updating Rust" _update_rust_pkg_impl
58
+ }
59
+
60
+ _update_rust_pkg_impl() {
61
+ if ! pkg upgrade rust -y &>>"$LOG_FILE"; then
62
+ log_error "Failed to update Rust"
63
+ return 1
64
+ fi
65
+ return 0
66
+ }
67
+
68
+ update_rust() {
69
+ log_info "Updating Rust..."
70
+ mkdir -p "$(dirname "$LOG_FILE")"
71
+ _update_rust_pkg || return 1
72
+ log_success "Rust updated"
73
+ return 0
74
+ }
75
+
76
+ reinstall_rust() {
77
+ uninstall_rust
78
+ install_rust
79
+ }
@@ -0,0 +1,90 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_npm.log"
6
+
7
+ NODE_PACKAGES=(
8
+ "typescript"
9
+ "nestjs"
10
+ "prettier"
11
+ "live-server"
12
+ "localtunnel"
13
+ "vercel"
14
+ "markserv"
15
+ "psqlformat"
16
+ "ncu"
17
+ "turbopack"
18
+ )
19
+
20
+ for _tool in "${NODE_PACKAGES[@]}"; do
21
+ source "$(dirname "$BASH_SOURCE")/$_tool/install.sh"
22
+ done
23
+ unset _tool
24
+
25
+ _fix_npm_shebang() {
26
+ local bin_name="$1"
27
+ local bin_path="$PREFIX/bin/$bin_name"
28
+ [ ! -f "$bin_path" ] && [ ! -L "$bin_path" ] && return 0
29
+
30
+ local real_path
31
+ real_path=$(readlink -f "$bin_path" 2>/dev/null || echo "$bin_path")
32
+ [ ! -f "$real_path" ] && return 0
33
+
34
+ local shebang
35
+ shebang=$(head -1 "$real_path")
36
+
37
+ case "$shebang" in
38
+ "#!/usr/bin/env node"|"#!/data/data/com.termux/files/usr/bin/env node")
39
+ sed -i "1s|.*|#!$PREFIX/bin/node|" "$real_path"
40
+ log_info "Fixed shebang for $bin_name: $shebang → $PREFIX/bin/node"
41
+ ;;
42
+ "#!/usr/bin/env bash"|"#!/data/data/com.termux/files/usr/bin/env bash")
43
+ sed -i "1s|.*|#!$PREFIX/bin/bash|" "$real_path"
44
+ log_info "Fixed shebang for $bin_name: $shebang → $PREFIX/bin/bash"
45
+ ;;
46
+ esac
47
+ }
48
+
49
+ _batch_npm() {
50
+ local action="$1"
51
+ local action_past="$2"
52
+ local count_var="$3"
53
+ local count=0
54
+ local failed=0
55
+ local total=${#NODE_PACKAGES[@]}
56
+ local current=0
57
+ local func_name
58
+
59
+ progress_start "$total" "${action_past}ing npm packages..."
60
+
61
+ for tool in "${NODE_PACKAGES[@]}"; do
62
+ func_name="${action}_${tool//-/_}"
63
+ if declare -f "$func_name" &>/dev/null; then
64
+ loading "${action_past^}ing ${tool}" "$func_name"
65
+ case $? in 0) ((count++));; 1) ((failed++));; esac
66
+ fi
67
+ ((current++))
68
+ progress_update "$current" "$total"
69
+ done
70
+
71
+ progress_done "$total"
72
+ eval "$count_var=$count"
73
+ return $failed
74
+ }
75
+
76
+ install_all_npm_packages() {
77
+ _batch_npm "install" "install" "installed_count"
78
+ }
79
+
80
+ uninstall_all_npm_packages() {
81
+ _batch_npm "uninstall" "uninstall" "uninstalled_count"
82
+ }
83
+
84
+ update_all_npm_packages() {
85
+ _batch_npm "update" "update" "updated_count"
86
+ }
87
+
88
+ reinstall_all_npm_packages() {
89
+ _batch_npm "reinstall" "reinstall" "reinstalled_count"
90
+ }
@@ -0,0 +1,43 @@
1
+ # Live Server
2
+
3
+ Development server with live reload capability
4
+
5
+ **Package:** live-server
6
+ **Author:** israel marques
7
+ **Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
8
+ **Official:** https://github.com/tapio/live-server
9
+ **Type:** Node.js global module (npm)
10
+ **License:** MIT
11
+
12
+ ## Description
13
+
14
+ Live Server is a simple development HTTP server with live reload capability. It watches for file changes and automatically reloads the browser, making it ideal for front-end web development.
15
+
16
+ ## Dependencies
17
+
18
+ - Node.js LTS (nodejs-lts)
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ karnel install npm --live-server
24
+ ```
25
+
26
+ ## Uninstall
27
+
28
+ ```bash
29
+ karnel uninstall npm --live-server
30
+ ```
31
+
32
+ ## Update
33
+
34
+ ```bash
35
+ karnel update npm --live-server
36
+ ```
37
+
38
+ ## Notes
39
+
40
+ - Command: `live-server`
41
+ - Automatically opens browser on file changes
42
+ - Supports custom ports and SSL
43
+
@@ -0,0 +1,96 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_npm.log"
6
+
7
+ _live_server_dependencies() {
8
+ if command -v node &>/dev/null && command -v npm &>/dev/null; then
9
+ log_info "Node.js and npm are already installed"
10
+ return 0
11
+ fi
12
+
13
+ log_info "Installing Nodejs..."
14
+ mkdir -p "$(dirname "$LOG_FILE")"
15
+ pkg install nodejs-lts -y &>>"$LOG_FILE"
16
+ }
17
+
18
+ _install_live_server_npm() {
19
+ loading "Installing Live Server" _install_live_server_npm_impl
20
+ }
21
+
22
+ _install_live_server_npm_impl() {
23
+ if ! npm install -g live-server &>>"$LOG_FILE"; then
24
+ log_error "Failed to install live-server"
25
+ return 1
26
+ fi
27
+ _fix_npm_shebang "live-server"
28
+ return 0
29
+ }
30
+
31
+ install_live_server() {
32
+ if command -v live-server &>/dev/null; then
33
+ return 0
34
+ fi
35
+
36
+ log_info "Installing Live Server..."
37
+
38
+ _live_server_dependencies
39
+
40
+ mkdir -p "$(dirname "$LOG_FILE")"
41
+
42
+ _install_live_server_npm || return 1
43
+ log_success "Live Server installed"
44
+ return 0
45
+ }
46
+
47
+ _uninstall_live_server_npm() {
48
+ loading "Uninstalling Live Server" _uninstall_live_server_npm_impl
49
+ }
50
+
51
+ _uninstall_live_server_npm_impl() {
52
+ if ! npm uninstall -g live-server &>>"$LOG_FILE"; then
53
+ log_error "Failed to uninstall Live Server"
54
+ return 1
55
+ fi
56
+ return 0
57
+ }
58
+
59
+ uninstall_live_server() {
60
+ if ! command -v live-server &>/dev/null; then
61
+ log_info "Live Server is not installed"
62
+ return 0
63
+ fi
64
+ log_info "Uninstalling Live Server..."
65
+ mkdir -p "$(dirname "$LOG_FILE")"
66
+
67
+ _uninstall_live_server_npm || return 1
68
+ log_success "Live Server uninstalled"
69
+ return 0
70
+ }
71
+
72
+ _update_live_server_npm() {
73
+ loading "Updating Live Server" _update_live_server_npm_impl
74
+ }
75
+
76
+ _update_live_server_npm_impl() {
77
+ if ! npm update -g live-server &>>"$LOG_FILE"; then
78
+ log_error "Failed to update Live Server"
79
+ return 1
80
+ fi
81
+ return 0
82
+ }
83
+
84
+ update_live_server() {
85
+ log_info "Updating Live Server..."
86
+ mkdir -p "$(dirname "$LOG_FILE")"
87
+
88
+ _update_live_server_npm || return 1
89
+ log_success "Live Server updated"
90
+ return 0
91
+ }
92
+
93
+ reinstall_live_server() {
94
+ uninstall_live_server
95
+ install_live_server
96
+ }
@@ -0,0 +1,43 @@
1
+ # Localtunnel
2
+
3
+ Expose localhost to the internet securely
4
+
5
+ **Package:** localtunnel
6
+ **Author:** israel marques
7
+ **Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
8
+ **Official:** https://github.com/localtunnel/localtunnel
9
+ **Type:** Node.js global module (npm)
10
+ **License:** MIT
11
+
12
+ ## Description
13
+
14
+ Localtunnel exposes your local development server to the internet with a public URL. It's perfect for testing webhooks, sharing progress with clients, and mobile testing. Includes an Android fix to use `termux-open-url` instead of `openurl`.
15
+
16
+ ## Dependencies
17
+
18
+ - Node.js LTS (nodejs-lts)
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ karnel install npm --localtunnel
24
+ ```
25
+
26
+ ## Uninstall
27
+
28
+ ```bash
29
+ karnel uninstall npm --localtunnel
30
+ ```
31
+
32
+ ## Update
33
+
34
+ ```bash
35
+ karnel update npm --localtunnel
36
+ ```
37
+
38
+ ## Notes
39
+
40
+ - Command: `lt`
41
+ - Android fix applied automatically to use `termux-open-url`
42
+ - No configuration required
43
+
@@ -0,0 +1,112 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_npm.log"
6
+
7
+ _localtunnel_fix_openurl() {
8
+ local openurl_js
9
+ openurl_js="$(npm root -g)/localtunnel/node_modules/openurl/openurl.js"
10
+ if [[ ! -f "$openurl_js" ]]; then
11
+ openurl_js="$(npm root -g)/openurl/openurl.js"
12
+ fi
13
+ if [[ -f "$openurl_js" ]]; then
14
+ sed -i "/default:/i\\
15
+ case 'android':\\
16
+ command = 'termux-open-url';\\
17
+ break;" "$openurl_js"
18
+ fi
19
+ }
20
+
21
+ _localtunnel_dependencies() {
22
+ if command -v node &>/dev/null && command -v npm &>/dev/null; then
23
+ log_info "Node.js and npm are already installed"
24
+ return 0
25
+ fi
26
+
27
+ log_info "Installing Nodejs..."
28
+
29
+ mkdir -p "$(dirname "$LOG_FILE")"
30
+ pkg install nodejs-lts -y &>>"$LOG_FILE"
31
+ }
32
+
33
+ _install_localtunnel_npm() {
34
+ loading "Installing Localtunnel" _install_localtunnel_npm_impl
35
+ }
36
+
37
+ _install_localtunnel_npm_impl() {
38
+ if ! npm install -g localtunnel &>>"$LOG_FILE"; then
39
+ log_error "Failed to install Localtunnel"
40
+ return 1
41
+ fi
42
+ log_info "Applying localtunnel fix for Android..."
43
+ _localtunnel_fix_openurl &>>"$LOG_FILE"
44
+ _fix_npm_shebang "lt"
45
+ return 0
46
+ }
47
+
48
+ install_localtunnel() {
49
+ if command -v lt &>/dev/null; then
50
+ return 0
51
+ fi
52
+ log_info "Installing Localtunnel..."
53
+
54
+ _localtunnel_dependencies
55
+
56
+ mkdir -p "$(dirname "$LOG_FILE")"
57
+
58
+ _install_localtunnel_npm || return 1
59
+ log_success "Localtunnel installed"
60
+ return 0
61
+ }
62
+
63
+ _uninstall_localtunnel_npm() {
64
+ loading "Uninstalling Localtunnel" _uninstall_localtunnel_npm_impl
65
+ }
66
+
67
+ _uninstall_localtunnel_npm_impl() {
68
+ if ! npm uninstall -g localtunnel &>>"$LOG_FILE"; then
69
+ log_error "Failed to uninstall Localtunnel"
70
+ return 1
71
+ fi
72
+ return 0
73
+ }
74
+
75
+ uninstall_localtunnel() {
76
+ if ! command -v lt &>/dev/null; then
77
+ log_info "Localtunnel is not installed"
78
+ return 0
79
+ fi
80
+ log_info "Uninstalling Localtunnel..."
81
+ mkdir -p "$(dirname "$LOG_FILE")"
82
+
83
+ _uninstall_localtunnel_npm || return 1
84
+ log_success "Localtunnel uninstalled"
85
+ return 0
86
+ }
87
+
88
+ _update_localtunnel_npm() {
89
+ loading "Updating Localtunnel" _update_localtunnel_npm_impl
90
+ }
91
+
92
+ _update_localtunnel_npm_impl() {
93
+ if ! npm update -g localtunnel &>>"$LOG_FILE"; then
94
+ log_error "Failed to update Localtunnel"
95
+ return 1
96
+ fi
97
+ return 0
98
+ }
99
+
100
+ update_localtunnel() {
101
+ log_info "Updating Localtunnel..."
102
+ mkdir -p "$(dirname "$LOG_FILE")"
103
+
104
+ _update_localtunnel_npm || return 1
105
+ log_success "Localtunnel updated"
106
+ return 0
107
+ }
108
+
109
+ reinstall_localtunnel() {
110
+ uninstall_localtunnel
111
+ install_localtunnel
112
+ }
@@ -0,0 +1,43 @@
1
+ # Markserv
2
+
3
+ Markdown live-preview server
4
+
5
+ **Package:** markserv
6
+ **Author:** israel marques
7
+ **Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
8
+ **Official:** https://github.com/nice-registry/markserv
9
+ **Type:** Node.js global module (npm)
10
+ **License:** MIT
11
+
12
+ ## Description
13
+
14
+ Markserv is a live-preview server for Markdown files. It renders Markdown as HTML in the browser with automatic reloading when the file changes, making it perfect for writing documentation, notes, or README files.
15
+
16
+ ## Dependencies
17
+
18
+ - Node.js LTS (nodejs-lts)
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ karnel install npm --markserv
24
+ ```
25
+
26
+ ## Uninstall
27
+
28
+ ```bash
29
+ karnel uninstall npm --markserv
30
+ ```
31
+
32
+ ## Update
33
+
34
+ ```bash
35
+ karnel update npm --markserv
36
+ ```
37
+
38
+ ## Notes
39
+
40
+ - Command: `markserv`
41
+ - Supports custom ports and themes
42
+ - Live reload on file changes
43
+
@@ -0,0 +1,95 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+
5
+ LOG_FILE="$KARNEL_CACHE/install_npm.log"
6
+
7
+ _markserv_dependencies() {
8
+ if command -v node &>/dev/null && command -v npm &>/dev/null; then
9
+ log_info "Node.js and npm are already installed"
10
+ return 0
11
+ fi
12
+
13
+ log_info "Installing Nodejs..."
14
+ mkdir -p "$(dirname "$LOG_FILE")"
15
+ pkg install nodejs-lts -y &>>"$LOG_FILE"
16
+ }
17
+
18
+ _install_markserv_npm() {
19
+ loading "Installing Markserv" _install_markserv_npm_impl
20
+ }
21
+
22
+ _install_markserv_npm_impl() {
23
+ if ! npm install -g markserv &>>"$LOG_FILE"; then
24
+ log_error "Failed to install markserv"
25
+ return 1
26
+ fi
27
+ _fix_npm_shebang "markserv"
28
+ return 0
29
+ }
30
+
31
+ install_markserv() {
32
+ if command -v markserv &>/dev/null; then
33
+ return 0
34
+ fi
35
+ log_info "Installing Markserv..."
36
+
37
+ _markserv_dependencies
38
+
39
+ mkdir -p "$(dirname "$LOG_FILE")"
40
+
41
+ _install_markserv_npm || return 1
42
+ log_success "Markserv installed"
43
+ return 0
44
+ }
45
+
46
+ _uninstall_markserv_npm() {
47
+ loading "Uninstalling Markserv" _uninstall_markserv_npm_impl
48
+ }
49
+
50
+ _uninstall_markserv_npm_impl() {
51
+ if ! npm uninstall -g markserv &>>"$LOG_FILE"; then
52
+ log_error "Failed to uninstall Markserv"
53
+ return 1
54
+ fi
55
+ return 0
56
+ }
57
+
58
+ uninstall_markserv() {
59
+ if ! command -v markserv &>/dev/null; then
60
+ log_info "Markserv is not installed"
61
+ return 0
62
+ fi
63
+ log_info "Uninstalling Markserv..."
64
+ mkdir -p "$(dirname "$LOG_FILE")"
65
+
66
+ _uninstall_markserv_npm || return 1
67
+ log_success "Markserv uninstalled"
68
+ return 0
69
+ }
70
+
71
+ _update_markserv_npm() {
72
+ loading "Updating Markserv" _update_markserv_npm_impl
73
+ }
74
+
75
+ _update_markserv_npm_impl() {
76
+ if ! npm update -g markserv &>>"$LOG_FILE"; then
77
+ log_error "Failed to update Markserv"
78
+ return 1
79
+ fi
80
+ return 0
81
+ }
82
+
83
+ update_markserv() {
84
+ log_info "Updating Markserv..."
85
+ mkdir -p "$(dirname "$LOG_FILE")"
86
+
87
+ _update_markserv_npm || return 1
88
+ log_success "Markserv updated"
89
+ return 0
90
+ }
91
+
92
+ reinstall_markserv() {
93
+ uninstall_markserv
94
+ install_markserv
95
+ }
@@ -0,0 +1,43 @@
1
+ # npm-check-updates
2
+
3
+ Find and update outdated npm dependencies
4
+
5
+ **Package:** npm-check-updates
6
+ **Author:** israel marques
7
+ **Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
8
+ **Official:** https://github.com/raineorshine/npm-check-updates
9
+ **Type:** Node.js global module (npm)
10
+ **License:** Apache 2.0
11
+
12
+ ## Description
13
+
14
+ npm-check-updates (ncu) upgrades your package.json dependencies to the latest versions, ignoring specified versions. It provides interactive mode for selective updates and supports filtering, targeting, and more.
15
+
16
+ ## Dependencies
17
+
18
+ - Node.js LTS (nodejs-lts)
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ karnel install npm --ncu
24
+ ```
25
+
26
+ ## Uninstall
27
+
28
+ ```bash
29
+ karnel uninstall npm --ncu
30
+ ```
31
+
32
+ ## Update
33
+
34
+ ```bash
35
+ karnel update npm --ncu
36
+ ```
37
+
38
+ ## Notes
39
+
40
+ - Command: `ncu`
41
+ - Supports interactive mode with `--interactive`
42
+ - Can upgrade global packages with `-g` flag
43
+