karnel-termux 4.16.6 → 4.17.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 (182) hide show
  1. package/install.sh +25 -7
  2. package/karnel/RELEASE_COMMIT +1 -1
  3. package/karnel/bin/karnel +2 -1
  4. package/karnel/cli/commands/doctor/fixes.sh +2 -2
  5. package/karnel/cli/commands/help.sh +0 -0
  6. package/karnel/cli/commands/init.sh +21 -21
  7. package/karnel/cli/commands/update.sh +29 -4
  8. package/karnel/tools/ai/all.sh +0 -0
  9. package/karnel/tools/ai/antigravity-cli/install.sh +0 -0
  10. package/karnel/tools/ai/cactus/install.sh +1 -1
  11. package/karnel/tools/ai/claude-code/install.sh +0 -0
  12. package/karnel/tools/ai/cline/bin/cline +0 -0
  13. package/karnel/tools/ai/cline/install.sh +0 -0
  14. package/karnel/tools/ai/codebuff/bin/codebuff +0 -0
  15. package/karnel/tools/ai/codebuff/install.sh +0 -0
  16. package/karnel/tools/ai/codegraph/install.sh +0 -0
  17. package/karnel/tools/ai/codex/install.sh +0 -0
  18. package/karnel/tools/ai/command-code/install.sh +0 -0
  19. package/karnel/tools/ai/copilot-termux/install.sh +0 -0
  20. package/karnel/tools/ai/crush/install.sh +0 -0
  21. package/karnel/tools/ai/ctx7/install.sh +0 -0
  22. package/karnel/tools/ai/engram/install.sh +0 -0
  23. package/karnel/tools/ai/gemini-cli/install.sh +0 -0
  24. package/karnel/tools/ai/gentle-ai/install.sh +0 -0
  25. package/karnel/tools/ai/gga/install.sh +0 -0
  26. package/karnel/tools/ai/gga/termux.patch +0 -0
  27. package/karnel/tools/ai/hermes-agent/install.sh +0 -0
  28. package/karnel/tools/ai/kilocode-cli/install.sh +0 -0
  29. package/karnel/tools/ai/kimchi-code/install.sh +6 -0
  30. package/karnel/tools/ai/kimi-code/install.sh +0 -0
  31. package/karnel/tools/ai/kiro/install.sh +0 -0
  32. package/karnel/tools/ai/mimocode/install.sh +0 -0
  33. package/karnel/tools/ai/minimax-cli/install.sh +0 -0
  34. package/karnel/tools/ai/mistral-vibe/install.sh +0 -0
  35. package/karnel/tools/ai/odysseus/install.sh +0 -0
  36. package/karnel/tools/ai/ollama/install.sh +0 -0
  37. package/karnel/tools/ai/omni-route/install.sh +0 -0
  38. package/karnel/tools/ai/openclaude/install.sh +0 -0
  39. package/karnel/tools/ai/openclaw/install.sh +0 -0
  40. package/karnel/tools/ai/opencode/install.sh +13 -2
  41. package/karnel/tools/ai/openspec/install.sh +0 -0
  42. package/karnel/tools/ai/pi/install.sh +0 -0
  43. package/karnel/tools/ai/qwen-code/install.sh +0 -0
  44. package/karnel/tools/ai/walkie/install.sh +4 -2
  45. package/karnel/tools/auto/n8n/install.sh +0 -0
  46. package/karnel/tools/db/mariadb/install.sh +0 -0
  47. package/karnel/tools/db/mongodb/install.sh +0 -0
  48. package/karnel/tools/db/postgresql/install.sh +0 -0
  49. package/karnel/tools/db/redis/install.sh +0 -0
  50. package/karnel/tools/db/sqlite/install.sh +0 -0
  51. package/karnel/tools/deploy/netlify/install.sh +7 -0
  52. package/karnel/tools/deploy/railway/install.sh +9 -0
  53. package/karnel/tools/deploy/vercel/install.sh +7 -0
  54. package/karnel/tools/dev/bat/install.sh +0 -0
  55. package/karnel/tools/dev/bc/install.sh +0 -0
  56. package/karnel/tools/dev/cloudflared/install.sh +0 -0
  57. package/karnel/tools/dev/curl/install.sh +0 -0
  58. package/karnel/tools/dev/fzf/install.sh +0 -0
  59. package/karnel/tools/dev/gh/install.sh +0 -0
  60. package/karnel/tools/dev/html2text/install.sh +0 -0
  61. package/karnel/tools/dev/imagemagick/install.sh +0 -0
  62. package/karnel/tools/dev/jq/install.sh +0 -0
  63. package/karnel/tools/dev/lsd/install.sh +0 -0
  64. package/karnel/tools/dev/make/install.sh +0 -0
  65. package/karnel/tools/dev/ncurses/install.sh +0 -0
  66. package/karnel/tools/dev/openssh/install.sh +0 -0
  67. package/karnel/tools/dev/proot/install.sh +0 -0
  68. package/karnel/tools/dev/shfmt/install.sh +0 -0
  69. package/karnel/tools/dev/snyk/install.sh +0 -0
  70. package/karnel/tools/dev/tmate/install.sh +0 -0
  71. package/karnel/tools/dev/tmux/install.sh +0 -0
  72. package/karnel/tools/dev/translate/install.sh +0 -0
  73. package/karnel/tools/dev/tree/install.sh +0 -0
  74. package/karnel/tools/dev/udocker/install.sh +0 -0
  75. package/karnel/tools/dev/wget/install.sh +0 -0
  76. package/karnel/tools/editor/code-server/install.sh +0 -0
  77. package/karnel/tools/editor/neovim/install.sh +0 -0
  78. package/karnel/tools/editor/nvchad/install.sh +0 -0
  79. package/karnel/tools/games/arcade/install.sh +0 -0
  80. package/karnel/tools/games/buzz/install.sh +0 -0
  81. package/karnel/tools/games/ctfgod/install.sh +0 -0
  82. package/karnel/tools/games/detective/install.sh +0 -0
  83. package/karnel/tools/games/pet-friends/install.sh +0 -0
  84. package/karnel/tools/games/tamagotchi/install.sh +0 -0
  85. package/karnel/tools/lang/bun/bin/bunx +0 -0
  86. package/karnel/tools/lang/bun/install.sh +7 -1
  87. package/karnel/tools/lang/clang/install.sh +0 -0
  88. package/karnel/tools/lang/golang/install.sh +0 -0
  89. package/karnel/tools/lang/nodejs/install.sh +0 -0
  90. package/karnel/tools/lang/perl/install.sh +0 -0
  91. package/karnel/tools/lang/php/install.sh +0 -0
  92. package/karnel/tools/lang/python/install.sh +0 -0
  93. package/karnel/tools/lang/rust/install.sh +0 -0
  94. package/karnel/tools/network/dark/install.sh +0 -0
  95. package/karnel/tools/network/dedsec-network/install.sh +0 -0
  96. package/karnel/tools/npm/live-server/install.sh +0 -0
  97. package/karnel/tools/npm/localtunnel/install.sh +0 -0
  98. package/karnel/tools/npm/markserv/install.sh +0 -0
  99. package/karnel/tools/npm/ncu/install.sh +0 -0
  100. package/karnel/tools/npm/nestjs/install.sh +0 -0
  101. package/karnel/tools/npm/ngrok/install.sh +0 -0
  102. package/karnel/tools/npm/prettier/install.sh +0 -0
  103. package/karnel/tools/npm/psqlformat/install.sh +0 -0
  104. package/karnel/tools/npm/turbopack/install.sh +2 -2
  105. package/karnel/tools/npm/typescript/install.sh +0 -0
  106. package/karnel/tools/npm/vercel/install.sh +0 -0
  107. package/karnel/tools/osint/robin/common.sh +0 -0
  108. package/karnel/tools/osint/robin/install.sh +0 -0
  109. package/karnel/tools/security/aircrack-ng/install.sh +0 -0
  110. package/karnel/tools/security/amass/install.sh +0 -0
  111. package/karnel/tools/security/binwalk/install.sh +0 -0
  112. package/karnel/tools/security/burpsuite/install.sh +0 -0
  113. package/karnel/tools/security/dirb/install.sh +0 -0
  114. package/karnel/tools/security/dnsrecon/install.sh +0 -0
  115. package/karnel/tools/security/enum4linux/install.sh +0 -0
  116. package/karnel/tools/security/exiftool/install.sh +0 -0
  117. package/karnel/tools/security/ffuf/install.sh +0 -0
  118. package/karnel/tools/security/foremost/install.sh +0 -0
  119. package/karnel/tools/security/gobuster/install.sh +0 -0
  120. package/karnel/tools/security/hashcat/install.sh +0 -0
  121. package/karnel/tools/security/hydra/install.sh +0 -0
  122. package/karnel/tools/security/john/install.sh +0 -0
  123. package/karnel/tools/security/masscan/install.sh +0 -0
  124. package/karnel/tools/security/metasploit/install.sh +0 -0
  125. package/karnel/tools/security/netcat/install.sh +0 -0
  126. package/karnel/tools/security/nikto/install.sh +0 -0
  127. package/karnel/tools/security/nmap/install.sh +0 -0
  128. package/karnel/tools/security/smbclient/install.sh +0 -0
  129. package/karnel/tools/security/sqlmap/install.sh +0 -0
  130. package/karnel/tools/security/steghide/install.sh +0 -0
  131. package/karnel/tools/security/subfinder/install.sh +0 -0
  132. package/karnel/tools/security/tcpdump/install.sh +0 -0
  133. package/karnel/tools/security/theharvester/install.sh +0 -0
  134. package/karnel/tools/security/wafw00f/install.sh +0 -0
  135. package/karnel/tools/security/whatweb/install.sh +0 -0
  136. package/karnel/tools/security/whois/install.sh +0 -0
  137. package/karnel/tools/security/wpscan/install.sh +0 -0
  138. package/karnel/tools/security/zap/install.sh +0 -0
  139. package/karnel/tools/shell/better-npm/install.sh +0 -0
  140. package/karnel/tools/shell/fzf-tab/install.sh +0 -0
  141. package/karnel/tools/shell/history-substring/install.sh +0 -0
  142. package/karnel/tools/shell/powerlevel10k/install.sh +0 -0
  143. package/karnel/tools/shell/you-should-use/install.sh +0 -0
  144. package/karnel/tools/shell/zsh-autopair/install.sh +0 -0
  145. package/karnel/tools/shell/zsh-autosuggestions/install.sh +0 -0
  146. package/karnel/tools/shell/zsh-completions/install.sh +0 -0
  147. package/karnel/tools/shell/zsh-defer/install.sh +1 -1
  148. package/karnel/tools/shell/zsh-syntax-highlighting/install.sh +0 -0
  149. package/karnel/tools/ui/banner/install.sh +0 -0
  150. package/karnel/tools/ui/cursor/install.sh +0 -0
  151. package/karnel/tools/ui/extra-keys/install.sh +0 -0
  152. package/karnel/tools/ui/font/install.sh +0 -0
  153. package/karnel/tools/utils/applaunch/applaunch.py +0 -0
  154. package/karnel/tools/utils/applaunch/install.sh +0 -0
  155. package/karnel/tools/utils/fconv/fconv.py +0 -0
  156. package/karnel/tools/utils/fconv/install.sh +0 -0
  157. package/karnel/tools/utils/filecheck/filecheck.py +0 -0
  158. package/karnel/tools/utils/filecheck/install.sh +0 -0
  159. package/karnel/tools/utils/httptmux/install.sh +0 -0
  160. package/karnel/tools/utils/notes/install.sh +0 -0
  161. package/karnel/tools/utils/notes/notes.py +0 -0
  162. package/karnel/tools/utils/passman/install.sh +0 -0
  163. package/karnel/tools/utils/passman/passman.py +0 -0
  164. package/karnel/tools/utils/qrcode/install.sh +0 -0
  165. package/karnel/tools/utils/qrcode/qrcode.py +0 -0
  166. package/karnel/tools/utils/splash/install.sh +0 -0
  167. package/karnel/tools/utils/splash/splash.py +0 -0
  168. package/karnel/tools/utils/treex/install.sh +0 -0
  169. package/karnel/tools/utils/treex/treex.py +0 -0
  170. package/karnel/tools/utils/websites/install.sh +0 -0
  171. package/karnel/tools/utils/websites/websites.py +0 -0
  172. package/karnel/tools/utils/zork/install.sh +0 -0
  173. package/karnel/tools/utils/zork/zork.sh +0 -0
  174. package/karnel/utils/agent_actions.sh +46 -5
  175. package/karnel/utils/agent_llm.sh +64 -28
  176. package/karnel/utils/bootstrap.sh +4 -2
  177. package/karnel/utils/install.sh +7 -1
  178. package/karnel/utils/tools.sh +4 -0
  179. package/karnel/utils/uninstall.sh +2 -1
  180. package/package.json +1 -1
  181. package/scripts/check-package.js +15 -5
  182. package/scripts/npm-install.js +20 -1
