karnel-termux 0.0.1 → 0.0.3

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 (100) hide show
  1. package/README.md +1 -1
  2. package/karnel/cli/commands/install.sh +5 -1
  3. package/karnel/cli/commands/list.sh +1 -0
  4. package/karnel/tools/ai/antigravity-cli/install.sh +4 -2
  5. package/karnel/tools/ai/claude-code/install.sh +7 -6
  6. package/karnel/tools/ai/cline/install.sh +2 -6
  7. package/karnel/tools/ai/codegraph/install.sh +9 -9
  8. package/karnel/tools/ai/codex/install.sh +2 -7
  9. package/karnel/tools/ai/command-code/install.sh +2 -12
  10. package/karnel/tools/ai/crush/install.sh +4 -5
  11. package/karnel/tools/ai/ctx7/install.sh +5 -5
  12. package/karnel/tools/ai/engram/install.sh +2 -7
  13. package/karnel/tools/ai/freebuff/install.sh +4 -2
  14. package/karnel/tools/ai/gemini-cli/install.sh +2 -7
  15. package/karnel/tools/ai/gentle-ai/install.sh +4 -4
  16. package/karnel/tools/ai/gga/install.sh +7 -7
  17. package/karnel/tools/ai/hermes-agent/install.sh +2 -5
  18. package/karnel/tools/ai/kilocode-cli/install.sh +2 -9
  19. package/karnel/tools/ai/kimchi-code/bin/kimchi +27 -0
  20. package/karnel/tools/ai/kimchi-code/helper/kimchi_helper.c +47 -0
  21. package/karnel/tools/ai/kimchi-code/install.sh +4 -3
  22. package/karnel/tools/ai/kimi-code/install.sh +2 -12
  23. package/karnel/tools/ai/kiro/install.sh +4 -5
  24. package/karnel/tools/ai/mimocode/install.sh +4 -3
  25. package/karnel/tools/ai/minimax-cli/install.sh +2 -12
  26. package/karnel/tools/ai/mistral-vibe/install.sh +2 -7
  27. package/karnel/tools/ai/odysseus/install.sh +5 -3
  28. package/karnel/tools/ai/ollama/install.sh +2 -7
  29. package/karnel/tools/ai/omni-route/install.sh +5 -4
  30. package/karnel/tools/ai/openclaude/install.sh +2 -7
  31. package/karnel/tools/ai/openclaw/install.sh +2 -7
  32. package/karnel/tools/ai/opencode/install.sh +9 -8
  33. package/karnel/tools/ai/openspec/install.sh +5 -5
  34. package/karnel/tools/ai/pi/install.sh +2 -7
  35. package/karnel/tools/ai/qwen-code/install.sh +2 -7
  36. package/karnel/tools/auto/n8n/install.sh +2 -2
  37. package/karnel/tools/db/all.sh +0 -2
  38. package/karnel/tools/db/mariadb/install.sh +2 -2
  39. package/karnel/tools/db/mongodb/install.sh +2 -2
  40. package/karnel/tools/db/postgresql/install.sh +2 -2
  41. package/karnel/tools/db/redis/install.sh +0 -1
  42. package/karnel/tools/db/sqlite/install.sh +2 -2
  43. package/karnel/tools/deploy/netlify/install.sh +6 -2
  44. package/karnel/tools/deploy/railway/install.sh +5 -6
  45. package/karnel/tools/deploy/vercel/install.sh +6 -2
  46. package/karnel/tools/dev/bat/install.sh +2 -6
  47. package/karnel/tools/dev/bc/install.sh +2 -6
  48. package/karnel/tools/dev/cloudflared/install.sh +2 -6
  49. package/karnel/tools/dev/curl/install.sh +2 -6
  50. package/karnel/tools/dev/fzf/install.sh +2 -6
  51. package/karnel/tools/dev/gh/install.sh +2 -6
  52. package/karnel/tools/dev/html2text/install.sh +2 -6
  53. package/karnel/tools/dev/imagemagick/install.sh +2 -6
  54. package/karnel/tools/dev/jq/install.sh +2 -6
  55. package/karnel/tools/dev/lsd/install.sh +2 -6
  56. package/karnel/tools/dev/make/install.sh +2 -6
  57. package/karnel/tools/dev/ncurses/install.sh +2 -6
  58. package/karnel/tools/dev/proot/install.sh +2 -6
  59. package/karnel/tools/dev/shfmt/install.sh +2 -6
  60. package/karnel/tools/dev/tmate/install.sh +2 -6
  61. package/karnel/tools/dev/translate/install.sh +2 -6
  62. package/karnel/tools/dev/tree/install.sh +2 -6
  63. package/karnel/tools/dev/udocker/install.sh +2 -6
  64. package/karnel/tools/dev/wget/install.sh +2 -6
  65. package/karnel/tools/editor/code-server/install.sh +7 -2
  66. package/karnel/tools/editor/nvchad/install.sh +1 -1
  67. package/karnel/tools/lang/clang/install.sh +2 -5
  68. package/karnel/tools/lang/golang/install.sh +2 -5
  69. package/karnel/tools/lang/nodejs/install.sh +2 -5
  70. package/karnel/tools/lang/perl/install.sh +2 -5
  71. package/karnel/tools/lang/php/install.sh +2 -5
  72. package/karnel/tools/lang/python/install.sh +2 -5
  73. package/karnel/tools/lang/rust/install.sh +2 -5
  74. package/karnel/tools/npm/live-server/install.sh +2 -6
  75. package/karnel/tools/npm/localtunnel/install.sh +2 -6
  76. package/karnel/tools/npm/markserv/install.sh +2 -6
  77. package/karnel/tools/npm/ncu/install.sh +2 -6
  78. package/karnel/tools/npm/nestjs/install.sh +2 -6
  79. package/karnel/tools/npm/ngrok/install.sh +2 -6
  80. package/karnel/tools/npm/prettier/install.sh +2 -6
  81. package/karnel/tools/npm/psqlformat/install.sh +2 -6
  82. package/karnel/tools/npm/turbopack/bin/next-turbopack +55 -0
  83. package/karnel/tools/npm/turbopack/bin/node-glibc.sh +9 -0
  84. package/karnel/tools/npm/turbopack/bin/patch-interp.py +101 -0
  85. package/karnel/tools/npm/turbopack/bin/precheck-native.js +96 -0
  86. package/karnel/tools/npm/turbopack/install.sh +101 -31
  87. package/karnel/tools/npm/typescript/install.sh +2 -6
  88. package/karnel/tools/npm/vercel/install.sh +2 -6
  89. package/karnel/tools/shell/better-npm/install.sh +2 -1
  90. package/karnel/tools/shell/fzf-tab/install.sh +2 -1
  91. package/karnel/tools/shell/history-substring/install.sh +2 -1
  92. package/karnel/tools/shell/powerlevel10k/install.sh +2 -1
  93. package/karnel/tools/shell/you-should-use/install.sh +2 -1
  94. package/karnel/tools/shell/zsh-autopair/install.sh +2 -1
  95. package/karnel/tools/shell/zsh-autosuggestions/install.sh +2 -1
  96. package/karnel/tools/shell/zsh-completions/install.sh +2 -1
  97. package/karnel/tools/shell/zsh-defer/install.sh +2 -1
  98. package/karnel/tools/shell/zsh-syntax-highlighting/install.sh +2 -1
  99. package/karnel/utils/banner.sh +11 -0
  100. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://github.com/israelmarques1024-dotcom/karnel-termux">
11
- <img src="https://img.shields.io/badge/version-1.0.0-0078D4?style=for-the-badge&logo=appveyor" alt="Version">
11
+ <img src="https://img.shields.io/badge/version-0.0.1-0078D4?style=for-the-badge&logo=appveyor" alt="Version">
12
12
  </a>
13
13
  <a href="https://www.npmjs.com/package/karnel-termux">
14
14
  <img src="https://img.shields.io/npm/v/karnel-termux?style=for-the-badge&logo=npm&color=cb3837" alt="npm">
@@ -69,7 +69,7 @@ install_main() {
69
69
  log_info "Available targets:"
70
70
  echo
71
71
  list_item "lang - Language packages (Node.js, Python, Perl, PHP, Rust, C, C++, Go)"
72
- list_item "db - Databases (PostgreSQL, MariaDB, SQLite, MongoDB)"
72
+ list_item "db - Databases (PostgreSQL, MariaDB, SQLite, MongoDB, Redis)"
73
73
  list_item "ai - AI tools (OpenCode, Gentle AI, Claude Code, etc.)"
74
74
  list_item "editor - Code editor (code-server)"
75
75
  list_item "dev - Development tools"
@@ -294,6 +294,10 @@ _install_specific_tools() {
294
294
  install_mongodb
295
295
  case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
296
296
  ;;
297
+ redis)
298
+ install_redis
299
+ case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
300
+ ;;
297
301
  *)
