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.
- package/LICENSE +21 -0
- package/README.md +454 -0
- package/install.sh +272 -0
- package/karnel/bin/karnel +77 -0
- package/karnel/cli/commands/brain.sh +1553 -0
- package/karnel/cli/commands/cleanup.sh +66 -0
- package/karnel/cli/commands/doctor.sh +1528 -0
- package/karnel/cli/commands/env.sh +233 -0
- package/karnel/cli/commands/help.sh +8 -0
- package/karnel/cli/commands/ia.sh +502 -0
- package/karnel/cli/commands/init.sh +1274 -0
- package/karnel/cli/commands/install.sh +718 -0
- package/karnel/cli/commands/list.sh +399 -0
- package/karnel/cli/commands/open.sh +106 -0
- package/karnel/cli/commands/pg.sh +719 -0
- package/karnel/cli/commands/reinstall.sh +663 -0
- package/karnel/cli/commands/show.sh +90 -0
- package/karnel/cli/commands/start.sh +54 -0
- package/karnel/cli/commands/status.sh +96 -0
- package/karnel/cli/commands/uninstall.sh +668 -0
- package/karnel/cli/commands/update.sh +723 -0
- package/karnel/cli/commands/upgrade.sh +40 -0
- package/karnel/cli/commands/version.sh +3 -0
- package/karnel/cli/commands/voice.sh +230 -0
- package/karnel/cli/karnel.sh +706 -0
- package/karnel/modules/ai.sh +135 -0
- package/karnel/modules/auto.sh +114 -0
- package/karnel/modules/db.sh +132 -0
- package/karnel/modules/deploy.sh +74 -0
- package/karnel/modules/dev.sh +148 -0
- package/karnel/modules/editor.sh +115 -0
- package/karnel/modules/lang.sh +124 -0
- package/karnel/modules/npm.sh +146 -0
- package/karnel/modules/shell.sh +338 -0
- package/karnel/modules/ui.sh +139 -0
- package/karnel/modules/voice.sh +118 -0
- package/karnel/tools/ai/all.sh +209 -0
- package/karnel/tools/ai/antigravity-cli/README.md +45 -0
- package/karnel/tools/ai/antigravity-cli/bin/agy +28 -0
- package/karnel/tools/ai/antigravity-cli/helper/agy_helper.c +39 -0
- package/karnel/tools/ai/antigravity-cli/install.sh +469 -0
- package/karnel/tools/ai/claude-code/README.md +45 -0
- package/karnel/tools/ai/claude-code/bin/claude +29 -0
- package/karnel/tools/ai/claude-code/helper/claude_helper.c +42 -0
- package/karnel/tools/ai/claude-code/install.sh +278 -0
- package/karnel/tools/ai/cline/install.sh +160 -0
- package/karnel/tools/ai/codegraph/README.md +43 -0
- package/karnel/tools/ai/codegraph/bin/codegraph +5 -0
- package/karnel/tools/ai/codegraph/install.sh +160 -0
- package/karnel/tools/ai/codex/README.md +44 -0
- package/karnel/tools/ai/codex/install.sh +104 -0
- package/karnel/tools/ai/command-code/README.md +62 -0
- package/karnel/tools/ai/command-code/install.sh +136 -0
- package/karnel/tools/ai/crush/README.md +17 -0
- package/karnel/tools/ai/crush/install.sh +89 -0
- package/karnel/tools/ai/ctx7/README.md +26 -0
- package/karnel/tools/ai/ctx7/install.sh +61 -0
- package/karnel/tools/ai/engram/README.md +44 -0
- package/karnel/tools/ai/engram/install.sh +127 -0
- package/karnel/tools/ai/freebuff/README.md +52 -0
- package/karnel/tools/ai/freebuff/bin/freebuff +28 -0
- package/karnel/tools/ai/freebuff/helper/freebuff_helper.c +47 -0
- package/karnel/tools/ai/freebuff/install.sh +303 -0
- package/karnel/tools/ai/gemini-cli/README.md +46 -0
- package/karnel/tools/ai/gemini-cli/install.sh +111 -0
- package/karnel/tools/ai/gentle-ai/README.md +42 -0
- package/karnel/tools/ai/gentle-ai/install.sh +253 -0
- package/karnel/tools/ai/gentle-ai/termux-patches.go +256 -0
- package/karnel/tools/ai/gga/README.md +49 -0
- package/karnel/tools/ai/gga/install.sh +134 -0
- package/karnel/tools/ai/hermes-agent/README.md +50 -0
- package/karnel/tools/ai/hermes-agent/install.sh +120 -0
- package/karnel/tools/ai/kilocode-cli/README.md +45 -0
- package/karnel/tools/ai/kilocode-cli/bin/kilocode +21 -0
- package/karnel/tools/ai/kilocode-cli/helper/kilocode_helper.c +47 -0
- package/karnel/tools/ai/kilocode-cli/install.sh +179 -0
- package/karnel/tools/ai/kimchi-code/README.md +53 -0
- package/karnel/tools/ai/kimchi-code/install.sh +221 -0
- package/karnel/tools/ai/kimi-code/README.md +45 -0
- package/karnel/tools/ai/kimi-code/install.sh +111 -0
- package/karnel/tools/ai/kiro/README.md +17 -0
- package/karnel/tools/ai/kiro/install.sh +134 -0
- package/karnel/tools/ai/mimocode/README.md +43 -0
- package/karnel/tools/ai/mimocode/bin/mimo +28 -0
- package/karnel/tools/ai/mimocode/helper/mimocode_helper.c +47 -0
- package/karnel/tools/ai/mimocode/install.sh +287 -0
- package/karnel/tools/ai/minimax-cli/README.md +45 -0
- package/karnel/tools/ai/minimax-cli/install.sh +111 -0
- package/karnel/tools/ai/mistral-vibe/README.md +46 -0
- package/karnel/tools/ai/mistral-vibe/install.sh +119 -0
- package/karnel/tools/ai/odysseus/README.md +35 -0
- package/karnel/tools/ai/odysseus/install.sh +198 -0
- package/karnel/tools/ai/ollama/README.md +44 -0
- package/karnel/tools/ai/ollama/install.sh +78 -0
- package/karnel/tools/ai/omni-route/README.md +111 -0
- package/karnel/tools/ai/omni-route/install.sh +165 -0
- package/karnel/tools/ai/openclaude/README.md +46 -0
- package/karnel/tools/ai/openclaude/install.sh +110 -0
- package/karnel/tools/ai/openclaw/README.md +47 -0
- package/karnel/tools/ai/openclaw/install.sh +112 -0
- package/karnel/tools/ai/opencode/README.md +51 -0
- package/karnel/tools/ai/opencode/bin/opencode +28 -0
- package/karnel/tools/ai/opencode/helper/opencode_helper.c +57 -0
- package/karnel/tools/ai/opencode/install.sh +290 -0
- package/karnel/tools/ai/openspec/README.md +34 -0
- package/karnel/tools/ai/openspec/install.sh +61 -0
- package/karnel/tools/ai/pi/README.md +46 -0
- package/karnel/tools/ai/pi/install.sh +104 -0
- package/karnel/tools/ai/qwen-code/README.md +45 -0
- package/karnel/tools/ai/qwen-code/install.sh +111 -0
- package/karnel/tools/auto/all.sh +57 -0
- package/karnel/tools/auto/n8n/README.md +47 -0
- package/karnel/tools/auto/n8n/install.sh +102 -0
- package/karnel/tools/db/all.sh +61 -0
- package/karnel/tools/db/mariadb/README.md +43 -0
- package/karnel/tools/db/mariadb/install.sh +65 -0
- package/karnel/tools/db/mongodb/README.md +42 -0
- package/karnel/tools/db/mongodb/install.sh +73 -0
- package/karnel/tools/db/postgresql/README.md +45 -0
- package/karnel/tools/db/postgresql/install.sh +65 -0
- package/karnel/tools/db/redis/README.md +46 -0
- package/karnel/tools/db/redis/install.sh +64 -0
- package/karnel/tools/db/sqlite/README.md +44 -0
- package/karnel/tools/db/sqlite/install.sh +65 -0
- package/karnel/tools/deploy/all.sh +43 -0
- package/karnel/tools/deploy/netlify/install.sh +41 -0
- package/karnel/tools/deploy/railway/install.sh +109 -0
- package/karnel/tools/deploy/vercel/install.sh +43 -0
- package/karnel/tools/dev/all.sh +77 -0
- package/karnel/tools/dev/bat/README.md +44 -0
- package/karnel/tools/dev/bat/install.sh +82 -0
- package/karnel/tools/dev/bc/README.md +44 -0
- package/karnel/tools/dev/bc/install.sh +82 -0
- package/karnel/tools/dev/cloudflared/README.md +43 -0
- package/karnel/tools/dev/cloudflared/install.sh +82 -0
- package/karnel/tools/dev/curl/README.md +43 -0
- package/karnel/tools/dev/curl/install.sh +82 -0
- package/karnel/tools/dev/fzf/README.md +44 -0
- package/karnel/tools/dev/fzf/install.sh +82 -0
- package/karnel/tools/dev/gh/README.md +43 -0
- package/karnel/tools/dev/gh/install.sh +82 -0
- package/karnel/tools/dev/html2text/README.md +44 -0
- package/karnel/tools/dev/html2text/install.sh +82 -0
- package/karnel/tools/dev/imagemagick/README.md +44 -0
- package/karnel/tools/dev/imagemagick/install.sh +82 -0
- package/karnel/tools/dev/jq/README.md +44 -0
- package/karnel/tools/dev/jq/install.sh +82 -0
- package/karnel/tools/dev/lsd/README.md +44 -0
- package/karnel/tools/dev/lsd/install.sh +82 -0
- package/karnel/tools/dev/make/README.md +44 -0
- package/karnel/tools/dev/make/install.sh +82 -0
- package/karnel/tools/dev/ncurses/README.md +42 -0
- package/karnel/tools/dev/ncurses/install.sh +82 -0
- package/karnel/tools/dev/openssh/README.md +43 -0
- package/karnel/tools/dev/openssh/install.sh +75 -0
- package/karnel/tools/dev/proot/README.md +43 -0
- package/karnel/tools/dev/proot/install.sh +82 -0
- package/karnel/tools/dev/shfmt/README.md +44 -0
- package/karnel/tools/dev/shfmt/install.sh +82 -0
- package/karnel/tools/dev/tmate/README.md +44 -0
- package/karnel/tools/dev/tmate/install.sh +82 -0
- package/karnel/tools/dev/tmux/README.md +43 -0
- package/karnel/tools/dev/tmux/install.sh +75 -0
- package/karnel/tools/dev/translate/README.md +44 -0
- package/karnel/tools/dev/translate/install.sh +82 -0
- package/karnel/tools/dev/tree/README.md +44 -0
- package/karnel/tools/dev/tree/install.sh +82 -0
- package/karnel/tools/dev/udocker/README.md +44 -0
- package/karnel/tools/dev/udocker/install.sh +82 -0
- package/karnel/tools/dev/wget/README.md +44 -0
- package/karnel/tools/dev/wget/install.sh +82 -0
- package/karnel/tools/editor/all.sh +59 -0
- package/karnel/tools/editor/code-server/README.md +42 -0
- package/karnel/tools/editor/code-server/install.sh +74 -0
- package/karnel/tools/editor/neovim/README.md +43 -0
- package/karnel/tools/editor/neovim/install.sh +64 -0
- package/karnel/tools/editor/nvchad/README.md +45 -0
- package/karnel/tools/editor/nvchad/install.sh +105 -0
- package/karnel/tools/lang/all.sh +63 -0
- package/karnel/tools/lang/clang/README.md +43 -0
- package/karnel/tools/lang/clang/install.sh +79 -0
- package/karnel/tools/lang/golang/README.md +43 -0
- package/karnel/tools/lang/golang/install.sh +79 -0
- package/karnel/tools/lang/nodejs/README.md +43 -0
- package/karnel/tools/lang/nodejs/install.sh +79 -0
- package/karnel/tools/lang/perl/README.md +43 -0
- package/karnel/tools/lang/perl/install.sh +79 -0
- package/karnel/tools/lang/php/README.md +43 -0
- package/karnel/tools/lang/php/install.sh +79 -0
- package/karnel/tools/lang/python/README.md +43 -0
- package/karnel/tools/lang/python/install.sh +79 -0
- package/karnel/tools/lang/rust/README.md +43 -0
- package/karnel/tools/lang/rust/install.sh +79 -0
- package/karnel/tools/npm/all.sh +90 -0
- package/karnel/tools/npm/live-server/README.md +43 -0
- package/karnel/tools/npm/live-server/install.sh +96 -0
- package/karnel/tools/npm/localtunnel/README.md +43 -0
- package/karnel/tools/npm/localtunnel/install.sh +112 -0
- package/karnel/tools/npm/markserv/README.md +43 -0
- package/karnel/tools/npm/markserv/install.sh +95 -0
- package/karnel/tools/npm/ncu/README.md +43 -0
- package/karnel/tools/npm/ncu/install.sh +95 -0
- package/karnel/tools/npm/nestjs/README.md +43 -0
- package/karnel/tools/npm/nestjs/install.sh +95 -0
- package/karnel/tools/npm/ngrok/README.md +44 -0
- package/karnel/tools/npm/ngrok/install.sh +95 -0
- package/karnel/tools/npm/prettier/README.md +43 -0
- package/karnel/tools/npm/prettier/install.sh +95 -0
- package/karnel/tools/npm/psqlformat/README.md +43 -0
- package/karnel/tools/npm/psqlformat/install.sh +95 -0
- package/karnel/tools/npm/turbopack/README.md +8 -0
- package/karnel/tools/npm/turbopack/install.sh +42 -0
- package/karnel/tools/npm/typescript/README.md +43 -0
- package/karnel/tools/npm/typescript/install.sh +95 -0
- package/karnel/tools/npm/vercel/README.md +43 -0
- package/karnel/tools/npm/vercel/install.sh +95 -0
- package/karnel/tools/shell/all.sh +67 -0
- package/karnel/tools/shell/better-npm/README.md +43 -0
- package/karnel/tools/shell/better-npm/install.sh +85 -0
- package/karnel/tools/shell/fzf-tab/README.md +44 -0
- package/karnel/tools/shell/fzf-tab/install.sh +85 -0
- package/karnel/tools/shell/history-substring/README.md +43 -0
- package/karnel/tools/shell/history-substring/install.sh +85 -0
- package/karnel/tools/shell/powerlevel10k/README.md +43 -0
- package/karnel/tools/shell/powerlevel10k/install.sh +85 -0
- package/karnel/tools/shell/you-should-use/README.md +43 -0
- package/karnel/tools/shell/you-should-use/install.sh +85 -0
- package/karnel/tools/shell/zsh-autopair/README.md +44 -0
- package/karnel/tools/shell/zsh-autopair/install.sh +85 -0
- package/karnel/tools/shell/zsh-autosuggestions/README.md +43 -0
- package/karnel/tools/shell/zsh-autosuggestions/install.sh +85 -0
- package/karnel/tools/shell/zsh-completions/README.md +43 -0
- package/karnel/tools/shell/zsh-completions/install.sh +85 -0
- package/karnel/tools/shell/zsh-defer/README.md +43 -0
- package/karnel/tools/shell/zsh-defer/install.sh +85 -0
- package/karnel/tools/shell/zsh-syntax-highlighting/README.md +43 -0
- package/karnel/tools/shell/zsh-syntax-highlighting/install.sh +72 -0
- package/karnel/tools/ui/all.sh +61 -0
- package/karnel/tools/ui/banner/README.md +42 -0
- package/karnel/tools/ui/banner/install.sh +160 -0
- package/karnel/tools/ui/cursor/README.md +42 -0
- package/karnel/tools/ui/cursor/install.sh +58 -0
- package/karnel/tools/ui/extra-keys/README.md +43 -0
- package/karnel/tools/ui/extra-keys/install.sh +62 -0
- package/karnel/tools/ui/font/README.md +43 -0
- package/karnel/tools/ui/font/install.sh +63 -0
- package/karnel/tools/voice/all.sh +27 -0
- package/karnel/tools/voice/install.sh +10 -0
- package/karnel/tools/voice/uninstall.sh +8 -0
- package/karnel/utils/banner.sh +492 -0
- package/karnel/utils/bootstrap.sh +25 -0
- package/karnel/utils/colors.sh +33 -0
- package/karnel/utils/dialogrc +30 -0
- package/karnel/utils/env.sh +53 -0
- package/karnel/utils/log.sh +567 -0
- package/karnel/utils/version.sh +205 -0
- package/package.json +42 -0
- package/scripts/npm-install.js +60 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
import "@/utils/log"
|
|
4
|
+
import "@/utils/colors"
|
|
5
|
+
|
|
6
|
+
LOG_FILE="$KARNEL_CACHE/install_ai.log"
|
|
7
|
+
CLAUDE_DATA_DIR="$HOME/.local/share/karnel-data/claude"
|
|
8
|
+
|
|
9
|
+
_claude_detect_ubuntu_root() {
|
|
10
|
+
local root
|
|
11
|
+
root="$(find /data/data/com.termux -maxdepth 10 -type d \
|
|
12
|
+
-name "rootfs" -path "*/containers/ubuntu/*" 2>/dev/null | head -1)"
|
|
13
|
+
|
|
14
|
+
if [ -z "$root" ]; then
|
|
15
|
+
root="$(find /data/data/com.termux -maxdepth 10 -type d \
|
|
16
|
+
-name "ubuntu" -path "*/installed-rootfs/*" 2>/dev/null | head -1)"
|
|
17
|
+
fi
|
|
18
|
+
|
|
19
|
+
echo "$root"
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
_claude_proot_ubuntu() {
|
|
23
|
+
proot-distro login \
|
|
24
|
+
--shared-tmp \
|
|
25
|
+
ubuntu \
|
|
26
|
+
-- "$@"
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
_get_latest_claude_version() {
|
|
30
|
+
curl -fsSL https://api.github.com/repos/anthropics/claude-code/releases/latest |
|
|
31
|
+
grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/'
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
_claude_install_deps_native() {
|
|
35
|
+
loading "Installing glibc and dependencies" _claude_install_deps_native_impl
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
_claude_install_deps_native_impl() {
|
|
39
|
+
if [[ ! -f $PREFIX/etc/apt/sources.list.d/glibc.list ]]; then
|
|
40
|
+
if ! pkg install glibc-repo -y &>>"$LOG_FILE"; then
|
|
41
|
+
log_error "Failed to install glibc-repo"
|
|
42
|
+
return 1
|
|
43
|
+
fi
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
if [[ ! -f $PREFIX/glibc/lib/libc.so.6 ]]; then
|
|
47
|
+
if ! pkg install glibc -y &>>"$LOG_FILE"; then
|
|
48
|
+
log_error "Failed to install glibc"
|
|
49
|
+
return 1
|
|
50
|
+
fi
|
|
51
|
+
fi
|
|
52
|
+
|
|
53
|
+
declare -A DEPS=(
|
|
54
|
+
["clang"]="clang"
|
|
55
|
+
["curl"]="curl"
|
|
56
|
+
["tar"]="tar"
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
local pkg_name bin_name
|
|
60
|
+
for pkg_name in "${!DEPS[@]}"; do
|
|
61
|
+
bin_name="${DEPS[$pkg_name]}"
|
|
62
|
+
if [[ -n "$bin_name" ]] && command -v "$bin_name" &>/dev/null; then
|
|
63
|
+
continue
|
|
64
|
+
fi
|
|
65
|
+
if ! pkg install "$pkg_name" -y &>>"$LOG_FILE"; then
|
|
66
|
+
log_error "Failed to install $pkg_name"
|
|
67
|
+
return 1
|
|
68
|
+
fi
|
|
69
|
+
done
|
|
70
|
+
|
|
71
|
+
return 0
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
_download_claude_binary() {
|
|
75
|
+
loading "Downloading Claude Code" _download_claude_binary_impl
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
_download_claude_binary_impl() {
|
|
79
|
+
local latest_version
|
|
80
|
+
latest_version=$(_get_latest_claude_version)
|
|
81
|
+
if [ -z "$latest_version" ]; then
|
|
82
|
+
log_error "Failed to fetch latest Claude Code version"
|
|
83
|
+
return 1
|
|
84
|
+
fi
|
|
85
|
+
|
|
86
|
+
mkdir -p "$CLAUDE_DATA_DIR"
|
|
87
|
+
|
|
88
|
+
local tarball="claude-linux-arm64.tar.gz"
|
|
89
|
+
local download_url="https://github.com/anthropics/claude-code/releases/download/$latest_version/$tarball"
|
|
90
|
+
|
|
91
|
+
if ! curl -fsSL "$download_url" -o "$CLAUDE_DATA_DIR/$tarball" &>>"$LOG_FILE"; then
|
|
92
|
+
log_error "Failed to download Claude Code binary"
|
|
93
|
+
return 1
|
|
94
|
+
fi
|
|
95
|
+
|
|
96
|
+
if ! tar -zxf "$CLAUDE_DATA_DIR/$tarball" -C "$CLAUDE_DATA_DIR" &>>"$LOG_FILE"; then
|
|
97
|
+
log_error "Failed to extract Claude Code binary"
|
|
98
|
+
return 1
|
|
99
|
+
fi
|
|
100
|
+
|
|
101
|
+
rm -f "$CLAUDE_DATA_DIR/$tarball"
|
|
102
|
+
|
|
103
|
+
if [ ! -f "$CLAUDE_DATA_DIR/claude" ]; then
|
|
104
|
+
log_error "Claude Code binary not found after extraction"
|
|
105
|
+
return 1
|
|
106
|
+
fi
|
|
107
|
+
|
|
108
|
+
chmod +x "$CLAUDE_DATA_DIR/claude"
|
|
109
|
+
return 0
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
_compile_claude_helper() {
|
|
113
|
+
loading "Compiling helper" _compile_claude_helper_impl
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
_compile_claude_helper_impl() {
|
|
117
|
+
local HELPER_SRC="$KARNEL_PATH/tools/ai/claude-code/helper/claude_helper.c"
|
|
118
|
+
if [ ! -f "$HELPER_SRC" ]; then
|
|
119
|
+
log_error "Helper source not found at $HELPER_SRC"
|
|
120
|
+
return 1
|
|
121
|
+
fi
|
|
122
|
+
|
|
123
|
+
if ! clang -O2 -o "$PREFIX/bin/claude" "$HELPER_SRC" &>>"$LOG_FILE"; then
|
|
124
|
+
log_error "Failed to compile claude helper"
|
|
125
|
+
return 1
|
|
126
|
+
fi
|
|
127
|
+
|
|
128
|
+
chmod +x "$PREFIX/bin/claude"
|
|
129
|
+
return 0
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
_install_claude_native() {
|
|
133
|
+
_claude_install_deps_native || return 1
|
|
134
|
+
_download_claude_binary || return 1
|
|
135
|
+
_compile_claude_helper || return 1
|
|
136
|
+
log_success "Claude Code installed natively"
|
|
137
|
+
return 0
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
_install_claude_proot() {
|
|
141
|
+
loading "Installing Claude Code (proot-distro)" _install_claude_proot_impl
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
_install_claude_proot_impl() {
|
|
145
|
+
mkdir -p "$(dirname "$LOG_FILE")"
|
|
146
|
+
|
|
147
|
+
if ! command -v proot-distro &>/dev/null; then
|
|
148
|
+
pkg install proot-distro -y &>>"$LOG_FILE"
|
|
149
|
+
fi
|
|
150
|
+
|
|
151
|
+
if [ ! -d "$(_claude_detect_ubuntu_root)" ]; then
|
|
152
|
+
proot-distro install ubuntu &>>"$LOG_FILE"
|
|
153
|
+
fi
|
|
154
|
+
|
|
155
|
+
_claude_proot_ubuntu /bin/bash -c \
|
|
156
|
+
'apt-get update && apt-get upgrade -y && apt-get install -y curl ca-certificates' \
|
|
157
|
+
&>>"$LOG_FILE"
|
|
158
|
+
|
|
159
|
+
_claude_proot_ubuntu /bin/bash -c '
|
|
160
|
+
export SHELL=/bin/bash
|
|
161
|
+
export TMPDIR=/tmp
|
|
162
|
+
export HOME=/root
|
|
163
|
+
curl -fsSL https://claude.ai/install.sh | bash
|
|
164
|
+
' &>>"$LOG_FILE"
|
|
165
|
+
|
|
166
|
+
local ubuntu_root
|
|
167
|
+
ubuntu_root="$(_claude_detect_ubuntu_root)"
|
|
168
|
+
|
|
169
|
+
if [ -z "$ubuntu_root" ]; then
|
|
170
|
+
log_error "Ubuntu rootfs not found"
|
|
171
|
+
return 1
|
|
172
|
+
fi
|
|
173
|
+
|
|
174
|
+
if ! _claude_proot_ubuntu test -x /root/.local/bin/claude &>>"$LOG_FILE"; then
|
|
175
|
+
log_error "Claude Code binary not found after install"
|
|
176
|
+
return 1
|
|
177
|
+
fi
|
|
178
|
+
|
|
179
|
+
local wrapper_src="$KARNEL_PATH/tools/ai/claude-code/bin/claude"
|
|
180
|
+
if [ ! -f "$wrapper_src" ]; then
|
|
181
|
+
log_error "Wrapper template not found at $wrapper_src"
|
|
182
|
+
return 1
|
|
183
|
+
fi
|
|
184
|
+
sed "s|__UBUNTU_ROOTFS__|$ubuntu_root|g" "$wrapper_src" >"$PREFIX/bin/claude"
|
|
185
|
+
chmod +x "$PREFIX/bin/claude"
|
|
186
|
+
|
|
187
|
+
if ! grep -q '.local/bin' "$ubuntu_root/root/.bashrc" 2>/dev/null; then
|
|
188
|
+
printf '\n# claude-code\nexport PATH=/root/.local/bin:$PATH\n' >>"$ubuntu_root/root/.bashrc"
|
|
189
|
+
fi
|
|
190
|
+
|
|
191
|
+
return 0
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
install_claude_code() {
|
|
195
|
+
if command -v claude &>/dev/null; then
|
|
196
|
+
log_info "Claude Code is already installed"
|
|
197
|
+
return 2
|
|
198
|
+
fi
|
|
199
|
+
|
|
200
|
+
log_info "Select installation method for Claude Code:"
|
|
201
|
+
|
|
202
|
+
read_select "Installation method" SELECTED_METHOD \
|
|
203
|
+
"Native (recommended) - Run with glibc support" \
|
|
204
|
+
"Proot-distro (alternative) - Ubuntu container"
|
|
205
|
+
|
|
206
|
+
case "$SELECTED_METHOD" in
|
|
207
|
+
*Native*)
|
|
208
|
+
_install_claude_native
|
|
209
|
+
;;
|
|
210
|
+
*Proot-distro*)
|
|
211
|
+
_install_claude_proot
|
|
212
|
+
;;
|
|
213
|
+
esac
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
uninstall_claude_code() {
|
|
217
|
+
log_info "Uninstalling Claude Code..."
|
|
218
|
+
mkdir -p "$(dirname "$LOG_FILE")"
|
|
219
|
+
|
|
220
|
+
if [ ! -f "$PREFIX/bin/claude" ]; then
|
|
221
|
+
log_warn "Claude Code is not installed"
|
|
222
|
+
return 1
|
|
223
|
+
fi
|
|
224
|
+
|
|
225
|
+
if [ -f "$CLAUDE_DATA_DIR/claude" ]; then
|
|
226
|
+
rm -f "$PREFIX/bin/claude"
|
|
227
|
+
rm -rf "$CLAUDE_DATA_DIR"
|
|
228
|
+
log_success "Claude Code (native) uninstalled"
|
|
229
|
+
return 0
|
|
230
|
+
fi
|
|
231
|
+
|
|
232
|
+
_claude_proot_ubuntu /bin/bash -c \
|
|
233
|
+
'rm -f /root/.local/bin/claude && rm -rf /root/.claude && rm -rf /root/.local/share/claude' \
|
|
234
|
+
&>>"$LOG_FILE"
|
|
235
|
+
|
|
236
|
+
local ubuntu_bashrc
|
|
237
|
+
ubuntu_bashrc="$(_claude_detect_ubuntu_root)/root/.bashrc"
|
|
238
|
+
|
|
239
|
+
if [ -f "$ubuntu_bashrc" ]; then
|
|
240
|
+
sed -i '/# claude-code/d; /export PATH=\/root\/.local\/bin/d' "$ubuntu_bashrc"
|
|
241
|
+
fi
|
|
242
|
+
|
|
243
|
+
if rm -f "$PREFIX/bin/claude" &>>"$LOG_FILE"; then
|
|
244
|
+
log_success "Claude Code (proot-distro) uninstalled"
|
|
245
|
+
return 0
|
|
246
|
+
else
|
|
247
|
+
log_error "Failed to uninstall Claude Code"
|
|
248
|
+
return 1
|
|
249
|
+
fi
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
update_claude_code() {
|
|
253
|
+
log_info "Updating Claude Code..."
|
|
254
|
+
mkdir -p "$(dirname "$LOG_FILE")"
|
|
255
|
+
|
|
256
|
+
if [ -f "$CLAUDE_DATA_DIR/claude" ]; then
|
|
257
|
+
_install_claude_native
|
|
258
|
+
return $?
|
|
259
|
+
fi
|
|
260
|
+
|
|
261
|
+
_claude_proot_ubuntu /bin/bash -c '
|
|
262
|
+
export HOME=/root
|
|
263
|
+
curl -fsSL https://claude.ai/install.sh | bash
|
|
264
|
+
' &>>"$LOG_FILE"
|
|
265
|
+
|
|
266
|
+
if ! _claude_proot_ubuntu test -x /root/.local/bin/claude &>>"$LOG_FILE"; then
|
|
267
|
+
log_error "Claude Code binary not found after update"
|
|
268
|
+
return 1
|
|
269
|
+
fi
|
|
270
|
+
|
|
271
|
+
log_success "Claude Code (proot-distro) updated"
|
|
272
|
+
return 0
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
reinstall_claude_code() {
|
|
276
|
+
uninstall_claude_code
|
|
277
|
+
install_claude_code
|
|
278
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
import "@/utils/log"
|
|
4
|
+
import "@/utils/colors"
|
|
5
|
+
|
|
6
|
+
LOG_FILE="$KARNEL_CACHE/install_ai.log"
|
|
7
|
+
|
|
8
|
+
_cline_install_deps() {
|
|
9
|
+
loading "Installing dependencies" _cline_install_deps_impl
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
_cline_install_deps_impl() {
|
|
13
|
+
declare -A DEPS=(
|
|
14
|
+
["nodejs-lts"]="node"
|
|
15
|
+
["glibc-repo"]=""
|
|
16
|
+
["glibc-runner"]="glibc-runner"
|
|
17
|
+
["glibc"]=""
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
local pkg_name bin_name
|
|
21
|
+
for pkg_name in "${!DEPS[@]}"; do
|
|
22
|
+
bin_name="${DEPS[$pkg_name]}"
|
|
23
|
+
if [ -n "$bin_name" ] && command -v "$bin_name" &>/dev/null; then
|
|
24
|
+
continue
|
|
25
|
+
fi
|
|
26
|
+
if ! pkg install "$pkg_name" -y &>>"$LOG_FILE"; then
|
|
27
|
+
log_error "Failed to install $pkg_name"
|
|
28
|
+
return 1
|
|
29
|
+
fi
|
|
30
|
+
done
|
|
31
|
+
|
|
32
|
+
return 0
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
_cline_install_global() {
|
|
36
|
+
loading "Installing Cline CLI via npm" _cline_install_global_impl
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
_cline_install_global_impl() {
|
|
40
|
+
# Step 1: Install cline via npm global
|
|
41
|
+
if ! npm i -g cline &>>"$LOG_FILE"; then
|
|
42
|
+
log_error "Failed to install cline via npm"
|
|
43
|
+
return 1
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
# Step 2: Download linux-arm64 binary (glibc binary, roda via glibc-runner)
|
|
47
|
+
local version
|
|
48
|
+
version=$(npm view cline version 2>/dev/null || echo "3.0.38")
|
|
49
|
+
local tarball
|
|
50
|
+
tarball=$(mktemp "$KARNEL_DATA/cline-XXXXXX.tgz")
|
|
51
|
+
if ! curl -fsSL \
|
|
52
|
+
"https://registry.npmjs.org/@cline/cli-linux-arm64/-/cli-linux-arm64-${version}.tgz" \
|
|
53
|
+
-o "$tarball" &>>"$LOG_FILE"; then
|
|
54
|
+
log_error "Failed to download cline linux-arm64 binary (version: $version)"
|
|
55
|
+
return 1
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
# Step 3: Extract to global node_modules
|
|
59
|
+
mkdir -p /data/data/com.termux/files/usr/lib/node_modules/@cline
|
|
60
|
+
tar -xzf "$tarball" \
|
|
61
|
+
-C /data/data/com.termux/files/usr/lib/node_modules/@cline/ &>>"$LOG_FILE"
|
|
62
|
+
mv /data/data/com.termux/files/usr/lib/node_modules/@cline/package \
|
|
63
|
+
/data/data/com.termux/files/usr/lib/node_modules/@cline/cli-linux-arm64 &>>"$LOG_FILE" || true
|
|
64
|
+
rm -f "$tarball"
|
|
65
|
+
|
|
66
|
+
# Step 4: Create cached binary for fast startup
|
|
67
|
+
local binary="/data/data/com.termux/files/usr/lib/node_modules/@cline/cli-linux-arm64/bin/cline"
|
|
68
|
+
local cached="/data/data/com.termux/files/usr/lib/node_modules/cline/bin/.cline"
|
|
69
|
+
if [ -f "$binary" ]; then
|
|
70
|
+
cp "$binary" "$cached" 2>/dev/null
|
|
71
|
+
chmod 755 "$cached" 2>/dev/null
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
# Step 5: Create wrapper usando glibc-runner (sem proot!)
|
|
75
|
+
_cline_create_wrapper
|
|
76
|
+
|
|
77
|
+
return 0
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
_cline_create_wrapper() {
|
|
81
|
+
cat > "$PREFIX/bin/cline" << 'GLIBCWRAPPER'
|
|
82
|
+
#!/data/data/com.termux/files/usr/bin/env bash
|
|
83
|
+
# Cline CLI — roda nativamente no Termux via glibc-runner
|
|
84
|
+
# Usa o glibc do termux-user-repository (instalado via apt)
|
|
85
|
+
# Sem proot, sem container, sem opencode.
|
|
86
|
+
# Instalado pelo Karnel Termux (karnel install ai --cline)
|
|
87
|
+
|
|
88
|
+
CLINE_BIN="/data/data/com.termux/files/usr/lib/node_modules/cline/bin/.cline"
|
|
89
|
+
|
|
90
|
+
if [ ! -f "$CLINE_BIN" ]; then
|
|
91
|
+
CLINE_BIN="/data/data/com.termux/files/usr/lib/node_modules/@cline/cli-linux-arm64/bin/cline"
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
if [ ! -f "$CLINE_BIN" ]; then
|
|
95
|
+
echo "Erro: Cline binary nao encontrado"
|
|
96
|
+
echo "Rode: npm i -g cline"
|
|
97
|
+
exit 1
|
|
98
|
+
fi
|
|
99
|
+
|
|
100
|
+
exec glibc-runner "$CLINE_BIN" "$@"
|
|
101
|
+
GLIBCWRAPPER
|
|
102
|
+
chmod 755 "$PREFIX/bin/cline"
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
install_cline() {
|
|
106
|
+
if grep -q 'glibc-runner' "$PREFIX/bin/cline" 2>/dev/null; then
|
|
107
|
+
log_info "Cline is already installed"
|
|
108
|
+
return 2
|
|
109
|
+
fi
|
|
110
|
+
log_info "Installing Cline CLI..."
|
|
111
|
+
|
|
112
|
+
mkdir -p "$(dirname "$LOG_FILE")"
|
|
113
|
+
|
|
114
|
+
_cline_install_deps || return 1
|
|
115
|
+
_cline_install_global || return 1
|
|
116
|
+
|
|
117
|
+
log_success "Cline CLI installed"
|
|
118
|
+
return 0
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
uninstall_cline() {
|
|
122
|
+
log_info "Uninstalling Cline CLI..."
|
|
123
|
+
mkdir -p "$(dirname "$LOG_FILE")"
|
|
124
|
+
|
|
125
|
+
if command -v cline &>/dev/null; then
|
|
126
|
+
rm -f "$PREFIX/bin/cline"
|
|
127
|
+
fi
|
|
128
|
+
|
|
129
|
+
npm uninstall -g cline &>>"$LOG_FILE" || true
|
|
130
|
+
rm -rf /data/data/com.termux/files/usr/lib/node_modules/@cline/cli-linux-arm64 &>>"$LOG_FILE" || true
|
|
131
|
+
rm -f /data/data/com.termux/files/usr/lib/node_modules/cline/bin/.cline &>>"$LOG_FILE" || true
|
|
132
|
+
|
|
133
|
+
log_success "Cline CLI uninstalled"
|
|
134
|
+
return 0
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
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
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
_update_cline_impl() {
|
|
147
|
+
if ! npm update -g cline &>>"$LOG_FILE"; then
|
|
148
|
+
log_error "Failed to update cline"
|
|
149
|
+
return 1
|
|
150
|
+
fi
|
|
151
|
+
|
|
152
|
+
# Re-download linux-arm64 binary and recreate wrapper
|
|
153
|
+
_cline_install_global_impl || true
|
|
154
|
+
return 0
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
reinstall_cline() {
|
|
158
|
+
uninstall_cline
|
|
159
|
+
install_cline
|
|
160
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# CodeGraph
|
|
2
|
+
|
|
3
|
+
Analyzes your codebase structure and dependencies to improve navigation
|
|
4
|
+
|
|
5
|
+
**Package:** codegraph
|
|
6
|
+
**Author:** israel marques
|
|
7
|
+
**Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
|
|
8
|
+
**Official:** https://github.com/colbymchenry/codegraph
|
|
9
|
+
**Type:** Code analysis tool (Binary)
|
|
10
|
+
**License:** MIT
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
|
|
14
|
+
CodeGraph analyzes your codebase structure and dependencies to improve navigation. It generates interactive graphs showing relationships between files, functions, classes, and modules, making it easier to navigate and refactor large projects.
|
|
15
|
+
|
|
16
|
+
## Dependencies
|
|
17
|
+
|
|
18
|
+
- nodejs-lts, ripgrep, sqlite, git, python, clang, make, curl
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
karnel install ai --codegraph
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Uninstall
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
karnel uninstall ai --codegraph
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Update
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
karnel update ai --codegraph
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Notes
|
|
39
|
+
|
|
40
|
+
- Downloads the latest ARM64 binary from GitHub releases
|
|
41
|
+
- Wrapper script installed to `$PREFIX/bin/codegraph`
|
|
42
|
+
- Data stored in `$KARNEL_DATA/codegraph-linux-arm64/`
|
|
43
|
+
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
import "@/utils/log"
|
|
3
|
+
|
|
4
|
+
LOG_FILE="$KARNEL_CACHE/install_ai.log"
|
|
5
|
+
|
|
6
|
+
_codegraph_dependencies() {
|
|
7
|
+
loading "Installing dependencies" _codegraph_dependencies_impl
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
_codegraph_dependencies_impl() {
|
|
11
|
+
declare -A DEPS=(
|
|
12
|
+
["nodejs-lts"]="node"
|
|
13
|
+
["ripgrep"]="rg"
|
|
14
|
+
["sqlite"]="sqlite"
|
|
15
|
+
["git"]="git"
|
|
16
|
+
["python"]="python"
|
|
17
|
+
["clang"]="clang"
|
|
18
|
+
["make"]="make"
|
|
19
|
+
["curl"]="curl"
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
local pkg_name bin_name
|
|
23
|
+
for pkg_name in "${!DEPS[@]}"; do
|
|
24
|
+
bin_name="${DEPS[$pkg_name]}"
|
|
25
|
+
if ! command -v "$bin_name" &>/dev/null; then
|
|
26
|
+
if ! pkg install "$pkg_name" -y &>>"$LOG_FILE"; then
|
|
27
|
+
log_error "Failed to install $pkg_name"
|
|
28
|
+
return 1
|
|
29
|
+
fi
|
|
30
|
+
fi
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
return 0
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
_download_codegraph() {
|
|
37
|
+
loading "Downloading CodeGraph" _download_codegraph_impl
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
_download_codegraph_impl() {
|
|
41
|
+
LATEST_VERSION=$(curl -sI https://github.com/colbymchenry/codegraph/releases/latest | grep -i location | sed -E 's#.*/tag/([^[:space:]]+).*#\1#')
|
|
42
|
+
LATEST_VERSION="${LATEST_VERSION#v}"
|
|
43
|
+
|
|
44
|
+
if [ -z "$LATEST_VERSION" ]; then
|
|
45
|
+
log_error "Failed to fetch latest CodeGraph version"
|
|
46
|
+
return 1
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
if ! [[ "$LATEST_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
50
|
+
log_error "Invalid CodeGraph version from release server: $LATEST_VERSION"
|
|
51
|
+
return 1
|
|
52
|
+
fi
|
|
53
|
+
|
|
54
|
+
local tarball
|
|
55
|
+
tarball=$(mktemp "$KARNEL_DATA/codegraph-XXXXXX.tar.gz")
|
|
56
|
+
|
|
57
|
+
if ! curl -L "https://github.com/colbymchenry/codegraph/releases/download/v${LATEST_VERSION}/codegraph-linux-arm64.tar.gz" -o "$tarball" &>>"$LOG_FILE"; then
|
|
58
|
+
log_error "Failed to download CodeGraph"
|
|
59
|
+
rm -f "$tarball"
|
|
60
|
+
return 1
|
|
61
|
+
fi
|
|
62
|
+
|
|
63
|
+
if ! tar -xzf "$tarball" -C "$KARNEL_DATA" &>>"$LOG_FILE"; then
|
|
64
|
+
log_error "Failed to extract CodeGraph"
|
|
65
|
+
rm -f "$tarball"
|
|
66
|
+
return 1
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
rm -f "$tarball"
|
|
70
|
+
|
|
71
|
+
return 0
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
_write_codegraph_wrapper() {
|
|
75
|
+
loading "Creating CodeGraph wrapper" _write_codegraph_wrapper_impl
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
_write_codegraph_wrapper_impl() {
|
|
79
|
+
local wrapper_src="$KARNEL_PATH/tools/ai/codegraph/bin/codegraph"
|
|
80
|
+
if [ ! -f "$wrapper_src" ]; then
|
|
81
|
+
log_error "Wrapper template not found at $wrapper_src"
|
|
82
|
+
return 1
|
|
83
|
+
fi
|
|
84
|
+
cp "$wrapper_src" "$PREFIX/bin/codegraph"
|
|
85
|
+
chmod +x "$PREFIX/bin/codegraph"
|
|
86
|
+
|
|
87
|
+
return 0
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
install_codegraph() {
|
|
91
|
+
if command -v codegraph &>/dev/null; then
|
|
92
|
+
log_info "CodeGraph is already installed"
|
|
93
|
+
return 2
|
|
94
|
+
fi
|
|
95
|
+
log_info "Installing CodeGraph..."
|
|
96
|
+
|
|
97
|
+
mkdir -p "$(dirname "$LOG_FILE")"
|
|
98
|
+
|
|
99
|
+
_codegraph_dependencies || return 1
|
|
100
|
+
_download_codegraph || return 1
|
|
101
|
+
_write_codegraph_wrapper || return 1
|
|
102
|
+
|
|
103
|
+
log_success "CodeGraph installed"
|
|
104
|
+
return 0
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
uninstall_codegraph() {
|
|
108
|
+
if ! command -v codegraph &>/dev/null; then
|
|
109
|
+
log_info "CodeGraph is not installed"
|
|
110
|
+
return 2
|
|
111
|
+
fi
|
|
112
|
+
log_info "Uninstalling CodeGraph..."
|
|
113
|
+
mkdir -p "$(dirname "$LOG_FILE")"
|
|
114
|
+
|
|
115
|
+
loading "Removing CodeGraph" _uninstall_codegraph_impl
|
|
116
|
+
|
|
117
|
+
log_success "CodeGraph uninstalled"
|
|
118
|
+
return 0
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
_uninstall_codegraph_impl() {
|
|
122
|
+
if rm -rf "$KARNEL_DATA/codegraph-linux-arm64" && rm -f "$PREFIX/bin/codegraph" &>>"$LOG_FILE"; then
|
|
123
|
+
return 0
|
|
124
|
+
else
|
|
125
|
+
log_error "Failed to uninstall CodeGraph"
|
|
126
|
+
return 1
|
|
127
|
+
fi
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
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
|
|
138
|
+
|
|
139
|
+
log_success "CodeGraph updated"
|
|
140
|
+
return 0
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
_update_codegraph_remove_impl() {
|
|
144
|
+
if ! rm -rf "$KARNEL_DATA/codegraph-linux-arm64" &>>"$LOG_FILE"; then
|
|
145
|
+
log_error "Failed to remove old CodeGraph installation"
|
|
146
|
+
return 1
|
|
147
|
+
fi
|
|
148
|
+
|
|
149
|
+
if ! rm -f "$PREFIX/bin/codegraph" &>>"$LOG_FILE"; then
|
|
150
|
+
log_error "Failed to remove old CodeGraph wrapper"
|
|
151
|
+
return 1
|
|
152
|
+
fi
|
|
153
|
+
|
|
154
|
+
return 0
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
reinstall_codegraph() {
|
|
158
|
+
uninstall_codegraph
|
|
159
|
+
install_codegraph
|
|
160
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Codex CLI
|
|
2
|
+
|
|
3
|
+
Codex CLI is a coding agent from OpenAI that runs locally on your computer
|
|
4
|
+
|
|
5
|
+
**Package:** codex
|
|
6
|
+
**Author:** israel marques
|
|
7
|
+
**Repository:** https://github.com/israelmarques1024-dotcom/karnel-termux
|
|
8
|
+
**Official:** https://github.com/openai/codex
|
|
9
|
+
**Type:** AI coding assistant (npm global package)
|
|
10
|
+
**License:** MIT
|
|
11
|
+
|
|
12
|
+
## Description
|
|
13
|
+
|
|
14
|
+
Codex CLI is a coding agent from OpenAI that runs locally on your computer. It provides intelligent code suggestions and completions directly in your terminal.
|
|
15
|
+
|
|
16
|
+
## Dependencies
|
|
17
|
+
|
|
18
|
+
- Node.js LTS (nodejs-lts)
|
|
19
|
+
- npm
|
|
20
|
+
- git, ripgrep
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
karnel install ai --codex
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Uninstall
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
karnel uninstall ai --codex
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Update
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
karnel update ai --codex
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Notes
|
|
41
|
+
|
|
42
|
+
- Installed as a global npm package: `@mmmbuto/codex-cli-termux`
|
|
43
|
+
- Command: `codex`
|
|
44
|
+
- Requires Node.js LTS (installed automatically if missing)
|