package/install.sh CHANGED
@@ -79,7 +79,9 @@ _INSTALL_KARNEL_SYMLINK_CHANGED=false
79
79
  _INSTALL_PREVIOUS_KARNEL_SYMLINK=""
80
80
 
81
81
  _cleanup_failed() {
82
- echo -e "\n ${P_FAIL}✖${P_NC} Installation failed at step ${CURRENT_STEP}. Cleaning up..."
82
+ set +e
83
+ trap - ERR
84
+ echo -e "\n ${P_FAIL}✖${P_NC} Installation failed at step ${CURRENT_STEP}. Cleaning up..."
83
85
  if $_INSTALL_KARNEL_SYMLINK_CHANGED; then
84
86
  if [[ -n "$_INSTALL_PREVIOUS_KARNEL_SYMLINK" ]]; then
85
87
  local rollback_link_dir
@@ -145,7 +147,7 @@ bootstrap_dependencies() {
145
147
 
146
148
  if [[ $needed_tput -eq 1 ]]; then
147
149
  echo -e " ${P_BORDER}→${P_NC} Installing ncurses-utils..."
148
- pkg install -y ncurses-utils &>/dev/null
150
+ pkg install -y ncurses-utils &>/dev/null || true
149
151
  echo -e " ${P_OK}✔${P_NC} ncurses installed"
150
152
  echo
151
153
  fi
@@ -153,7 +155,7 @@ bootstrap_dependencies() {
153
155
  if [[ $needed_git -eq 1 ]]; then
154
156
  log_info "Installing git..."
155
157
  progress_bar 0 10
156
- pkg install -y git &>/dev/null
158
+ pkg install -y git &>/dev/null || true
157
159
  progress_bar 10 10
158
160
  echo
159
161
  log_ok "git installed"
@@ -162,7 +164,7 @@ bootstrap_dependencies() {
162
164
  if [[ $needed_glow -eq 1 ]]; then
163
165
  log_info "Installing glow..."
164
166
  progress_bar 0 10
165
- pkg install -y glow &>/dev/null
167
+ pkg install -y glow &>/dev/null || true
166
168
  progress_bar 10 10
167
169
  echo
168
170
  log_ok "glow installed"
@@ -171,7 +173,7 @@ bootstrap_dependencies() {
171
173
  if [[ $needed_gh -eq 1 ]]; then
172
174
  log_info "Installing gh (GitHub CLI)..."
173
175
  progress_bar 0 10
174
- pkg install -y gh &>/dev/null
176
+ pkg install -y gh &>/dev/null || true
175
177
  progress_bar 10 10
176
178
  echo
177
179
  log_ok "gh installed"
@@ -180,7 +182,7 @@ bootstrap_dependencies() {
180
182
  if [[ $needed_rg -eq 1 ]]; then
181
183
  log_info "Installing ripgrep..."
182
184
  progress_bar 0 10
183
- pkg install -y ripgrep &>/dev/null
185
+ pkg install -y ripgrep &>/dev/null || true
184
186
  progress_bar 10 10
185
187
  echo
186
188
  log_ok "ripgrep installed"
@@ -287,7 +289,23 @@ clone_repo() {
287
289
  log_fail "Failed to clone repository"
288
290
  return 1
289
291
  fi
290
- if [[ -n "$RELEASE_REF" ]]; then
292
+ if [[ -n "$RELEASE_COMMIT" ]]; then
293
+ if ! git -C "$candidate_repo" fetch --depth=1 origin "$RELEASE_COMMIT" &>/dev/null; then
294
+ log_fail "Failed to fetch release commit $RELEASE_COMMIT"
295
+ return 1
296
+ fi
297
+ if ! git -C "$candidate_repo" checkout --quiet --detach "$RELEASE_COMMIT" &>/dev/null; then
298
+ log_fail "Failed to checkout release commit $RELEASE_COMMIT"
299
+ return 1
300
+ fi
301
+ local candidate_commit
302
+ candidate_commit=$(git -C "$candidate_repo" rev-parse HEAD 2>/dev/null) || return 1
303
+ if [[ "$candidate_commit" != "$RELEASE_COMMIT" ]]; then
304
+ log_fail "Release commit mismatch"
305
+ log_info "Expected $RELEASE_COMMIT, got $candidate_commit"
306
+ return 1
307
+ fi
308
+ elif [[ -n "$RELEASE_REF" ]]; then
291
309
  local candidate_commit
292
310
  candidate_commit=$(git -C "$candidate_repo" rev-parse HEAD 2>/dev/null) || return 1
293
311
  if [[ "$candidate_commit" != "$RELEASE_COMMIT" ]]; then
@@ -1 +1 @@
1
- 8fe9d579a4a8d7fbcab5a8495b1bba025dc684a9
1
+ c9797260b1affd17127bf2b1e5c22c1cf184adb1
package/karnel/bin/karnel CHANGED
@@ -30,7 +30,8 @@ import "@/utils/env"
30
30
 
31
31
  # ===== SEMVER COMPARISON =====
32
32
  _semver_gt() {
33
- [[ "$(printf '%s\n%s' "$1" "$2" | sort -V | tail -1)" == "$1" ]] && [[ "$1" != "$2" ]]
33
+ local a="${1#v}" b="${2#v}"
34
+ [[ "$(printf '%s\n%s' "$a" "$b" | sort -V | tail -1)" == "$a" ]] && [[ "$a" != "$b" ]]
34
35
  }
35
36
 
36
37
  _valid_semver() {
@@ -292,7 +292,7 @@ _fix_locale() {
292
292
  if [[ ! -f "$config" ]] && [[ -f "$HOME/.bashrc" ]]; then
293
293
  config="$HOME/.bashrc"
294
294
  fi
295
- echo 'export LANG=en_US.UTF-8' >> "$config" 2>/dev/null
295
+ grep -qxF 'export LANG=en_US.UTF-8' "$config" 2>/dev/null || echo 'export LANG=en_US.UTF-8' >> "$config" 2>/dev/null
296
296
  }
297
297
 
298
298
 
@@ -425,6 +425,6 @@ _fix_keyring() {
425
425
  }
426
426
 
427
427
  _fix_apt_cache() {
428
- rm -rf "$PREFIX/var/apt/lists"/* 2>/dev/null
428
+ rm -rf "${PREFIX:?}/var/apt/lists"/* 2>/dev/null
429
429
  pkg update -y &>/dev/null
430
430
  }
File without changes
@@ -1078,33 +1078,33 @@ configure_rust() {
1078
1078
 
1079
1079
  # Append dependencies to Cargo.toml
1080
1080
  if [[ -f "Cargo.toml" ]]; then
1081
- # Append after [dependencies] or add it
1082
- if grep -q '^\[dependencies\]' Cargo.toml; then
1083
- cat >>Cargo.toml <<EOF
1084
- EOF
1085
- else
1086
- echo -e "\n[dependencies]" >> Cargo.toml
1081
+ if ! grep -q '^\[dependencies\]' Cargo.toml; then
1082
+ printf '\n[dependencies]\n' >> Cargo.toml
1087
1083
  fi
1088
- cat >>Cargo.toml <<EOF
1089
- tokio = { version = "1.0", features = ["full"] }
1090
- serde = { version = "1.0", features = ["derive"] }
1091
- serde_json = "1.0"
1092
- dotenvy = "0.15"
1093
- EOF
1084
+ local dep name spec
1085
+ local -a deps=(
1086
+ 'tokio = { version = "1.0", features = ["full"] }'
1087
+ 'serde = { version = "1.0", features = ["derive"] }'
1088
+ 'serde_json = "1.0"'
1089
+ 'dotenvy = "0.15"'
1090
+ )
1094
1091
  if [[ "$framework_choice" == "Axum" ]]; then
1095
- cat >>Cargo.toml <<EOF
1096
- axum = "0.7"
1097
- EOF
1092
+ deps+=('axum = "0.7"')
1098
1093
  else
1099
- cat >>Cargo.toml <<EOF
1100
- actix-web = "4.0"
1101
- EOF
1094
+ deps+=('actix-web = "4.0"')
1102
1095
  fi
1103
1096
  if [[ "$db_choice" == "SQLx (PostgreSQL)" ]]; then
1104
- cat >>Cargo.toml <<EOF
1105
- sqlx = { version = "0.7", features = ["runtime-tokio", "postgres", "macros"] }
1106
- EOF
1097
+ deps+=('sqlx = { version = "0.7", features = ["runtime-tokio", "postgres", "macros"] }')
1107
1098
  fi
1099
+ for dep in "${deps[@]}"; do
1100
+ name="${dep%% =*}"
1101
+ name="${name%%[[:space:]]*}"
1102
+ if grep -q "^${name} =" Cargo.toml; then
1103
+ log_info "Dependency already present: ${name}"
1104
+ else
1105
+ sed -i "/^\[dependencies\]/a ${dep}" Cargo.toml
1106
+ fi
1107
+ done
1108
1108
  log_success "Configured Cargo.toml"
1109
1109
  fi
1110
1110
 
@@ -210,6 +210,18 @@ _update_cleanup() {
210
210
  rm -f "$KARNEL_CACHE/new_version" "$KARNEL_CACHE/last_version_check"
211
211
  }
212
212
 
213
+ _update_release_commit() {
214
+ local tag="$1" commit=""
215
+ if command -v git &>/dev/null 2>&1; then
216
+ commit=$(git ls-remote "https://github.com/israelmarques1024-dotcom/karnel-termux.git" "refs/tags/${tag}^{}" 2>/dev/null | awk '{print $1}')
217
+ fi
218
+ if [[ -z "$commit" ]] && command -v curl &>/dev/null 2>&1; then
219
+ commit=$(curl -fsS -m 10 "https://api.github.com/repos/israelmarques1024-dotcom/karnel-termux/commits/${tag}" 2>/dev/null \
220
+ | grep -m1 '"sha"' | sed -E 's/.*"sha":[[:space:]]*"([0-9a-f]{40})".*/\1/')
221
+ fi
222
+ [[ "$commit" =~ ^[0-9a-f]{40}$ ]] && echo "$commit"
223
+ }
224
+
213
225
  _update_try_curl() {
214
226
  command -v curl &>/dev/null || return 1
215
227
 
@@ -252,10 +264,23 @@ _update_try_curl() {
252
264
 
253
265
  rm -f "$meta" "$sumfile"
254
266
 
255
- if bash "$installer" --ref "$tag"; then
256
- rm -f "$installer"
257
- log_success "Karnel-Termux updated via curl ($tag)"
258
- return 0
267
+ # Resolve the release's target commit so the installer's "immutable
268
+ # commit SHA" requirement is satisfied even when the downloaded asset
269
+ # does not have RELEASE_COMMIT baked in.
270
+ local commit
271
+ commit=$(_update_release_commit "$tag")
272
+ if [[ -n "$commit" ]]; then
273
+ if bash "$installer" --ref "$tag" --commit "$commit"; then
274
+ rm -f "$installer"
275
+ log_success "Karnel-Termux updated via curl ($tag)"
276
+ return 0
277
+ fi
278
+ else
279
+ if bash "$installer" --ref "$tag"; then
280
+ rm -f "$installer"
281
+ log_success "Karnel-Termux updated via curl ($tag)"
282
+ return 0
283
+ fi
259
284
  fi
260
285
 
261
286
  rm -f "$installer"
File without changes
File without changes
@@ -191,7 +191,7 @@ _cactus_write_wrapper() {
191
191
  # The server loads the engine via ctypes inside the python process, so the
192
192
  # whole interpreter must run under qemu-aarch64; CACTUS_EMULATE=1 makes the
193
193
  # CLI wrap native subprocess children (bin/run) with qemu as well.
194
- exec proot-distro login --shared-tmp ubuntu -- env CACTUS_EMULATE=1 qemu-aarch64 -cpu max -L / $CACTUS_CONTAINER_DIR/venv/bin/python -m cactus "\$@"
194
+ exec proot-distro login --shared-tmp ubuntu -- env CACTUS_EMULATE=1${CACTUS_CLOUD_KEY:+ CACTUS_CLOUD_KEY="$CACTUS_CLOUD_KEY"}${CACTUS_BASE_URL:+ CACTUS_BASE_URL="$CACTUS_BASE_URL"} qemu-aarch64 -cpu max -L / $CACTUS_CONTAINER_DIR/venv/bin/python -m cactus "$@"
195
195
  EOF
196
196
  else
197
197
  cat >"$temporary" <<EOF
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -394,7 +394,13 @@ uninstall_kimchi_code() {
394
394
  "$HOME/.local/share/kimchi" \
395
395
  "$HOME/.local/state/kimchi" \
396
396
  "$HOME/.cache/kimchi"
397
+ # Also remove the binaries installed inside the ubuntu container for
398
+ # proot/glibc installs (they are not cleaned by _uninstall_kimchi_impl).
399
+ if [ -n "$(_kimchi_detect_ubuntu_root)" ] && _kimchi_wrapper_owned; then
400
+ _kimchi_proot_ubuntu /bin/bash -c 'rm -f /usr/local/bin/kimchi && rm -rf /usr/local/share/kimchi' &>>"$LOG_FILE"
401
+ fi
397
402
  loading "Uninstalling Kimchi" _uninstall_kimchi_impl
403
+ rm -f "$PREFIX/bin/kimchi"
398
404
  return $?
399
405
  fi
400
406
 
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -96,6 +96,8 @@ _install_opencode_proot_impl() {
96
96
  npm install -g opencode-ai@1.18.15
97
97
  ' &>>"$LOG_FILE"
98
98
 
99
+ proot_ubuntu /bin/bash -c 'touch /root/.opencode/.karnel-managed' &>>"$LOG_FILE"
100
+
99
101
  local ubuntu_root
100
102
  ubuntu_root="$(detect_ubuntu_root)"
101
103
  if [ -z "$ubuntu_root" ]; then
@@ -153,7 +155,11 @@ uninstall_opencode() {
153
155
  return 0
154
156
  fi
155
157
 
156
- proot_ubuntu /bin/bash -c 'rm -rf /root/.opencode' &>>"$LOG_FILE"
158
+ if proot_ubuntu test -f /root/.opencode/.karnel-managed &>>"$LOG_FILE"; then
159
+ proot_ubuntu /bin/bash -c 'rm -rf /root/.opencode' &>>"$LOG_FILE"
160
+ else
161
+ log_warn "OpenCode data in the Ubuntu container was not installed by Karnel — leaving it untouched"
162
+ fi
157
163
  local ubuntu_root
158
164
  ubuntu_root="$(detect_ubuntu_root)/root/.bashrc"
159
165
  if [ -f "$ubuntu_root" ]; then
@@ -179,7 +185,12 @@ _do_update_opencode() {
179
185
  return $?
180
186
  fi
181
187
 
182
- proot_ubuntu /bin/bash -c 'rm -rf /root/.opencode' &>>"$LOG_FILE"
188
+ if proot_ubuntu test -f /root/.opencode/.karnel-managed &>>"$LOG_FILE"; then
189
+ proot_ubuntu /bin/bash -c 'rm -rf /root/.opencode' &>>"$LOG_FILE"
190
+ else
191
+ log_warn "Existing OpenCode in the Ubuntu container was not installed by Karnel — aborting update to avoid data loss"
192
+ return 1
193
+ fi
183
194
  proot_ubuntu /bin/bash -c '
184
195
  export SHELL=/bin/bash
185
196
  export TMPDIR=/tmp
File without changes
File without changes
File without changes
@@ -646,8 +646,10 @@ update_walkie() {
646
646
  return 0
647
647
  fi
648
648
  log_info "New walkie revision available: $remote_commit (installed: $installed_commit)"
649
- local answer
650
- read -r -p "Update walkie? [Y/n] " answer
649
+ local answer="y"
650
+ if [[ -z "$KARNEL_NONINTERACTIVE" && -t 0 ]]; then
651
+ read -r -p "Update walkie? [Y/n] " answer
652
+ fi
651
653
  case "$answer" in
652
654
  ""|y|Y|yes|Yes|YES) _update_walkie ;;
653
655
  *) log_info "Update skipped" ;;
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -15,6 +15,13 @@ install_netlify() {
15
15
  if command -v netlify &>/dev/null && netlify --version &>/dev/null; then
16
16
  log_info "Netlify CLI is already installed"
17
17
  return 2
18
+ fi
19
+ if ! command -v node &>/dev/null || ! command -v npm &>/dev/null; then
20
+ log_info "Installing Node.js..."
21
+ if ! pkg install -y nodejs-lts &>>"$LOG_FILE"; then
22
+ log_error "Failed to install Node.js"
23
+ return 1
24
+ fi
18
25
  fi
19
26
  if ! _netlify_node_supported; then
20
27
  log_error "Netlify CLI requires Node.js 22.13.0 or newer. Update Node.js and retry."
@@ -185,6 +185,15 @@ uninstall_railway() {
185
185
  }
186
186
 
187
187
  update_railway() {
188
+ if _railway_proot_wrapper_owned; then
189
+ log_info "Railway was installed via Ubuntu PRoot; updating inside the container..."
190
+ if proot-distro login ubuntu -- npm update -g @railway/cli &>>"$LOG_FILE"; then
191
+ log_success "Railway CLI updated through Ubuntu Proot"
192
+ return 0
193
+ fi
194
+ log_warn "Railway CLI update failed inside Ubuntu Proot"
195
+ return 1
196
+ fi
188
197
  _check_update_needed "Railway CLI" "$(_get_installed_npm_version @railway/cli)" "$(_get_remote_npm_version @railway/cli)" _do_update_railway
189
198
  }
190
199
 
@@ -10,6 +10,13 @@ install_vercel() {
10
10
  log_info "Vercel CLI is already installed"
11
11
  return 2
12
12
  fi
13
+ if ! command -v node &>/dev/null || ! command -v npm &>/dev/null; then
14
+ log_info "Installing Node.js..."
15
+ if ! pkg install -y nodejs-lts &>>"$LOG_FILE"; then
16
+ log_error "Failed to install Node.js"
17
+ return 1
18
+ fi
19
+ fi
13
20
  log_info "Installing Vercel CLI..."
14
21
  npm install -g vercel &>/dev/null || {
15
22
  log_error "Failed to install Vercel CLI"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -296,6 +296,7 @@ _install_bun_proot_impl() {
296
296
  fi
297
297
  sed "s|__UBUNTU_ROOTFS__|$ubuntu_root|g" "$wrapper_src" >"$PREFIX/bin/bun"
298
298
  chmod +x "$PREFIX/bin/bun"
299
+ mkdir -p "$BUN_DATA_DIR" && : >"$BUN_DATA_DIR/.karnel-proot"
299
300
  return 0
300
301
  }
301
302
 
@@ -339,7 +340,12 @@ _uninstall_bun_impl() {
339
340
  _uninstall_bun_native
340
341
  return $?
341
342
  fi
342
- _uninstall_bun_proot
343
+ if [ -f "$BUN_DATA_DIR/.karnel-proot" ]; then
344
+ _uninstall_bun_proot
345
+ return $?
346
+ fi
347
+ log_error "Refusing to remove unowned bun command: $PREFIX/bin/bun"
348
+ return 1
343
349
  }
344
350
 
345
351
  uninstall_bun() {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -178,8 +178,8 @@ install_turbopack() {
178
178
 
179
179
  uninstall_turbopack() {
180
180
  if ! _has_glibc_node; then
181
- log_warn "Turbopack is not installed"
182
- return 1
181
+ log_info "Turbopack is not installed"
182
+ return 2
183
183
  fi
184
184
 
185
185
  loading "Removing CLI wrappers" _uninstall_wrappers
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes