karnel-termux 4.7.7 → 4.9.0

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 (215) hide show
  1. package/README.md +46 -5
  2. package/install.sh +2 -2
  3. package/karnel/cli/commands/backup.sh +13 -2
  4. package/karnel/cli/commands/doctor/fixes.sh +111 -13
  5. package/karnel/cli/commands/doctor.sh +112 -10
  6. package/karnel/cli/commands/init.sh +2 -2
  7. package/karnel/cli/commands/install.sh +155 -118
  8. package/karnel/cli/commands/list.sh +106 -13
  9. package/karnel/cli/commands/open.sh +28 -8
  10. package/karnel/cli/commands/reinstall.sh +79 -46
  11. package/karnel/cli/commands/restore.sh +16 -0
  12. package/karnel/cli/commands/robin.sh +656 -0
  13. package/karnel/cli/commands/search.sh +1 -0
  14. package/karnel/cli/commands/show.sh +1 -0
  15. package/karnel/cli/commands/start.sh +12 -2
  16. package/karnel/cli/commands/status.sh +11 -0
  17. package/karnel/cli/commands/uninstall.sh +47 -0
  18. package/karnel/cli/commands/update.sh +43 -0
  19. package/karnel/cli/commands/version.sh +2 -0
  20. package/karnel/cli/commands/voice.sh +11 -6
  21. package/karnel/cli/karnel.sh +115 -69
  22. package/karnel/modules/ai.sh +21 -6
  23. package/karnel/modules/deploy.sh +4 -0
  24. package/karnel/modules/dev.sh +19 -46
  25. package/karnel/modules/games.sh +81 -4
  26. package/karnel/modules/network.sh +88 -0
  27. package/karnel/modules/osint.sh +123 -0
  28. package/karnel/modules/shell.sh +1 -1
  29. package/karnel/modules/ui.sh +4 -0
  30. package/karnel/modules/utils.sh +88 -0
  31. package/karnel/modules/voice.sh +8 -2
  32. package/karnel/tools/ai/all.sh +1 -0
  33. package/karnel/tools/ai/antigravity-cli/install.sh +0 -0
  34. package/karnel/tools/ai/claude-code/install.sh +0 -0
  35. package/karnel/tools/ai/cline/install.sh +8 -8
  36. package/karnel/tools/ai/codegraph/install.sh +8 -5
  37. package/karnel/tools/ai/codex/install.sh +0 -0
  38. package/karnel/tools/ai/command-code/install.sh +0 -0
  39. package/karnel/tools/ai/copilot-termux/install.sh +0 -0
  40. package/karnel/tools/ai/crush/install.sh +1 -1
  41. package/karnel/tools/ai/ctx7/install.sh +0 -0
  42. package/karnel/tools/ai/engram/install.sh +5 -2
  43. package/karnel/tools/ai/freebuff/install.sh +0 -0
  44. package/karnel/tools/ai/gemini-cli/install.sh +0 -0
  45. package/karnel/tools/ai/gentle-ai/install.sh +1 -1
  46. package/karnel/tools/ai/hermes-agent/install.sh +0 -0
  47. package/karnel/tools/ai/kilocode-cli/install.sh +0 -0
  48. package/karnel/tools/ai/kimchi-code/install.sh +3 -1
  49. package/karnel/tools/ai/kimi-code/install.sh +0 -0
  50. package/karnel/tools/ai/kiro/install.sh +0 -0
  51. package/karnel/tools/ai/mimocode/install.sh +0 -0
  52. package/karnel/tools/ai/minimax-cli/install.sh +0 -0
  53. package/karnel/tools/ai/mistral-vibe/install.sh +0 -0
  54. package/karnel/tools/ai/odysseus/install.sh +0 -0
  55. package/karnel/tools/ai/ollama/install.sh +0 -0
  56. package/karnel/tools/ai/omni-route/install.sh +1 -1
  57. package/karnel/tools/ai/openclaude/install.sh +0 -0
  58. package/karnel/tools/ai/openclaw/install.sh +0 -0
  59. package/karnel/tools/ai/opencode/install.sh +0 -0
  60. package/karnel/tools/ai/openspec/install.sh +0 -0
  61. package/karnel/tools/ai/pi/install.sh +0 -0
  62. package/karnel/tools/ai/qoder/README.md +50 -0
  63. package/karnel/tools/ai/qoder/bin/qodercli +28 -0
  64. package/karnel/tools/ai/qoder/helper/qoder_helper.c +47 -0
  65. package/karnel/tools/ai/qoder/install.sh +367 -0
  66. package/karnel/tools/ai/qwen-code/install.sh +0 -0
  67. package/karnel/tools/auto/all.sh +1 -1
  68. package/karnel/tools/auto/n8n/install.sh +0 -0
  69. package/karnel/tools/db/all.sh +1 -1
  70. package/karnel/tools/db/mariadb/install.sh +0 -0
  71. package/karnel/tools/db/mongodb/install.sh +0 -0
  72. package/karnel/tools/db/postgresql/install.sh +0 -0
  73. package/karnel/tools/db/sqlite/install.sh +0 -0
  74. package/karnel/tools/deploy/all.sh +2 -2
  75. package/karnel/tools/deploy/netlify/install.sh +0 -0
  76. package/karnel/tools/deploy/railway/install.sh +1 -1
  77. package/karnel/tools/deploy/vercel/install.sh +0 -0
  78. package/karnel/tools/dev/all.sh +36 -13
  79. package/karnel/tools/dev/bat/install.sh +0 -0
  80. package/karnel/tools/dev/bc/install.sh +0 -0
  81. package/karnel/tools/dev/cloudflared/install.sh +0 -0
  82. package/karnel/tools/dev/curl/install.sh +0 -0
  83. package/karnel/tools/dev/fzf/install.sh +36 -9
  84. package/karnel/tools/dev/gh/install.sh +0 -0
  85. package/karnel/tools/dev/html2text/install.sh +0 -0
  86. package/karnel/tools/dev/imagemagick/install.sh +0 -0
  87. package/karnel/tools/dev/jq/install.sh +0 -0
  88. package/karnel/tools/dev/lsd/install.sh +0 -0
  89. package/karnel/tools/dev/make/install.sh +0 -0
  90. package/karnel/tools/dev/ncurses/install.sh +0 -0
  91. package/karnel/tools/dev/proot/install.sh +0 -0
  92. package/karnel/tools/dev/shfmt/install.sh +0 -0
  93. package/karnel/tools/dev/snyk/install.sh +0 -0
  94. package/karnel/tools/dev/tmate/install.sh +0 -0
  95. package/karnel/tools/dev/translate/install.sh +0 -0
  96. package/karnel/tools/dev/tree/install.sh +0 -0
  97. package/karnel/tools/dev/udocker/install.sh +0 -0
  98. package/karnel/tools/dev/wget/install.sh +0 -0
  99. package/karnel/tools/editor/all.sh +1 -1
  100. package/karnel/tools/editor/code-server/install.sh +0 -0
  101. package/karnel/tools/games/all.sh +1 -1
  102. package/karnel/tools/games/arcade/install.sh +0 -0
  103. package/karnel/tools/games/buzz/install.sh +0 -0
  104. package/karnel/tools/games/ctfgod/install.sh +0 -0
  105. package/karnel/tools/games/detective/install.sh +0 -0
  106. package/karnel/tools/games/pet-friends/install.sh +0 -0
  107. package/karnel/tools/games/tamagotchi/install.sh +0 -0
  108. package/karnel/tools/lang/all.sh +2 -1
  109. package/karnel/tools/lang/bun/bin/bun +27 -0
  110. package/karnel/tools/lang/bun/install.sh +318 -0
  111. package/karnel/tools/lang/bun/src/bun-shim.c +352 -0
  112. package/karnel/tools/lang/bun/src/bun_wrapper.c +55 -0
  113. package/karnel/tools/lang/clang/install.sh +0 -0
  114. package/karnel/tools/lang/golang/install.sh +0 -0
  115. package/karnel/tools/lang/nodejs/install.sh +0 -0
  116. package/karnel/tools/lang/perl/install.sh +0 -0
  117. package/karnel/tools/lang/php/install.sh +0 -0
  118. package/karnel/tools/lang/python/install.sh +0 -0
  119. package/karnel/tools/lang/rust/install.sh +0 -0
  120. package/karnel/tools/network/all.sh +65 -0
  121. package/karnel/tools/network/dark/README.md +45 -0
  122. package/karnel/tools/network/dark/dark.py +709 -0
  123. package/karnel/tools/network/dark/install.sh +51 -0
  124. package/karnel/tools/network/dedsec-network/README.md +42 -0
  125. package/karnel/tools/network/dedsec-network/dedsec-network.py +709 -0
  126. package/karnel/tools/network/dedsec-network/install.sh +50 -0
  127. package/karnel/tools/npm/all.sh +1 -1
  128. package/karnel/tools/npm/live-server/install.sh +0 -0
  129. package/karnel/tools/npm/localtunnel/install.sh +0 -0
  130. package/karnel/tools/npm/markserv/install.sh +0 -0
  131. package/karnel/tools/npm/ncu/install.sh +0 -0
  132. package/karnel/tools/npm/nestjs/install.sh +0 -0
  133. package/karnel/tools/npm/ngrok/install.sh +0 -0
  134. package/karnel/tools/npm/prettier/install.sh +0 -0
  135. package/karnel/tools/npm/psqlformat/install.sh +0 -0
  136. package/karnel/tools/npm/turbopack/install.sh +2 -0
  137. package/karnel/tools/npm/typescript/install.sh +0 -0
  138. package/karnel/tools/npm/vercel/install.sh +0 -0
  139. package/karnel/tools/osint/all.sh +65 -0
  140. package/karnel/tools/osint/robin/README.md +99 -0
  141. package/karnel/tools/osint/robin/common.sh +258 -0
  142. package/karnel/tools/osint/robin/install.sh +548 -0
  143. package/karnel/tools/osint/robin/requirements-termux.txt +33 -0
  144. package/karnel/tools/shell/all.sh +1 -1
  145. package/karnel/tools/shell/better-npm/install.sh +0 -0
  146. package/karnel/tools/shell/fzf-tab/install.sh +0 -0
  147. package/karnel/tools/shell/history-substring/install.sh +0 -0
  148. package/karnel/tools/shell/powerlevel10k/install.sh +0 -0
  149. package/karnel/tools/shell/you-should-use/install.sh +0 -0
  150. package/karnel/tools/shell/zsh-autopair/install.sh +0 -0
  151. package/karnel/tools/shell/zsh-autosuggestions/install.sh +0 -0
  152. package/karnel/tools/shell/zsh-completions/install.sh +0 -0
  153. package/karnel/tools/shell/zsh-defer/install.sh +0 -0
  154. package/karnel/tools/shell/zsh-syntax-highlighting/install.sh +0 -0
  155. package/karnel/tools/ui/all.sh +1 -1
  156. package/karnel/tools/ui/banner/install.sh +0 -0
  157. package/karnel/tools/ui/cursor/install.sh +0 -0
  158. package/karnel/tools/ui/extra-keys/install.sh +0 -0
  159. package/karnel/tools/ui/font/install.sh +0 -0
  160. package/karnel/tools/utils/all.sh +88 -0
  161. package/karnel/tools/utils/applaunch/README.md +43 -0
  162. package/karnel/tools/{dev → utils}/applaunch/install.sh +3 -3
  163. package/karnel/tools/utils/fconv/README.md +41 -0
  164. package/karnel/tools/{dev → utils}/fconv/install.sh +3 -3
  165. package/karnel/tools/utils/filecheck/README.md +41 -0
  166. package/karnel/tools/{dev → utils}/filecheck/install.sh +3 -3
  167. package/karnel/tools/utils/httptmux/README.md +42 -0
  168. package/karnel/tools/{dev → utils}/httptmux/install.sh +0 -0
  169. package/karnel/tools/utils/notes/README.md +41 -0
  170. package/karnel/tools/{dev → utils}/notes/install.sh +3 -3
  171. package/karnel/tools/utils/passman/README.md +42 -0
  172. package/karnel/tools/{dev → utils}/passman/install.sh +3 -3
  173. package/karnel/tools/utils/qrcode/README.md +41 -0
  174. package/karnel/tools/utils/qrcode/install.sh +50 -0
  175. package/karnel/tools/utils/qrcode/qrcode.py +89 -0
  176. package/karnel/tools/utils/splash/README.md +41 -0
  177. package/karnel/tools/{dev → utils}/splash/install.sh +3 -3
  178. package/karnel/tools/utils/treex/README.md +41 -0
  179. package/karnel/tools/{dev → utils}/treex/install.sh +3 -3
  180. package/karnel/tools/utils/websites/README.md +41 -0
  181. package/karnel/tools/{dev → utils}/websites/install.sh +3 -3
  182. package/karnel/tools/utils/zork/README.md +43 -0
  183. package/karnel/tools/{dev → utils}/zork/install.sh +3 -3
  184. package/karnel/utils/banner.sh +8 -6
  185. package/karnel/utils/bootstrap.sh +1 -1
  186. package/karnel/utils/env.sh +16 -2
  187. package/karnel/utils/log.sh +0 -1
  188. package/karnel/utils/tools.sh +9 -2
  189. package/package.json +6 -1
  190. package/scripts/check-package.js +45 -0
  191. package/scripts/completion.bash +8 -3
  192. package/scripts/completion.zsh +8 -13
  193. package/karnel/cli/commands/doctor/system.sh +0 -87
  194. package/karnel/tools/dev/applaunch/__pycache__/applaunch.cpython-314.pyc +0 -0
  195. package/karnel/tools/dev/fconv/__pycache__/fconv.cpython-314.pyc +0 -0
  196. package/karnel/tools/dev/filecheck/__pycache__/filecheck.cpython-314.pyc +0 -0
  197. package/karnel/tools/dev/notes/__pycache__/notes.cpython-314.pyc +0 -0
  198. package/karnel/tools/dev/passman/__pycache__/passman.cpython-314.pyc +0 -0
  199. package/karnel/tools/dev/splash/__pycache__/splash.cpython-314.pyc +0 -0
  200. package/karnel/tools/dev/websites/__pycache__/websites.cpython-314.pyc +0 -0
  201. package/karnel/tools/games/arcade/__pycache__/arcade.cpython-314.pyc +0 -0
  202. package/karnel/tools/games/buzz/__pycache__/buzz.cpython-314.pyc +0 -0
  203. package/karnel/tools/games/ctfgod/__pycache__/ctfgod.cpython-314.pyc +0 -0
  204. package/karnel/tools/games/detective/__pycache__/detective.cpython-314.pyc +0 -0
  205. package/karnel/tools/games/pet-friends/__pycache__/pet-friends.cpython-314.pyc +0 -0
  206. package/karnel/tools/games/tamagotchi/__pycache__/tamagotchi.cpython-314.pyc +0 -0
  207. package/karnel/tools/games/terminal-arcade/__pycache__/terminal-arcade.cpython-314.pyc +0 -0
  208. /package/karnel/tools/{dev → utils}/applaunch/applaunch.py +0 -0
  209. /package/karnel/tools/{dev → utils}/fconv/fconv.py +0 -0
  210. /package/karnel/tools/{dev → utils}/filecheck/filecheck.py +0 -0
  211. /package/karnel/tools/{dev → utils}/notes/notes.py +0 -0
  212. /package/karnel/tools/{dev → utils}/passman/passman.py +0 -0
  213. /package/karnel/tools/{dev → utils}/splash/splash.py +0 -0
  214. /package/karnel/tools/{dev → utils}/treex/treex.py +0 -0
  215. /package/karnel/tools/{dev → utils}/websites/websites.py +0 -0
@@ -0,0 +1,50 @@
1
+ # Qoder
2
+
3
+ A terminal-native AI coding partner—and an agent engine you can build on.
4
+
5
+ **Package:** qodercli
6
+ **Author:** DevCoreX
7
+ **Repository:** https://github.com/DevCoreXOfficial/karnel-termux
8
+ **Official:** https://qoder.com
9
+ **Type:** AI coding agent (Binary + glibc bootstrapper)
10
+ **License:** Proprietary
11
+
12
+ ## Description
13
+
14
+ Work with Qoder around your codebase from the terminal. Turn ideas into working software - from building and debugging to shipping. Karnel-Termux offers two installation methods: native with glibc support for best performance, or via proot-distro Ubuntu container for maximum compatibility.
15
+
16
+ ## Dependencies
17
+
18
+ - **Native mode:** glibc-repo, glibc, clang, git, ripgrep, jq, nodejs-lts, curl, tar
19
+ - **Proot mode:** proot-distro, curl, ca-certificates
20
+
21
+ ## Install
22
+
23
+ ```bash
24
+ karnel install ai --qoder
25
+ ```
26
+
27
+ You will be prompted to choose:
28
+
29
+ 1. **Native (recommended)** — Compiles a glibc bootstrapper and downloads the latest Qoder binary
30
+ 2. **Proot-distro (alternative)** — Runs Qoder inside an Ubuntu proot-distro container
31
+
32
+ ## Uninstall
33
+
34
+ ```bash
35
+ karnel uninstall ai --qoder
36
+ ```
37
+
38
+ ## Update
39
+
40
+ ```bash
41
+ karnel update ai --qoder
42
+ ```
43
+
44
+ ## Notes
45
+
46
+ - **Native mode** requires `glibc-repo`, `glibc`, `clang`, and other dependencies (installed automatically)
47
+ - The native binary is stored in `~/.local/share/karnel-data/qoder/` and accessible as `qodercli`
48
+ - A small C bootstrapper (`qoder_helper.c`) handles ELF loading via the glibc dynamic linker
49
+ - **Proot mode** uses `proot-distro ubuntu` and installs via the official qoder.com installer
50
+ - Data directory: `~/.local/share/karnel-data/qoder/`
@@ -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/.qodercli:/root/.qodercli" \
26
+ --work-dir $PWD \
27
+ ubuntu \
28
+ -- /root/.qodercli/qodercli "$@"
@@ -0,0 +1,47 @@
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 exec_path[PATH_MAX];
16
+ ssize_t len = readlink("/proc/self/exe", exec_path, sizeof(exec_path) - 1);
17
+ if (len == -1) {
18
+ return 1;
19
+ }
20
+ exec_path[len] = '\0';
21
+ char* dir = dirname(exec_path);
22
+
23
+ char* loader = "/data/data/com.termux/files/usr/glibc/lib/ld-linux-aarch64.so.1";
24
+ char real_bin[] = "/data/data/com.termux/files/home/.local/share/karnel-data/qoder/qodercli";
25
+ char lib_path[] = "/data/data/com.termux/files/usr/glibc/lib";
26
+
27
+ char** new_argv = malloc((argc + 4) * sizeof(char*));
28
+ if (!new_argv) {
29
+ return 1;
30
+ }
31
+
32
+ new_argv[0] = loader;
33
+ new_argv[1] = "--library-path";
34
+ new_argv[2] = lib_path;
35
+ new_argv[3] = real_bin;
36
+
37
+ for (int i = 1; i < argc; i++) {
38
+ new_argv[i + 3] = argv[i];
39
+ }
40
+ new_argv[argc + 3] = NULL;
41
+
42
+ execv(loader, new_argv);
43
+
44
+ perror("execv");
45
+ free(new_argv);
46
+ return 1;
47
+ }
@@ -0,0 +1,367 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+ import "@/utils/colors"
5
+ import "@/utils/version"
6
+
7
+ LOG_FILE="$KARNEL_CACHE/install_ai.log"
8
+ QODER_DATA_DIR="$HOME/.local/share/karnel-data/qoder"
9
+ QODER_MANIFEST_URL="https://qoder-ide.oss-accelerate.aliyuncs.com/qodercli/channels/manifest.json"
10
+
11
+ _qoder_detect_ubuntu_root() {
12
+ local root
13
+ root="$(find /data/data/com.termux -maxdepth 10 -type d \
14
+ -name "rootfs" -path "*/containers/ubuntu/*" 2>/dev/null | head -1)"
15
+
16
+ if [ -z "$root" ]; then
17
+ root="$(find /data/data/com.termux -maxdepth 10 -type d \
18
+ -name "ubuntu" -path "*/installed-rootfs/*" 2>/dev/null | head -1)"
19
+ fi
20
+
21
+ echo "$root"
22
+ }
23
+
24
+ _qoder_proot_ubuntu() {
25
+ proot-distro login \
26
+ --shared-tmp \
27
+ ubuntu \
28
+ -- "$@"
29
+ }
30
+
31
+ _get_latest_qoder_version() {
32
+ curl -fsSL "$QODER_MANIFEST_URL" |
33
+ sed -n 's/.*"latest"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p'
34
+ }
35
+
36
+ _get_qoder_download_url() {
37
+ local arch="${1:-arm64}"
38
+ local manifest
39
+ manifest="$(curl -fsSL "$QODER_MANIFEST_URL")"
40
+
41
+ printf '%s' "$manifest" | tr -d '\n\r\t ' | sed 's/},{/}\n{/g' |
42
+ grep -F '"os":"linux"' | grep -F "\"arch\":\"$arch\"" | head -n1 |
43
+ sed -n 's/.*"url"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p'
44
+ }
45
+
46
+ _qoder_install_deps_native() {
47
+ loading "Installing glibc and dependencies" _qoder_install_deps_native_impl
48
+ }
49
+
50
+ _qoder_install_deps_native_impl() {
51
+ if [[ ! -f $PREFIX/etc/apt/sources.list.d/glibc.list ]]; then
52
+ if ! yes | pkg install glibc-repo &>>"$LOG_FILE"; then
53
+ log_error "Failed to install glibc-repo"
54
+ return 1
55
+ fi
56
+ fi
57
+
58
+ if [[ ! -f $PREFIX/glibc/lib/libc.so.6 ]]; then
59
+ if ! yes | pkg install glibc &>>"$LOG_FILE"; then
60
+ log_error "Failed to install glibc"
61
+ return 1
62
+ fi
63
+ fi
64
+
65
+ declare -A DEPS=(
66
+ ["git"]="git"
67
+ ["ripgrep"]="rg"
68
+ ["clang"]="clang"
69
+ ["jq"]="jq"
70
+ ["nodejs-lts"]="node"
71
+ ["curl"]="curl"
72
+ ["tar"]="tar"
73
+ )
74
+
75
+ local pkg_name bin_name
76
+ for pkg_name in "${!DEPS[@]}"; do
77
+ bin_name="${DEPS[$pkg_name]}"
78
+ if ! command -v "$bin_name" &>/dev/null; then
79
+ if ! yes | pkg install "$pkg_name" &>>"$LOG_FILE"; then
80
+ log_error "Failed to install $pkg_name"
81
+ return 1
82
+ fi
83
+ fi
84
+ done
85
+
86
+ return 0
87
+ }
88
+
89
+ _download_qoder_binary() {
90
+ loading "Downloading Qoder" _download_qoder_binary_impl
91
+ }
92
+
93
+ _download_qoder_binary_impl() {
94
+ local latest_version
95
+ latest_version=$(_get_latest_qoder_version)
96
+ if [ -z "$latest_version" ]; then
97
+ log_error "Failed to fetch latest Qoder version"
98
+ return 1
99
+ fi
100
+
101
+ local download_url
102
+ download_url=$(_get_qoder_download_url "arm64")
103
+ if [ -z "$download_url" ]; then
104
+ log_error "No download URL found for linux/arm64"
105
+ return 1
106
+ fi
107
+
108
+ mkdir -p "$QODER_DATA_DIR"
109
+
110
+ local archive_filename
111
+ archive_filename=$(basename "$download_url")
112
+
113
+ if ! curl -fsSL "$download_url" -o "$QODER_DATA_DIR/$archive_filename" &>>"$LOG_FILE"; then
114
+ log_error "Failed to download Qoder binary"
115
+ return 1
116
+ fi
117
+
118
+ if ! tar -zxf "$QODER_DATA_DIR/$archive_filename" -C "$QODER_DATA_DIR" &>>"$LOG_FILE"; then
119
+ log_error "Failed to extract Qoder binary"
120
+ return 1
121
+ fi
122
+
123
+ rm -f "$QODER_DATA_DIR/$archive_filename"
124
+
125
+ if [ ! -f "$QODER_DATA_DIR/qodercli" ]; then
126
+ log_error "Qoder binary not found after extraction"
127
+ return 1
128
+ fi
129
+
130
+ chmod +x "$QODER_DATA_DIR/qodercli"
131
+ return 0
132
+ }
133
+
134
+ _compile_qoder_helper() {
135
+ loading "Compiling helper" _compile_qoder_helper_impl
136
+ }
137
+
138
+ _compile_qoder_helper_impl() {
139
+ local HELPER_SRC="$KARNEL_PATH/tools/ai/qoder/helper/qoder_helper.c"
140
+ if [ ! -f "$HELPER_SRC" ]; then
141
+ log_error "Helper source not found at $HELPER_SRC"
142
+ return 1
143
+ fi
144
+
145
+ if ! clang -O2 -o "$PREFIX/bin/qodercli" "$HELPER_SRC" &>>"$LOG_FILE"; then
146
+ log_error "Failed to compile qoder helper"
147
+ return 1
148
+ fi
149
+
150
+ chmod +x "$PREFIX/bin/qodercli"
151
+ return 0
152
+ }
153
+
154
+ _install_qoder_native() {
155
+ _qoder_install_deps_native || return 1
156
+ _download_qoder_binary || return 1
157
+ _compile_qoder_helper || return 1
158
+ log_success "Qoder installed natively"
159
+ return 0
160
+ }
161
+
162
+ _install_qoder_proot() {
163
+ loading "Installing Qoder (proot-distro)" _install_qoder_proot_impl
164
+ }
165
+
166
+ _install_qoder_proot_impl() {
167
+ mkdir -p "$(dirname "$LOG_FILE")"
168
+
169
+ if ! command -v proot-distro &>/dev/null; then
170
+ yes | pkg install proot-distro &>>"$LOG_FILE"
171
+ fi
172
+
173
+ if [ ! -d "$(_qoder_detect_ubuntu_root)" ]; then
174
+ proot-distro install ubuntu:24.04 &>>"$LOG_FILE"
175
+ fi
176
+
177
+ _qoder_proot_ubuntu /bin/bash -c \
178
+ 'apt-get update && apt-get upgrade -y && apt-get install -y curl ca-certificates' \
179
+ &>>"$LOG_FILE"
180
+
181
+ local download_url
182
+ download_url=$(_get_qoder_download_url "arm64")
183
+ if [ -z "$download_url" ]; then
184
+ log_error "No download URL found for linux/arm64"
185
+ return 1
186
+ fi
187
+
188
+ local ubuntu_root
189
+ ubuntu_root="$(_qoder_detect_ubuntu_root)"
190
+ if [ -z "$ubuntu_root" ]; then
191
+ log_error "Ubuntu rootfs not found"
192
+ return 1
193
+ fi
194
+
195
+ local qoder_dir="$ubuntu_root/root/.qodercli"
196
+ mkdir -p "$qoder_dir"
197
+
198
+ local archive_filename
199
+ archive_filename=$(basename "$download_url")
200
+
201
+ if ! curl -fsSL "$download_url" -o "$qoder_dir/$archive_filename" &>>"$LOG_FILE"; then
202
+ log_error "Failed to download Qoder binary"
203
+ return 1
204
+ fi
205
+
206
+ if ! tar -zxf "$qoder_dir/$archive_filename" -C "$qoder_dir" &>>"$LOG_FILE"; then
207
+ log_error "Failed to extract Qoder binary"
208
+ return 1
209
+ fi
210
+
211
+ rm -f "$qoder_dir/$archive_filename"
212
+
213
+ if [ ! -f "$qoder_dir/qodercli" ]; then
214
+ log_error "Qoder binary not found after extraction"
215
+ return 1
216
+ fi
217
+
218
+ chmod +x "$qoder_dir/qodercli"
219
+
220
+ local wrapper_src="$KARNEL_PATH/tools/ai/qoder/bin/qodercli"
221
+ if [ ! -f "$wrapper_src" ]; then
222
+ log_error "Wrapper template not found at $wrapper_src"
223
+ return 1
224
+ fi
225
+ sed "s|__UBUNTU_ROOTFS__|$ubuntu_root|g" "$wrapper_src" >"$PREFIX/bin/qodercli"
226
+ chmod +x "$PREFIX/bin/qodercli"
227
+
228
+ if ! grep -q '.qodercli' "$ubuntu_root/root/.bashrc" 2>/dev/null; then
229
+ printf '\n# qoder\nexport PATH=/root/.qodercli:$PATH\n' >>"$ubuntu_root/root/.bashrc"
230
+ fi
231
+
232
+ return 0
233
+ }
234
+
235
+ install_qoder() {
236
+ if command -v qodercli &>/dev/null; then
237
+ log_info "Qoder is already installed"
238
+ return 2
239
+ fi
240
+
241
+ log_info "Select installation method for Qoder:"
242
+
243
+ read_select "Installation method" SELECTED_METHOD \
244
+ "Native (recommended) - Compile with glibc support" \
245
+ "Proot-distro (alternative) - Ubuntu container"
246
+
247
+ case "$SELECTED_METHOD" in
248
+ *Native*)
249
+ _install_qoder_native
250
+ ;;
251
+ *Proot-distro*)
252
+ _install_qoder_proot
253
+ ;;
254
+ esac
255
+ }
256
+
257
+ uninstall_qoder() {
258
+ mkdir -p "$(dirname "$LOG_FILE")"
259
+
260
+ if [ ! -f "$PREFIX/bin/qodercli" ]; then
261
+ log_warn "Qoder is not installed"
262
+ return 1
263
+ fi
264
+
265
+ loading "Uninstalling Qoder" _uninstall_qoder_impl
266
+ }
267
+
268
+ _uninstall_qoder_impl() {
269
+ if [ -f "$QODER_DATA_DIR/qodercli" ]; then
270
+ rm -f "$PREFIX/bin/qodercli"
271
+ rm -rf "$QODER_DATA_DIR"
272
+ log_success "Qoder (native) uninstalled"
273
+ return 0
274
+ fi
275
+
276
+ _qoder_proot_ubuntu /bin/bash -c 'rm -rf /root/.qodercli' &>>"$LOG_FILE"
277
+
278
+ local ubuntu_bashrc
279
+ ubuntu_bashrc="$(_qoder_detect_ubuntu_root)/root/.bashrc"
280
+
281
+ if [ -f "$ubuntu_bashrc" ]; then
282
+ sed -i '/# qoder/d; /export PATH=\/root\/.qodercli:/d' "$ubuntu_bashrc"
283
+ fi
284
+
285
+ if rm -f "$PREFIX/bin/qodercli" &>>"$LOG_FILE"; then
286
+ log_success "Qoder (proot-distro) uninstalled"
287
+ return 0
288
+ else
289
+ log_error "Failed to uninstall Qoder"
290
+ return 1
291
+ fi
292
+ }
293
+
294
+ _update_qoder() {
295
+ _update_qoder_impl
296
+ }
297
+
298
+ _update_qoder_impl() {
299
+ mkdir -p "$(dirname "$LOG_FILE")"
300
+
301
+ if [ -f "$QODER_DATA_DIR/qodercli" ]; then
302
+ _install_qoder_native
303
+ return $?
304
+ fi
305
+
306
+ loading "Updating Qoder (proot-distro)" _update_qoder_proot_impl
307
+ }
308
+
309
+ _get_remote_qoder_version() {
310
+ _spin_capture "Checking Qoder" _get_latest_qoder_version
311
+ }
312
+
313
+ update_qoder() {
314
+ _check_update_needed "Qoder" "$(_get_installed_version qodercli)" "$(_get_remote_qoder_version)" _update_qoder
315
+ }
316
+
317
+ _update_qoder_proot_impl() {
318
+ local ubuntu_root
319
+ ubuntu_root="$(_qoder_detect_ubuntu_root)"
320
+
321
+ if [ -z "$ubuntu_root" ]; then
322
+ log_error "Ubuntu rootfs not found"
323
+ return 1
324
+ fi
325
+
326
+ rm -rf "$ubuntu_root/root/.qodercli"
327
+
328
+ local download_url
329
+ download_url=$(_get_qoder_download_url "arm64")
330
+ if [ -z "$download_url" ]; then
331
+ log_error "No download URL found for linux/arm64"
332
+ return 1
333
+ fi
334
+
335
+ local qoder_dir="$ubuntu_root/root/.qodercli"
336
+ mkdir -p "$qoder_dir"
337
+
338
+ local archive_filename
339
+ archive_filename=$(basename "$download_url")
340
+
341
+ if ! curl -fsSL "$download_url" -o "$qoder_dir/$archive_filename" &>>"$LOG_FILE"; then
342
+ log_error "Failed to download Qoder binary"
343
+ return 1
344
+ fi
345
+
346
+ if ! tar -zxf "$qoder_dir/$archive_filename" -C "$qoder_dir" &>>"$LOG_FILE"; then
347
+ log_error "Failed to extract Qoder binary"
348
+ return 1
349
+ fi
350
+
351
+ rm -f "$qoder_dir/$archive_filename"
352
+
353
+ if [ ! -f "$qoder_dir/qodercli" ]; then
354
+ log_error "Qoder binary not found after extraction"
355
+ return 1
356
+ fi
357
+
358
+ chmod +x "$qoder_dir/qodercli"
359
+
360
+ log_success "Qoder (proot-distro) updated"
361
+ return 0
362
+ }
363
+
364
+ reinstall_qoder() {
365
+ uninstall_qoder
366
+ install_qoder
367
+ }
File without changes
@@ -36,7 +36,7 @@ _batch_auto() {
36
36
  done
37
37
 
38
38
  progress_done "$total"
39
- eval "$count_var=$count"
39
+ printf -v "$count_var" '%s' "$count"
40
40
  return $failed
41
41
  }
42
42
 
File without changes
@@ -40,7 +40,7 @@ _batch_db() {
40
40
  done
41
41
 
42
42
  progress_done "$total"
43
- eval "$count_var=$count"
43
+ printf -v "$count_var" '%s' "$count"
44
44
  return $failed
45
45
  }
46
46
 
File without changes
File without changes
File without changes
File without changes
@@ -4,7 +4,7 @@ import "@/utils/log"
4
4
 
5
5
  LOG_FILE="$KARNEL_CACHE/install_deploy.log"
6
6
 
7
- DEPLOY_TOOLS=("vercel" "railway" "netlify")
7
+ DEPLOY_TOOLS=("railway" "netlify" "vercel")
8
8
 
9
9
  for _tool in "${DEPLOY_TOOLS[@]}"; do
10
10
  source "$(dirname "$BASH_SOURCE")/$_tool/install.sh"
@@ -33,7 +33,7 @@ _batch_deploy() {
33
33
  done
34
34
 
35
35
  progress_done "$total"
36
- eval "$count_var=$count"
36
+ printf -v "$count_var" '%s' "$count"
37
37
  return $failed
38
38
  }
39
39
 
File without changes
@@ -83,7 +83,7 @@ install_railway() {
83
83
 
84
84
  uninstall_railway() {
85
85
  log_info "Uninstalling Railway CLI..."
86
- npm uninstall -g @railway/cli &>>"$LOG_FILE" 2>/dev/null || true
86
+ npm uninstall -g @railway/cli &>>"$LOG_FILE" || true
87
87
  rm -f "$PREFIX/bin/railway" 2>/dev/null
88
88
  rm -rf "$RAILWAY_DATA_DIR" 2>/dev/null
89
89
  log_success "Railway CLI uninstalled"
File without changes
@@ -27,23 +27,41 @@ TOOLS_PACKAGES=(
27
27
  "make"
28
28
  "udocker"
29
29
  "snyk"
30
- "httptmux"
31
- "zork"
32
- "fconv"
33
- "filecheck"
34
- "websites"
35
- "notes"
36
- "treex"
37
- "passman"
38
- "applaunch"
39
- "splash"
30
+ )
31
+
32
+ TOOLS_DISPLAY=(
33
+ "GitHub CLI"
34
+ "Wget"
35
+ "Curl"
36
+ "LSD (ls replacement)"
37
+ "Bat (cat replacement)"
38
+ "Proot (chroot alternative)"
39
+ "Ncurses Utils"
40
+ "Tmate (terminal sharing)"
41
+ "OpenSSH"
42
+ "Tmux"
43
+ "Cloudflared (Cloudflare Tunnel)"
44
+ "Translate Shell"
45
+ "html2text (HTML to text converter)"
46
+ "jq (JSON processor)"
47
+ "bc (calculator)"
48
+ "Tree (directory listing)"
49
+ "Fzf (fuzzy finder)"
50
+ "ImageMagick (image manipulation)"
51
+ "Shfmt (shell script formatter)"
52
+ "Make (build automation)"
53
+ "Udocker (container management)"
54
+ "Snyk (security scanner)"
40
55
  )
41
56
 
42
57
  for _tool in "${TOOLS_PACKAGES[@]}"; do
43
- source "$(dirname "$BASH_SOURCE")/$_tool/install.sh"
58
+ # shellcheck disable=SC1090
59
+ source "$(dirname "${BASH_SOURCE[0]}")/$_tool/install.sh"
44
60
  done
45
61
  unset _tool
46
62
 
63
+ declare -gA _INSTALL_RESULTS
64
+
47
65
  _batch_dev() {
48
66
  local action="$1"
49
67
  local action_past="$2"
@@ -54,20 +72,25 @@ _batch_dev() {
54
72
  local current=0
55
73
  local func_name
56
74
 
75
+ _INSTALL_RESULTS=()
57
76
  progress_start "$total" "${action_past}ing dev tools..."
58
77
 
59
78
  for tool in "${TOOLS_PACKAGES[@]}"; do
60
79
  func_name="${action}_${tool//-/_}"
61
80
  if declare -f "$func_name" &>/dev/null; then
62
81
  loading "${action_past^}ing ${tool}" "$func_name"
63
- case $? in 0) ((count++));; 1) ((failed++));; esac
82
+ _INSTALL_RESULTS["$tool"]=$?
83
+ case ${_INSTALL_RESULTS["$tool"]} in
84
+ 0) ((count++));;
85
+ 1) ((failed++));;
86
+ esac
64
87
  fi
65
88
  ((current++))
66
89
  progress_update "$current" "$total"
67
90
  done
68
91
 
69
92
  progress_done "$total"
70
- eval "$count_var=$count"
93
+ printf -v "$count_var" '%s' "$count"
71
94
  return $failed
72
95
  }
73
96
 
File without changes
File without changes
File without changes
File without changes