298
302
  log_warn "Unknown database: --$tool"
299
303
  ;;
@@ -119,6 +119,7 @@ _list_db() {
119
119
  table_row "MariaDB" "--mariadb" "$(_check_pkg "mariadb")"
120
120
  table_row "SQLite" "--sqlite" "$(_check_pkg "sqlite")"
121
121
  table_row "MongoDB" "--mongodb" "$(_check_pkg "mongodb")"
122
+ table_row "Redis" "--redis" "$(_check_pkg "redis")"
122
123
  table_end
123
124
 
124
125
  echo
@@ -2,6 +2,7 @@
2
2
 
3
3
  import "@/utils/log"
4
4
  import "@/utils/colors"
5
+ import "@/utils/version"
5
6
 
6
7
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
7
8
  AGY_DATA_DIR="$HOME/.local/share/karnel-data/antigravity-cli"
@@ -371,9 +372,10 @@ uninstall_antigravity_cli() {
371
372
  }
372
373
 
373
374
  update_antigravity_cli() {
374
- log_info "Updating Antigravity CLI..."
375
- mkdir -p "$(dirname "$LOG_FILE")"
375
+ _check_update_needed "Antigravity CLI" "$(_get_installed_version agy)" "$(_get_remote_github_version antigravity-cli/antigravity-cli)" _update_antigravity_cli_impl
376
+ }
376
377
 
378
+ _update_antigravity_cli_impl() {
377
379
  if [ -f "$AGY_DATA_DIR/agy.va39" ]; then
378
380
  _antigravity_download_binary || return 1
379
381
  _antigravity_apply_va39_patches || return 1
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
  import "@/utils/colors"
5
6
 
6
7
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
@@ -250,25 +251,25 @@ uninstall_claude_code() {
250
251
  }
251
252
 
252
253
  update_claude_code() {
253
- log_info "Updating Claude Code..."
254
- mkdir -p "$(dirname "$LOG_FILE")"
254
+ _check_update_needed "Claude Code" "$(_get_installed_version claude)" "$(_get_remote_github_version anthropics/claude-code)" _do_update_claude_code
255
+ }
255
256
 
257
+ _do_update_claude_code() {
256
258
  if [ -f "$CLAUDE_DATA_DIR/claude" ]; then
257
259
  _install_claude_native
258
260
  return $?
259
261
  fi
260
262
 
261
263
  _claude_proot_ubuntu /bin/bash -c '
262
- export HOME=/root
263
- curl -fsSL https://claude.ai/install.sh | bash
264
- ' &>>"$LOG_FILE"
264
+ export HOME=/root
265
+ curl -fsSL https://claude.ai/install.sh | bash
266
+ ' &>>"$LOG_FILE"
265
267
 
266
268
  if ! _claude_proot_ubuntu test -x /root/.local/bin/claude &>>"$LOG_FILE"; then
267
269
  log_error "Claude Code binary not found after update"
268
270
  return 1
269
271
  fi
270
272
 
271
- log_success "Claude Code (proot-distro) updated"
272
273
  return 0
273
274
  }
274
275
 
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
  import "@/utils/colors"
5
6
 
6
7
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
@@ -135,12 +136,7 @@ uninstall_cline() {
135
136
  }
136
137
 
137
138
  update_cline() {
138
- log_info "Updating Cline CLI..."
139
- mkdir -p "$(dirname "$LOG_FILE")"
140
-
141
- loading "Updating Cline CLI" _update_cline_impl
142
- log_success "Cline CLI updated"
143
- return 0
139
+ _check_update_needed "Cline CLI" "$(_get_installed_npm_version cline)" "$(_get_remote_npm_version cline)" _update_cline_impl
144
140
  }
145
141
 
146
142
  _update_cline_impl() {
@@ -1,5 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
  import "@/utils/log"
3
+ import "@/utils/version"
3
4
 
4
5
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
5
6
 
@@ -128,16 +129,15 @@ _uninstall_codegraph_impl() {
128
129
  }
129
130
 
130
131
  update_codegraph() {
131
- log_info "Updating CodeGraph..."
132
- mkdir -p "$(dirname "$LOG_FILE")"
133
-
134
- loading "Removing old CodeGraph" _update_codegraph_remove_impl
135
- _codegraph_dependencies || return 1
136
- _download_codegraph || return 1
137
- _write_codegraph_wrapper || return 1
132
+ _check_update_needed "CodeGraph" "$(_get_installed_version codegraph)" "$(_get_remote_github_version colbymchenry/codegraph)" _do_update_codegraph
133
+ }
138
134
 
139
- log_success "CodeGraph updated"
140
- return 0
135
+ _do_update_codegraph() {
136
+ loading "Removing old CodeGraph" _update_codegraph_remove_impl
137
+ _codegraph_dependencies || return 1
138
+ _download_codegraph || return 1
139
+ _write_codegraph_wrapper || return 1
140
+ return 0
141
141
  }
142
142
 
143
143
  _update_codegraph_remove_impl() {
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
 
5
6
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
6
7
 
@@ -81,13 +82,7 @@ _uninstall_codex_impl() {
81
82
  }
82
83
 
83
84
  update_codex() {
84
- log_info "Updating Codex CLI..."
85
- mkdir -p "$(dirname "$LOG_FILE")"
86
-
87
- loading "Updating Codex CLI" _update_codex_impl
88
-
89
- log_success "Codex CLI updated"
90
- return 0
85
+ _check_update_needed "Codex CLI" "$(_get_installed_npm_version @mmmbuto/codex-cli-termux)" "$(_get_remote_npm_version @mmmbuto/codex-cli-termux)" _update_codex_impl
91
86
  }
92
87
 
93
88
  _update_codex_impl() {
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
 
5
6
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
6
7
  COMMAND_CODE_DATA_DIR="$HOME/.local/share/karnel-data/command-code"
@@ -107,18 +108,7 @@ _uninstall_command_code_impl() {
107
108
  }
108
109
 
109
110
  update_command_code() {
110
- log_info "Updating Command Code..."
111
- mkdir -p "$(dirname "$LOG_FILE")"
112
-
113
- if [ ! -d "$COMMAND_CODE_DATA_DIR" ]; then
114
- log_warn "Command Code is not installed"
115
- return 1
116
- fi
117
-
118
- loading "Updating command-code package" _update_command_code_impl
119
-
120
- log_success "Command Code updated"
121
- return 0
111
+ _check_update_needed "Command Code" "$(_get_installed_npm_version command-code)" "$(_get_remote_npm_version command-code)" _update_command_code_impl
122
112
  }
123
113
 
124
114
  _update_command_code_impl() {
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
  import "@/utils/colors"
5
6
 
6
7
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
@@ -73,12 +74,10 @@ uninstall_crush() {
73
74
  }
74
75
 
75
76
  update_crush() {
76
- if ! command -v crush &>/dev/null; then
77
- log_info "Crush is not installed"
78
- return 0
79
- fi
77
+ _check_update_needed "Crush" "$(_get_installed_npm_version @charmland/crush)" "$(_get_remote_npm_version @charmland/crush)" _do_update_crush
78
+ }
80
79
 
81
- log_info "Updating Crush..."
80
+ _do_update_crush() {
82
81
  uninstall_crush
83
82
  install_crush
84
83
  }
@@ -4,6 +4,8 @@
4
4
  # Provides version-specific library docs and code examples on-demand
5
5
  # Solves stale knowledge issues in AI tools like Claude Code, Cursor
6
6
  # Official: npm install -g ctx7
7
+ import "@/utils/log"
8
+ import "@/utils/version"
7
9
 
8
10
  install_ctx7() {
9
11
  if command -v ctx7 &>/dev/null; then
@@ -41,12 +43,10 @@ uninstall_ctx7() {
41
43
  }
42
44
 
43
45
  update_ctx7() {
44
- if ! command -v ctx7 &>/dev/null; then
45
- log_warn "ctx7 is not installed"
46
- return 1
47
- fi
46
+ _check_update_needed "ctx7" "$(_get_installed_npm_version ctx7)" "$(_get_remote_npm_version ctx7)" _do_update_ctx7
47
+ }
48
48
 
49
- log_info "Updating ctx7..."
49
+ _do_update_ctx7() {
50
50
  npm update -g ctx7 2>/dev/null
51
51
  local _t
52
52
  _t=$(readlink -f "$PREFIX/bin/ctx7" 2>/dev/null)
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
 
5
6
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
6
7
 
@@ -100,13 +101,7 @@ _uninstall_engram_impl() {
100
101
  }
101
102
 
102
103
  update_engram() {
103
- log_info "Updating Engram..."
104
- mkdir -p "$(dirname "$LOG_FILE")"
105
-
106
- loading "Updating Engram" _update_engram_impl
107
-
108
- log_success "Engram updated"
109
- return 0
104
+ _check_update_needed "Engram" "$(_get_installed_git_version "$KARNEL_DATA/engram")" "$(_get_remote_github_version Gentleman-Programming/engram)" _update_engram_impl
110
105
  }
111
106
 
112
107
  _update_engram_impl() {
@@ -2,6 +2,7 @@
2
2
 
3
3
  import "@/utils/log"
4
4
  import "@/utils/colors"
5
+ import "@/utils/version"
5
6
 
6
7
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
7
8
  FREEBUFF_DATA_DIR="$HOME/.local/share/karnel-data/freebuff"
@@ -261,9 +262,10 @@ uninstall_freebuff() {
261
262
  }
262
263
 
263
264
  update_freebuff() {
264
- log_info "Updating Freebuff..."
265
- mkdir -p "$(dirname "$LOG_FILE")"
265
+ _check_update_needed "Freebuff" "$(_get_installed_version freebuff)" "$(_get_remote_github_version CodebuffAI/codebuff-community)" _update_freebuff_impl
266
+ }
266
267
 
268
+ _update_freebuff_impl() {
267
269
  if [ -f "$FREEBUFF_DATA_DIR/freebuff" ]; then
268
270
  _install_freebuff_native
269
271
  return $?
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
 
5
6
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
6
7
 
@@ -85,13 +86,7 @@ _uninstall_gemini_cli_impl() {
85
86
  }
86
87
 
87
88
  update_gemini_cli() {
88
- log_info "Updating Gemini CLI..."
89
- mkdir -p "$(dirname "$LOG_FILE")"
90
-
91
- loading "Updating Gemini CLI" _update_gemini_cli_impl
92
-
93
- log_success "Gemini CLI updated"
94
- return 0
89
+ _check_update_needed "Gemini CLI" "$(_get_installed_npm_version @google/gemini-cli)" "$(_get_remote_npm_version @google/gemini-cli)" _update_gemini_cli_impl
95
90
  }
96
91
 
97
92
  _update_gemini_cli_impl() {
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
  import "@/utils/colors"
5
6
 
6
7
  : "${KARNEL_CACHE:=$HOME/.cache/karnel}"
@@ -234,16 +235,15 @@ uninstall_gentle_ai() {
234
235
  }
235
236
 
236
237
  update_gentle_ai() {
237
- log_info "Updating gentle-ai..."
238
- mkdir -p "$(dirname "$LOG_FILE")"
238
+ _check_update_needed "gentle-ai" "$(_get_installed_git_version "$GENTLE_AI_DATA_DIR")" "$(_get_remote_github_version Gentleman-Programming/gentle-ai)" _do_update_gentle_ai
239
+ }
239
240
 
241
+ _do_update_gentle_ai() {
240
242
  _clone_or_update_repo || return 1
241
243
  _gentle_ai_ensure_go || return 1
242
244
  _build_and_apply_patches || return 1
243
245
  _compile || return 1
244
246
  _install_binary || return 1
245
-
246
- log_success "gentle-ai updated"
247
247
  return 0
248
248
  }
249
249
 
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
  import "@/utils/colors"
5
6
 
6
7
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
@@ -118,14 +119,13 @@ uninstall_gga() {
118
119
  }
119
120
 
120
121
  update_gga() {
121
- log_info "Updating GGA..."
122
- mkdir -p "$(dirname "$LOG_FILE")"
123
-
124
- _gga_clone_or_update_repo || return 1
125
- _gga_run_installer || return 1
122
+ _check_update_needed "GGA" "$(_get_installed_git_version "$GGA_DATA_DIR")" "$(_get_remote_github_version israelmarques1024-dotcom/gga-termux)" _do_update_gga
123
+ }
126
124
 
127
- log_success "GGA updated"
128
- return 0
125
+ _do_update_gga() {
126
+ _gga_clone_or_update_repo || return 1
127
+ _gga_run_installer || return 1
128
+ return 0
129
129
  }
130
130
 
131
131
  reinstall_gga() {
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
 
5
6
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
6
7
  HERMES_HOME="$HOME/.hermes"
@@ -98,11 +99,7 @@ _uninstall_hermes_agent_impl() {
98
99
  }
99
100
 
100
101
  update_hermes_agent() {
101
- log_info "Updating Hermes Agent..."
102
- mkdir -p "$(dirname "$LOG_FILE")"
103
- loading "Updating Hermes Agent" _update_hermes_agent_impl
104
- log_success "Hermes Agent updated successfully"
105
- return 0
102
+ _check_update_needed "Hermes Agent" "$(_get_installed_git_version "$HERMES_DIR")" "$(_get_remote_github_version NousResearch/hermes-agent)" _update_hermes_agent_impl
106
103
  }
107
104
 
108
105
  _update_hermes_agent_impl() {
@@ -1,6 +1,7 @@
1
1
  #!/data/data/com.termux/files/usr/bin/bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
  import "@/utils/colors"
5
6
 
6
7
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
@@ -162,15 +163,7 @@ _uninstall_kilocode_cli_impl() {
162
163
  }
163
164
 
164
165
  update_kilocode_cli() {
165
- mkdir -p "$(dirname "$LOG_FILE")"
166
-
167
- if [ -f "$KILOCODE_DATA_DIR/kilo" ]; then
168
- _install_kilocode_native
169
- return $?
170
- fi
171
-
172
- log_warn "Kilo Code CLI not found for update"
173
- return 1
166
+ _check_update_needed "Kilo Code CLI" "$(_get_installed_version kilocode)" "$(_get_remote_github_version Kilo-Org/kilocode)" _install_kilocode_native
174
167
  }
175
168
 
176
169
  reinstall_kilocode_cli() {
@@ -0,0 +1,27 @@
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
+ --work-dir $PWD \
26
+ ubuntu \
27
+ -- /usr/local/bin/kimchi "$@"
@@ -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/kimchi/bin/kimchi";
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
+ }
@@ -3,6 +3,7 @@
3
3
  # Kimchi CLI - Karnel installer
4
4
  # Usa o sistema de import padronizado do Karnel (bootstrap.sh)
5
5
  import "@/utils/log"
6
+ import "@/utils/version"
6
7
  import "@/utils/colors"
7
8
 
8
9
  export KARNEL_CACHE="${KARNEL_CACHE:-$HOME/.cache/karnel}"
@@ -195,9 +196,10 @@ uninstall_kimchi_code() {
195
196
  }
196
197
 
197
198
  update_kimchi_code() {
198
- log_info "Updating Kimchi CLI..."
199
- mkdir -p "$(dirname "$LOG_FILE")"
199
+ _check_update_needed "Kimchi CLI" "$(_get_installed_version kimchi)" "$(_get_remote_github_version getkimchi/kimchi)" _do_update_kimchi_code
200
+ }
200
201
 
202
+ _do_update_kimchi_code() {
201
203
  rm -rf "$KIMCHI_DATA_DIR" 2>/dev/null
202
204
  mkdir -p "$KIMCHI_DATA_DIR"
203
205
 
@@ -211,7 +213,6 @@ update_kimchi_code() {
211
213
  return 1
212
214
  }
213
215
 
214
- log_success "Kimchi CLI updated"
215
216
  return 0
216
217
  }
217
218
 
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
 
5
6
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
6
7
 
@@ -83,18 +84,7 @@ _uninstall_kimi_code_impl() {
83
84
  }
84
85
 
85
86
  update_kimi_code() {
86
- if ! command -v kimi &>/dev/null; then
87
- log_error "Kimi Code is not installed"
88
- return 1
89
- fi
90
-
91
- log_info "Updating Kimi Code..."
92
- mkdir -p "$(dirname "$LOG_FILE")"
93
-
94
- loading "Updating Kimi Code" _update_kimi_code_impl
95
-
96
- log_success "Kimi Code updated successfully"
97
- return 0
87
+ _check_update_needed "Kimi Code" "$(_get_installed_npm_version @moonshot-ai/kimi-code)" "$(_get_remote_npm_version @moonshot-ai/kimi-code)" _update_kimi_code_impl
98
88
  }
99
89
 
100
90
  _update_kimi_code_impl() {
@@ -2,6 +2,7 @@
2
2
 
3
3
  import "@/utils/log"
4
4
  import "@/utils/colors"
5
+ import "@/utils/version"
5
6
 
6
7
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
7
8
 
@@ -118,12 +119,10 @@ uninstall_kiro() {
118
119
  }
119
120
 
120
121
  update_kiro() {
121
- if ! command -v kiro &>/dev/null && ! command -v kiro-cli &>/dev/null; then
122
- log_info "Kiro is not installed"
123
- return 0
124
- fi
122
+ _check_update_needed "Kiro CLI" "$(_get_installed_version kiro)" "$(_get_remote_github_version kiro-dev/kiro-cli)" _update_kiro_impl
123
+ }
125
124
 
126
- log_info "Updating Kiro..."
125
+ _update_kiro_impl() {
127
126
  uninstall_kiro
128
127
  install_kiro
129
128
  }
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
  import "@/utils/colors"
5
6
 
6
7
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
@@ -251,9 +252,10 @@ uninstall_mimocode() {
251
252
  }
252
253
 
253
254
  update_mimocode() {
254
- log_info "Updating mimocode..."
255
- mkdir -p "$(dirname "$LOG_FILE")"
255
+ _check_update_needed "mimocode" "$(_get_installed_version mimo)" "$(_get_remote_github_version XiaomiMiMo/MiMo-Code)" _do_update_mimocode
256
+ }
256
257
 
258
+ _do_update_mimocode() {
257
259
  if [ -f "$MIMOCODE_DATA_DIR/mimocode" ]; then
258
260
  _install_mimocode_native
259
261
  return $?
@@ -277,7 +279,6 @@ update_mimocode() {
277
279
  return 1
278
280
  fi
279
281
 
280
- log_success "mimocode (proot-distro) updated"
281
282
  return 0
282
283
  }
283
284
 
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
 
5
6
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
6
7
 
@@ -83,18 +84,7 @@ _uninstall_minimax_cli_impl() {
83
84
  }
84
85
 
85
86
  update_minimax_cli() {
86
- if ! command -v mmx &>/dev/null; then
87
- log_error "MiniMax CLI is not installed"
88
- return 1
89
- fi
90
-
91
- log_info "Updating MiniMax CLI..."
92
- mkdir -p "$(dirname "$LOG_FILE")"
93
-
94
- loading "Updating MiniMax CLI" _update_minimax_cli_impl
95
-
96
- log_success "MiniMax CLI updated successfully"
97
- return 0
87
+ _check_update_needed "MiniMax CLI" "$(_get_installed_npm_version mmx-cli)" "$(_get_remote_npm_version mmx-cli)" _update_minimax_cli_impl
98
88
  }
99
89
 
100
90
  _update_minimax_cli_impl() {
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
3
  import "@/utils/log"
4
+ import "@/utils/version"
4
5
 
5
6
  LOG_FILE="$KARNEL_CACHE/install_ai.log"
6
7
 
@@ -93,13 +94,7 @@ _uninstall_mistral_vibe_impl() {
93
94
  }
94
95
 
95
96
  update_mistral_vibe() {
96
- log_info "Updating Mistral Vibe..."
97
- mkdir -p "$(dirname "$LOG_FILE")"
98
-
99
- loading "Updating Mistral Vibe" _update_mistral_vibe_impl
100
-
101
- log_success "Mistral Vibe updated"
102
- return 0
97
+ _check_update_needed "Mistral Vibe" "$(_get_installed_version vibe)" "$(_get_remote_pip_version mistral-vibe)" _update_mistral_vibe_impl
103
98
  }
104
99
 
105
100
  _update_mistral_vibe_impl() {