karnel-termux 4.13.1 → 4.13.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.
- package/README.md +54 -6
- package/install.sh +21 -2
- package/karnel/bin/karnel +19 -3
- package/karnel/cli/commands/doctor.sh +1 -1
- package/karnel/cli/commands/ia.sh +2 -2
- package/karnel/cli/commands/install.sh +3 -1
- package/karnel/cli/commands/list.sh +22 -2
- package/karnel/cli/commands/reinstall.sh +8 -0
- package/karnel/cli/commands/uninstall.sh +1 -0
- package/karnel/cli/commands/update.sh +30 -16
- package/karnel/cli/commands/upgrade.sh +4 -1
- package/karnel/cli/karnel.sh +3 -1
- package/karnel/modules/ai.sh +3 -0
- package/karnel/modules/auto.sh +7 -3
- package/karnel/modules/db.sh +7 -3
- package/karnel/modules/deploy.sh +4 -0
- package/karnel/modules/dev.sh +6 -2
- package/karnel/modules/editor.sh +4 -0
- package/karnel/modules/games.sh +4 -0
- package/karnel/modules/lang.sh +7 -3
- package/karnel/modules/network.sh +4 -0
- package/karnel/modules/npm.sh +8 -4
- package/karnel/modules/shell.sh +6 -2
- package/karnel/modules/ui.sh +9 -5
- package/karnel/modules/utils.sh +4 -0
- package/karnel/modules/voice.sh +4 -0
- package/karnel/tools/ai/all.sh +2 -0
- package/karnel/tools/ai/puter/README.md +28 -0
- package/karnel/tools/ai/puter/install.sh +71 -0
- package/karnel/tools/ai/supercode-cli/README.md +34 -0
- package/karnel/tools/ai/supercode-cli/install.sh +80 -0
- package/karnel/tools/security/all.sh +23 -9
- package/karnel/utils/env.sh +5 -1
- package/karnel/utils/install.sh +13 -1
- package/package.json +1 -1
- package/scripts/npm-install.js +44 -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-4.13.
|
|
11
|
+
<img src="https://img.shields.io/badge/version-4.13.3-0078D4?style=for-the-badge" 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">
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
Created by **Israel Marques**.
|
|
35
35
|
|
|
36
|
-
- **
|
|
36
|
+
- **39 AI agents** for coding — Claude, Gemini, OpenCode, Qoder, Ollama, Goose, Factory Droid, Cline, Puter, OmniRoute and more
|
|
37
37
|
- **8 languages** — Node.js, Python, Go, Rust, C/C++, PHP, Perl, Bun
|
|
38
38
|
- **5 databases** — PostgreSQL, MariaDB, SQLite, MongoDB, Redis
|
|
39
39
|
- **22 dev tools** — gh, curl, fzf, bat, lsd, jq, tmux, openssh, snyk and more
|
|
@@ -114,7 +114,7 @@ karnel
|
|
|
114
114
|
|--------|-------------|--------------|
|
|
115
115
|
| `lang` | Node.js, Python, Go, Rust, C/C++, PHP, Perl, Bun | `karnel install lang` |
|
|
116
116
|
| `db` | PostgreSQL, MariaDB, SQLite, MongoDB, Redis | `karnel install db` |
|
|
117
|
-
| `ai` |
|
|
117
|
+
| `ai` | 39 AI agents for coding | `karnel install ai` |
|
|
118
118
|
| `editor` | code-server (VS Code in browser) | `karnel install editor` |
|
|
119
119
|
| `dev` | gh, curl, fzf, bat, lsd, jq and more | `karnel install dev` |
|
|
120
120
|
| `npm` | TypeScript, NestJS CLI, Prettier and more | `karnel install npm` |
|
|
@@ -172,6 +172,32 @@ The installed plugin directory is `${XDG_DATA_HOME:-$HOME/.local/share}/karnel-d
|
|
|
172
172
|
See the [official plugin registry](https://github.com/israelmarques1024-dotcom/karnel-plugins)
|
|
173
173
|
for schemas, review policy, and safe publication requirements.
|
|
174
174
|
|
|
175
|
+
## AI CLIs
|
|
176
|
+
|
|
177
|
+
Supercode CLI and Puter CLI are available in the `ai` module. They require
|
|
178
|
+
Node.js 18 or newer and install their official npm packages.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
karnel install ai --supercode-cli
|
|
182
|
+
supercode
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## Puter CLI
|
|
186
|
+
|
|
187
|
+
Puter CLI is available in the `ai` module for managing Puter sites and workers.
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
karnel install ai --puter
|
|
191
|
+
puter login
|
|
192
|
+
puter whoami
|
|
193
|
+
puter site deploy [directory] [subdomain]
|
|
194
|
+
puter worker deploy [file] [name]
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
For noninteractive automation, configure `PUTER_AUTH_TOKEN` in your own
|
|
198
|
+
environment. Do not place tokens in the repository, shell history, screenshots,
|
|
199
|
+
or issue reports.
|
|
200
|
+
|
|
175
201
|
## Security Tools
|
|
176
202
|
|
|
177
203
|
Install security auditing tools:
|
|
@@ -181,7 +207,9 @@ karnel install security # Install all
|
|
|
181
207
|
karnel install security --nmap --hydra --sqlmap # Install specific ones
|
|
182
208
|
```
|
|
183
209
|
|
|
184
|
-
Includes: Nmap, Hydra, Nikto, SQLMap, Gobuster, Dirb, WPScan, John the
|
|
210
|
+
Includes 30 tools: Nmap, Hydra, Nikto, SQLMap, Gobuster, Dirb, WPScan, John the
|
|
211
|
+
Ripper, Aircrack-ng, Metasploit, Burp Suite, OWASP ZAP, FFUF, Amass, Hashcat and
|
|
212
|
+
more. Use only on systems you own or are authorized to test.
|
|
185
213
|
|
|
186
214
|
---
|
|
187
215
|
|
|
@@ -492,7 +520,7 @@ karnel/
|
|
|
492
520
|
│ │ └── karnel.sh # Main CLI (with TUI)
|
|
493
521
|
│ ├── modules/ # Module orchestrators
|
|
494
522
|
│ ├── tools/ # Tool installers
|
|
495
|
-
│ │ ├── ai/ #
|
|
523
|
+
│ │ ├── ai/ # 39 AI agents
|
|
496
524
|
│ │ ├── lang/ # 8 languages
|
|
497
525
|
│ │ ├── db/ # 5 databases
|
|
498
526
|
│ │ ├── dev/ # 22 dev tools
|
|
@@ -503,7 +531,7 @@ karnel/
|
|
|
503
531
|
│ │ ├── auto/ # 1 automation tool
|
|
504
532
|
│ │ ├── network/ # 2 network tools
|
|
505
533
|
│ │ ├── utils/ # 11 utility tools
|
|
506
|
-
│ │ ├── games/ #
|
|
534
|
+
│ │ ├── games/ # 6 games
|
|
507
535
|
│ │ ├── security/ # 30 security tools
|
|
508
536
|
│ │ └── deploy/ # 4 deploy CLIs
|
|
509
537
|
│ └── utils/ # Utilities (banner, log, env, etc.)
|
|
@@ -540,6 +568,26 @@ The framework checks for updates every 24 hours in background.
|
|
|
540
568
|
karnel update karnel # Update the framework
|
|
541
569
|
```
|
|
542
570
|
|
|
571
|
+
`karnel update` requires a target such as `karnel`, `ai`, or `security`.
|
|
572
|
+
`karnel update karnel` first runs the official curl installer, then falls back to
|
|
573
|
+
the local Git checkout and package-manager installs if needed. The framework
|
|
574
|
+
checks for a new version in the background at most once every 24 hours; the check
|
|
575
|
+
can use npm or GitHub and writes state under `$KARNEL_CACHE`.
|
|
576
|
+
|
|
577
|
+
---
|
|
578
|
+
|
|
579
|
+
## Verification And Limits
|
|
580
|
+
|
|
581
|
+
The repository CI validates Bash/Zsh syntax, ShellCheck errors, CLI smoke tests,
|
|
582
|
+
version behavior, Robin contracts, plugin lifecycle contracts, and npm package
|
|
583
|
+
contents. The official documentation site validates its catalog contracts,
|
|
584
|
+
TypeScript, formatting, tests, and production build.
|
|
585
|
+
|
|
586
|
+
These checks do not install every external tool or prove behavior on every Android
|
|
587
|
+
device. Before relying on a new installer, test it in native Termux aarch64 with a
|
|
588
|
+
disposable environment and verify network, storage, PRoot, and Termux:API behavior
|
|
589
|
+
for your device.
|
|
590
|
+
|
|
543
591
|
---
|
|
544
592
|
|
|
545
593
|
## Support the Project
|
package/install.sh
CHANGED
|
@@ -66,13 +66,21 @@ log_info() {
|
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
_INSTALL_CREATED_KARNEL_REPO=false
|
|
69
|
+
_INSTALL_CREATED_KARNEL_SYMLINK=false
|
|
70
|
+
_INSTALL_PREVIOUS_KARNEL_SYMLINK=""
|
|
69
71
|
|
|
70
72
|
_cleanup_failed() {
|
|
71
73
|
echo -e "\n ${P_FAIL}✖${P_NC} Installation failed at step ${CURRENT_STEP}. Cleaning up..."
|
|
72
74
|
if $_INSTALL_CREATED_KARNEL_REPO && [[ -d "$KARNEL_REPO" ]]; then
|
|
73
75
|
rm -rf "$KARNEL_REPO"
|
|
74
76
|
fi
|
|
75
|
-
[[ -L "$PREFIX/bin/karnel" ]]
|
|
77
|
+
if $_INSTALL_CREATED_KARNEL_SYMLINK && [[ -L "$PREFIX/bin/karnel" ]]; then
|
|
78
|
+
if [[ -n "$_INSTALL_PREVIOUS_KARNEL_SYMLINK" ]]; then
|
|
79
|
+
ln -sfn "$_INSTALL_PREVIOUS_KARNEL_SYMLINK" "$PREFIX/bin/karnel"
|
|
80
|
+
else
|
|
81
|
+
rm -f "$PREFIX/bin/karnel"
|
|
82
|
+
fi
|
|
83
|
+
fi
|
|
76
84
|
echo -e " ${P_DIM}Run install.sh again to retry${P_NC}"
|
|
77
85
|
exit 1
|
|
78
86
|
}
|
|
@@ -195,7 +203,10 @@ clone_repo() {
|
|
|
195
203
|
log_ok "Using local repository"
|
|
196
204
|
elif [[ -d "$KARNEL_REPO/.git" ]]; then
|
|
197
205
|
progress_bar 3 10
|
|
198
|
-
git -C "$KARNEL_REPO" pull origin "$BRANCH" &>/dev/null
|
|
206
|
+
if ! git -C "$KARNEL_REPO" pull origin "$BRANCH" &>/dev/null; then
|
|
207
|
+
log_fail "Failed to update existing repository"
|
|
208
|
+
return 1
|
|
209
|
+
fi
|
|
199
210
|
progress_bar 10 10
|
|
200
211
|
echo
|
|
201
212
|
log_ok "Repository updated"
|
|
@@ -235,10 +246,18 @@ create_symlink() {
|
|
|
235
246
|
|
|
236
247
|
command -v termux-fix-shebang &>/dev/null && termux-fix-shebang "$KARNEL_REPO/karnel/bin/karnel" &>/dev/null
|
|
237
248
|
|
|
249
|
+
if [[ -e "$PREFIX/bin/karnel" && ! -L "$PREFIX/bin/karnel" ]]; then
|
|
250
|
+
log_fail "Refusing to replace existing non-symlink: $PREFIX/bin/karnel"
|
|
251
|
+
return 1
|
|
252
|
+
fi
|
|
253
|
+
if [[ -L "$PREFIX/bin/karnel" ]]; then
|
|
254
|
+
_INSTALL_PREVIOUS_KARNEL_SYMLINK="$(readlink "$PREFIX/bin/karnel")"
|
|
255
|
+
fi
|
|
238
256
|
rm -f "$PREFIX/bin/karnel"
|
|
239
257
|
ln -sf "$KARNEL_REPO/karnel/bin/karnel" "$PREFIX/bin/karnel"
|
|
240
258
|
|
|
241
259
|
if [[ -L "$PREFIX/bin/karnel" ]]; then
|
|
260
|
+
_INSTALL_CREATED_KARNEL_SYMLINK=true
|
|
242
261
|
log_ok "Symlink created: karnel → ${KARNEL_REPO}/karnel/bin/karnel"
|
|
243
262
|
else
|
|
244
263
|
log_fail "Failed to create symlink"
|
package/karnel/bin/karnel
CHANGED
|
@@ -23,6 +23,11 @@ source "$KARNEL_PATH/utils/bootstrap.sh"
|
|
|
23
23
|
# cargar entorno
|
|
24
24
|
import "@/utils/env"
|
|
25
25
|
|
|
26
|
+
# ===== SEMVER COMPARISON =====
|
|
27
|
+
_semver_gt() {
|
|
28
|
+
[[ "$(printf '%s\n%s' "$1" "$2" | sort -V | tail -1)" == "$1" ]] && [[ "$1" != "$2" ]]
|
|
29
|
+
}
|
|
30
|
+
|
|
26
31
|
# ===== CHECK UPDATES =====
|
|
27
32
|
check_for_updates() {
|
|
28
33
|
local version_file="$KARNEL_CACHE/last_version_check"
|
|
@@ -42,10 +47,16 @@ check_for_updates() {
|
|
|
42
47
|
echo "$current_time" > "$version_file"
|
|
43
48
|
|
|
44
49
|
(
|
|
45
|
-
local remote_version
|
|
50
|
+
local remote_version
|
|
51
|
+
remote_version=$(timeout 5 npm view karnel-termux version 2>/dev/null | tail -1)
|
|
52
|
+
if [[ -z "$remote_version" ]]; then
|
|
53
|
+
remote_version=$(curl -fsSL --max-time 5 "https://raw.githubusercontent.com/israelmarques1024-dotcom/karnel-termux/main/karnel/utils/env.sh" 2>/dev/null | grep "KARNEL_VERSION=" | cut -d'"' -f2)
|
|
54
|
+
fi
|
|
46
55
|
local local_version="$KARNEL_VERSION"
|
|
47
|
-
if [[ -n "$remote_version" ]] &&
|
|
56
|
+
if [[ -n "$remote_version" ]] && _semver_gt "$remote_version" "$local_version"; then
|
|
48
57
|
echo "$remote_version" > "$KARNEL_CACHE/new_version"
|
|
58
|
+
else
|
|
59
|
+
rm -f "$KARNEL_CACHE/new_version"
|
|
49
60
|
fi
|
|
50
61
|
) &>/dev/null &
|
|
51
62
|
}
|
|
@@ -53,7 +64,12 @@ check_for_updates() {
|
|
|
53
64
|
show_update_notification() {
|
|
54
65
|
local new_version_file="$KARNEL_CACHE/new_version"
|
|
55
66
|
if [[ -f "$new_version_file" ]]; then
|
|
56
|
-
local new_version
|
|
67
|
+
local new_version
|
|
68
|
+
new_version=$(cat "$new_version_file")
|
|
69
|
+
if ! _semver_gt "$new_version" "$KARNEL_VERSION"; then
|
|
70
|
+
rm -f "$new_version_file"
|
|
71
|
+
return 0
|
|
72
|
+
fi
|
|
57
73
|
echo
|
|
58
74
|
separator_section "Update Available"
|
|
59
75
|
echo
|
|
@@ -594,7 +594,7 @@ doctor_termux() {
|
|
|
594
594
|
separator_section "AI Tools Installed"
|
|
595
595
|
echo
|
|
596
596
|
|
|
597
|
-
local -a ai_cmds=("opencode" "claude" "gemini" "codex" "qwen" "vibe" "mimo" "hermes" "kimi" "ollama" "freebuff" "pi" "agy" "mmx" "gentle-ai" "gga" "engram" "codegraph" "kilocode" "kiro" "crush" "odysseus" "openclaude" "openclaw" "command-code" "kimchi" "cline" "omni-route" "ctx7" "openspec" "copilot")
|
|
597
|
+
local -a ai_cmds=("opencode" "claude" "gemini" "codex" "qwen" "vibe" "mimo" "hermes" "kimi" "ollama" "freebuff" "pi" "agy" "mmx" "gentle-ai" "gga" "engram" "codegraph" "kilocode" "kiro" "crush" "odysseus" "openclaude" "openclaw" "command-code" "kimchi" "cline" "omni-route" "ctx7" "openspec" "copilot" "supercode" "puter")
|
|
598
598
|
local ai_count=0
|
|
599
599
|
|
|
600
600
|
for cmd in "${ai_cmds[@]}"; do
|
|
@@ -431,7 +431,7 @@ ia_routes() {
|
|
|
431
431
|
local -a routes=()
|
|
432
432
|
|
|
433
433
|
# Collect all available AI CLIs (em sincronia com AI_TOOLS_REGISTRY em tools/ai/all.sh)
|
|
434
|
-
for cmd in qwen gemini claude vibe openclaude openclaw ollama codex opencode mimo engram codegraph pi agy mmx gentle-ai gga hermes kimi command-code freebuff kilocode kiro cline crush odysseus kimchi omni-route ctx7 openspec copilot amp cursor omp goose droid; do
|
|
434
|
+
for cmd in qwen gemini claude vibe openclaude openclaw ollama codex opencode mimo engram codegraph pi agy mmx gentle-ai gga hermes kimi command-code freebuff kilocode kiro cline crush odysseus kimchi omni-route ctx7 openspec copilot amp cursor omp goose droid supercode puter; do
|
|
435
435
|
if command -v "$cmd" &>/dev/null; then
|
|
436
436
|
local path
|
|
437
437
|
path=$(command -v "$cmd")
|
|
@@ -509,4 +509,4 @@ ia_main() {
|
|
|
509
509
|
return 1
|
|
510
510
|
;;
|
|
511
511
|
esac
|
|
512
|
-
}
|
|
512
|
+
}
|
|
@@ -167,6 +167,7 @@ _install_full_module() {
|
|
|
167
167
|
*)
|
|
168
168
|
log_warn "Unknown install target: $target"
|
|
169
169
|
echo "Run 'karnel install' to see available targets"
|
|
170
|
+
return 1
|
|
170
171
|
;;
|
|
171
172
|
esac
|
|
172
173
|
}
|
|
@@ -833,6 +834,7 @@ _install_specific_tools() {
|
|
|
833
834
|
*)
|
|
834
835
|
log_warn "Unknown install target: $module"
|
|
835
836
|
echo "Run 'karnel install' to see available targets"
|
|
836
|
-
|
|
837
|
+
return 1
|
|
838
|
+
;;
|
|
837
839
|
esac
|
|
838
840
|
}
|
|
@@ -204,6 +204,8 @@ _list_ai() {
|
|
|
204
204
|
table_row "Goose CLI" "--goose" "goose" "$(_check_cmd "goose")"
|
|
205
205
|
table_row "Factory Droid" "--droid" "droid" "$(_check_cmd "droid")"
|
|
206
206
|
table_row "Copilot-Termux" "--copilot-termux" "copilot" "$(_check_cmd "copilot")"
|
|
207
|
+
table_row "Supercode CLI" "--supercode-cli" "supercode" "$(_check_cmd "supercode")"
|
|
208
|
+
table_row "Puter CLI" "--puter" "puter" "$(_check_cmd "puter")"
|
|
207
209
|
table_end
|
|
208
210
|
|
|
209
211
|
echo
|
|
@@ -555,6 +557,26 @@ _list_security() {
|
|
|
555
557
|
table_row "John the Ripper" "--john" "john" "$(_check_cmd "john")"
|
|
556
558
|
table_row "Aircrack-ng" "--aircrack-ng" "aircrack-ng" "$(_check_cmd "aircrack-ng")"
|
|
557
559
|
table_row "Metasploit" "--metasploit" "msfconsole" "$(_check_cmd "msfconsole")"
|
|
560
|
+
table_row "Burp Suite" "--burpsuite" "burpsuite" "$(_check_cmd "burpsuite")"
|
|
561
|
+
table_row "OWASP ZAP" "--zap" "zap" "$(_check_cmd "zap")"
|
|
562
|
+
table_row "Enum4linux" "--enum4linux" "enum4linux" "$(_check_cmd "enum4linux")"
|
|
563
|
+
table_row "SMB client" "--smbclient" "smbclient" "$(_check_cmd "smbclient")"
|
|
564
|
+
table_row "FFUF" "--ffuf" "ffuf" "$(_check_cmd "ffuf")"
|
|
565
|
+
table_row "WhatWeb" "--whatweb" "whatweb" "$(_check_cmd "whatweb")"
|
|
566
|
+
table_row "WAFW00F" "--wafw00f" "wafw00f" "$(_check_cmd "wafw00f")"
|
|
567
|
+
table_row "DNSRecon" "--dnsrecon" "dnsrecon" "$(_check_cmd "dnsrecon")"
|
|
568
|
+
table_row "theHarvester" "--theharvester" "theHarvester" "$(_check_cmd "theHarvester")"
|
|
569
|
+
table_row "Subfinder" "--subfinder" "subfinder" "$(_check_cmd "subfinder")"
|
|
570
|
+
table_row "Amass" "--amass" "amass" "$(_check_cmd "amass")"
|
|
571
|
+
table_row "Masscan" "--masscan" "masscan" "$(_check_cmd "masscan")"
|
|
572
|
+
table_row "Netcat" "--netcat" "nc" "$(_check_cmd "nc")"
|
|
573
|
+
table_row "Tcpdump" "--tcpdump" "tcpdump" "$(_check_cmd "tcpdump")"
|
|
574
|
+
table_row "Whois" "--whois" "whois" "$(_check_cmd "whois")"
|
|
575
|
+
table_row "Hashcat" "--hashcat" "hashcat" "$(_check_cmd "hashcat")"
|
|
576
|
+
table_row "Binwalk" "--binwalk" "binwalk" "$(_check_cmd "binwalk")"
|
|
577
|
+
table_row "Foremost" "--foremost" "foremost" "$(_check_cmd "foremost")"
|
|
578
|
+
table_row "Steghide" "--steghide" "steghide" "$(_check_cmd "steghide")"
|
|
579
|
+
table_row "ExifTool" "--exiftool" "exiftool" "$(_check_cmd "exiftool")"
|
|
558
580
|
table_end
|
|
559
581
|
echo
|
|
560
582
|
log_info "Install all: ${D_CYAN}karnel install security${NC}"
|
|
@@ -571,5 +593,3 @@ _list_voice() {
|
|
|
571
593
|
list_item "Usage: ${D_CYAN}karnel install voice${NC}"
|
|
572
594
|
echo
|
|
573
595
|
}
|
|
574
|
-
|
|
575
|
-
|
|
@@ -283,6 +283,14 @@ _reinstall_specific_tools() {
|
|
|
283
283
|
reinstall_openspec
|
|
284
284
|
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
285
285
|
;;
|
|
286
|
+
supercode-cli)
|
|
287
|
+
reinstall_supercode_cli
|
|
288
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
289
|
+
;;
|
|
290
|
+
puter)
|
|
291
|
+
reinstall_puter
|
|
292
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
293
|
+
;;
|
|
286
294
|
copilot-termux)
|
|
287
295
|
reinstall_copilot_termux
|
|
288
296
|
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
@@ -168,6 +168,7 @@ _update_full_module() {
|
|
|
168
168
|
*)
|
|
169
169
|
log_warn "Unknown update target: $target"
|
|
170
170
|
echo "Run 'karnel update' to see available targets"
|
|
171
|
+
return 1
|
|
171
172
|
;;
|
|
172
173
|
esac
|
|
173
174
|
}
|
|
@@ -190,23 +191,49 @@ update_karnel() {
|
|
|
190
191
|
separator
|
|
191
192
|
echo
|
|
192
193
|
|
|
193
|
-
#
|
|
194
|
+
# The official installer keeps all installation layouts consistent.
|
|
195
|
+
_update_try_curl && { _update_cleanup; return 0; }
|
|
194
196
|
_update_try_git && { _update_cleanup; return 0; }
|
|
195
197
|
_update_try_npm && { _update_cleanup; return 0; }
|
|
196
198
|
_update_try_npm_install && { _update_cleanup; return 0; }
|
|
197
199
|
_update_try_pnpm && { _update_cleanup; return 0; }
|
|
198
|
-
_update_try_curl && { _update_cleanup; return 0; }
|
|
199
200
|
|
|
200
201
|
log_error "All update methods failed"
|
|
201
202
|
_update_show_manual
|
|
202
203
|
|
|
203
204
|
echo
|
|
205
|
+
return 1
|
|
204
206
|
}
|
|
205
207
|
|
|
206
208
|
_update_cleanup() {
|
|
207
209
|
rm -f "$KARNEL_CACHE/new_version" "$KARNEL_CACHE/last_version_check"
|
|
208
210
|
}
|
|
209
211
|
|
|
212
|
+
_update_try_curl() {
|
|
213
|
+
command -v curl &>/dev/null || return 1
|
|
214
|
+
|
|
215
|
+
local installer
|
|
216
|
+
installer=$(mktemp "${TMPDIR:-/tmp}/karnel-install.XXXXXX") || return 1
|
|
217
|
+
|
|
218
|
+
log_info "Trying the official curl installer..."
|
|
219
|
+
if ! curl --fail --silent --show-error --location \
|
|
220
|
+
"https://raw.githubusercontent.com/israelmarques1024-dotcom/karnel-termux/main/install.sh" \
|
|
221
|
+
-o "$installer"; then
|
|
222
|
+
rm -f "$installer"
|
|
223
|
+
return 1
|
|
224
|
+
fi
|
|
225
|
+
|
|
226
|
+
if bash "$installer"; then
|
|
227
|
+
rm -f "$installer"
|
|
228
|
+
log_success "Karnel-Termux updated via curl"
|
|
229
|
+
return 0
|
|
230
|
+
fi
|
|
231
|
+
|
|
232
|
+
rm -f "$installer"
|
|
233
|
+
log_error "Curl update failed"
|
|
234
|
+
return 1
|
|
235
|
+
}
|
|
236
|
+
|
|
210
237
|
_update_try_git() {
|
|
211
238
|
[[ -d "$KARNEL_PATH/../.git" ]] || return 1
|
|
212
239
|
loading "Updating via git" _update_karnel_repo
|
|
@@ -261,25 +288,12 @@ _update_try_pnpm() {
|
|
|
261
288
|
return 1
|
|
262
289
|
}
|
|
263
290
|
|
|
264
|
-
_update_try_curl() {
|
|
265
|
-
command -v curl &>/dev/null || return 1
|
|
266
|
-
log_info "Trying curl reinstall..."
|
|
267
|
-
local tmp_install
|
|
268
|
-
tmp_install=$(mktemp "${TMPDIR:-/tmp}/karnel.XXXXXX")
|
|
269
|
-
if curl -fsSL "https://raw.githubusercontent.com/israelmarques1024-dotcom/karnel-termux/main/install.sh" -o "$tmp_install" 2>/dev/null; then
|
|
270
|
-
head -5 "$tmp_install" | grep -qi "karnel" || { rm -f "$tmp_install"; log_error "Downloaded file is not a valid Karnel installer"; return 1; }
|
|
271
|
-
bash "$tmp_install" 2>/dev/null && { rm -f "$tmp_install"; log_success "Updated via curl"; return 0; }
|
|
272
|
-
fi
|
|
273
|
-
rm -f "$tmp_install"
|
|
274
|
-
return 1
|
|
275
|
-
}
|
|
276
|
-
|
|
277
291
|
_update_show_manual() {
|
|
278
292
|
log_info "Update manually with one of these:"
|
|
279
293
|
echo
|
|
294
|
+
echo ' bash -c "$(curl -fsSL https://raw.githubusercontent.com/israelmarques1024-dotcom/karnel-termux/main/install.sh)"'
|
|
280
295
|
echo " npm install -g karnel-termux@latest"
|
|
281
296
|
echo " pnpm add -g karnel-termux@latest"
|
|
282
|
-
echo " bash -c \"\$(curl -fsSL https://raw.githubusercontent.com/israelmarques1024-dotcom/karnel-termux/main/install.sh)\""
|
|
283
297
|
echo
|
|
284
298
|
}
|
|
285
299
|
|
|
@@ -10,7 +10,10 @@ upgrade_main() {
|
|
|
10
10
|
echo
|
|
11
11
|
|
|
12
12
|
import "@/cli/commands/update"
|
|
13
|
-
update_karnel
|
|
13
|
+
if ! update_karnel; then
|
|
14
|
+
log_error "Karnel upgrade failed"
|
|
15
|
+
return 1
|
|
16
|
+
fi
|
|
14
17
|
|
|
15
18
|
source "$KARNEL_PATH/utils/env.sh" 2>/dev/null
|
|
16
19
|
log_success "Karnel upgraded to v$KARNEL_VERSION"
|
package/karnel/cli/karnel.sh
CHANGED
|
@@ -110,7 +110,7 @@ karnel_help() {
|
|
|
110
110
|
echo
|
|
111
111
|
log_info "Use with: karnel install|update|reinstall|uninstall <target> [--tool...]"
|
|
112
112
|
echo
|
|
113
|
-
|
|
113
|
+
printf " ${D_GREEN}%-10s${NC} %s\n" "ai" "38 AI tools (OpenCode, Claude, Ollama, Copilot-Termux, Goose, etc.)"
|
|
114
114
|
printf " ${D_GREEN}%-10s${NC} %s\n" "auto" "Automation (n8n)"
|
|
115
115
|
printf " ${D_GREEN}%-10s${NC} %s\n" "db" "PostgreSQL, MariaDB, SQLite, MongoDB, Redis"
|
|
116
116
|
printf " ${D_GREEN}%-10s${NC} %s\n" "deploy" "Vercel, Railway, Netlify, Supabase CLIs"
|
|
@@ -791,6 +791,8 @@ _tui_install_checklist() {
|
|
|
791
791
|
"oh-my-pi" "Oh-My-Pi" OFF
|
|
792
792
|
"goose" "Goose CLI" OFF
|
|
793
793
|
"droid" "Factory Droid" OFF
|
|
794
|
+
"supercode-cli" "Supercode CLI" OFF
|
|
795
|
+
"puter" "Puter CLI" OFF
|
|
794
796
|
)
|
|
795
797
|
;;
|
|
796
798
|
dev)
|
package/karnel/modules/ai.sh
CHANGED
|
@@ -89,6 +89,7 @@ uninstall_ai() {
|
|
|
89
89
|
else
|
|
90
90
|
log_warn "AI tools uninstalled with $rc failure(s)"
|
|
91
91
|
fi
|
|
92
|
+
return "$rc"
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
_uninstall_ai_tools_wrapper() {
|
|
@@ -111,6 +112,7 @@ update_ai() {
|
|
|
111
112
|
else
|
|
112
113
|
log_warn "AI tools updated with $rc failure(s)"
|
|
113
114
|
fi
|
|
115
|
+
return "$rc"
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
_update_ai_tools_wrapper() {
|
|
@@ -147,4 +149,5 @@ reinstall_ai() {
|
|
|
147
149
|
log_warn "AI tools reinstalled with $rc failure(s)"
|
|
148
150
|
fi
|
|
149
151
|
echo
|
|
152
|
+
return "$rc"
|
|
150
153
|
}
|
package/karnel/modules/auto.sh
CHANGED
|
@@ -26,6 +26,7 @@ install_auto() {
|
|
|
26
26
|
echo
|
|
27
27
|
list_item "n8n"
|
|
28
28
|
echo
|
|
29
|
+
return "$rc"
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
_install_auto_wrapper() {
|
|
@@ -53,6 +54,7 @@ uninstall_auto() {
|
|
|
53
54
|
else
|
|
54
55
|
log_warn "$rc automation tool(s) failed to uninstall"
|
|
55
56
|
fi
|
|
57
|
+
return "$rc"
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
_uninstall_auto_wrapper() {
|
|
@@ -76,6 +78,7 @@ update_auto() {
|
|
|
76
78
|
else
|
|
77
79
|
log_warn "$rc automation tool(s) failed to update"
|
|
78
80
|
fi
|
|
81
|
+
return "$rc"
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
_update_auto_wrapper() {
|
|
@@ -103,12 +106,13 @@ reinstall_auto() {
|
|
|
103
106
|
fi
|
|
104
107
|
separator
|
|
105
108
|
echo
|
|
106
|
-
|
|
107
|
-
|
|
109
|
+
list_item "n8n"
|
|
110
|
+
echo
|
|
111
|
+
return "$rc"
|
|
108
112
|
}
|
|
109
113
|
|
|
110
114
|
_reinstall_auto_wrapper() {
|
|
111
115
|
import "@/tools/auto/all"
|
|
112
116
|
reinstall_all_auto_tools
|
|
113
117
|
return $?
|
|
114
|
-
}
|
|
118
|
+
}
|
package/karnel/modules/db.sh
CHANGED
|
@@ -35,6 +35,7 @@ install_db() {
|
|
|
35
35
|
list_item "MongoDB"
|
|
36
36
|
list_item "Redis"
|
|
37
37
|
echo
|
|
38
|
+
return "$install_rc"
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
_install_db_tools_wrapper() {
|
|
@@ -65,6 +66,7 @@ uninstall_db() {
|
|
|
65
66
|
else
|
|
66
67
|
log_warn "$rc database(s) failed to uninstall"
|
|
67
68
|
fi
|
|
69
|
+
return "$rc"
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
_uninstall_db_tools_wrapper() {
|
|
@@ -91,6 +93,7 @@ update_db() {
|
|
|
91
93
|
else
|
|
92
94
|
log_warn "$rc database(s) failed to update"
|
|
93
95
|
fi
|
|
96
|
+
return "$rc"
|
|
94
97
|
}
|
|
95
98
|
|
|
96
99
|
_update_db_tools_wrapper() {
|
|
@@ -123,12 +126,13 @@ reinstall_db() {
|
|
|
123
126
|
list_item "MariaDB (MySQL)"
|
|
124
127
|
list_item "SQLite"
|
|
125
128
|
list_item "MongoDB"
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
list_item "Redis"
|
|
130
|
+
echo
|
|
131
|
+
return "$rc"
|
|
128
132
|
}
|
|
129
133
|
|
|
130
134
|
_reinstall_db_tools_wrapper() {
|
|
131
135
|
import "@/tools/db/all"
|
|
132
136
|
reinstall_all_db_tools
|
|
133
137
|
return $?
|
|
134
|
-
}
|
|
138
|
+
}
|
package/karnel/modules/deploy.sh
CHANGED
|
@@ -20,6 +20,7 @@ install_deploy() {
|
|
|
20
20
|
else
|
|
21
21
|
log_warn "$rc deploy tool(s) failed to install"
|
|
22
22
|
fi
|
|
23
|
+
return "$rc"
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
_install_deploy_wrapper() {
|
|
@@ -45,6 +46,7 @@ uninstall_deploy() {
|
|
|
45
46
|
else
|
|
46
47
|
log_warn "$rc deploy tool(s) failed to uninstall"
|
|
47
48
|
fi
|
|
49
|
+
return "$rc"
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
update_deploy() {
|
|
@@ -60,6 +62,7 @@ update_deploy() {
|
|
|
60
62
|
else
|
|
61
63
|
log_warn "$rc deploy tool(s) failed to update"
|
|
62
64
|
fi
|
|
65
|
+
return "$rc"
|
|
63
66
|
}
|
|
64
67
|
|
|
65
68
|
reinstall_deploy() {
|
|
@@ -75,4 +78,5 @@ reinstall_deploy() {
|
|
|
75
78
|
else
|
|
76
79
|
log_warn "$rc deploy tool(s) failed to reinstall"
|
|
77
80
|
fi
|
|
81
|
+
return "$rc"
|
|
78
82
|
}
|
package/karnel/modules/dev.sh
CHANGED
|
@@ -26,6 +26,7 @@ install_dev() {
|
|
|
26
26
|
echo
|
|
27
27
|
_show_dev_summary
|
|
28
28
|
echo
|
|
29
|
+
return "$rc"
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
_install_dev_wrapper() {
|
|
@@ -53,6 +54,7 @@ uninstall_dev() {
|
|
|
53
54
|
else
|
|
54
55
|
log_warn "$rc tool(s) failed to uninstall"
|
|
55
56
|
fi
|
|
57
|
+
return "$rc"
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
_uninstall_dev_wrapper() {
|
|
@@ -76,6 +78,7 @@ update_dev() {
|
|
|
76
78
|
else
|
|
77
79
|
log_warn "$rc tool(s) failed to update"
|
|
78
80
|
fi
|
|
81
|
+
return "$rc"
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
_update_dev_wrapper() {
|
|
@@ -101,8 +104,9 @@ reinstall_dev() {
|
|
|
101
104
|
fi
|
|
102
105
|
separator
|
|
103
106
|
echo
|
|
104
|
-
|
|
105
|
-
|
|
107
|
+
_show_dev_summary
|
|
108
|
+
echo
|
|
109
|
+
return "$rc"
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
_reinstall_dev_wrapper() {
|
package/karnel/modules/editor.sh
CHANGED
|
@@ -28,6 +28,7 @@ install_editor() {
|
|
|
28
28
|
list_item "Access at http://localhost:8080"
|
|
29
29
|
list_item "Set password: ${D_CYAN}code-server --auth password${NC}"
|
|
30
30
|
echo
|
|
31
|
+
return "$rc"
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
uninstall_editor() {
|
|
@@ -49,6 +50,7 @@ uninstall_editor() {
|
|
|
49
50
|
else
|
|
50
51
|
log_warn "$rc editor component(s) failed to uninstall"
|
|
51
52
|
fi
|
|
53
|
+
return "$rc"
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
update_editor() {
|
|
@@ -66,6 +68,7 @@ update_editor() {
|
|
|
66
68
|
else
|
|
67
69
|
log_warn "$rc editor component(s) failed to update"
|
|
68
70
|
fi
|
|
71
|
+
return "$rc"
|
|
69
72
|
}
|
|
70
73
|
|
|
71
74
|
reinstall_editor() {
|
|
@@ -88,6 +91,7 @@ reinstall_editor() {
|
|
|
88
91
|
list_item "code-server (VS Code in browser)"
|
|
89
92
|
list_item "Access at http://localhost:8080"
|
|
90
93
|
echo
|
|
94
|
+
return "$rc"
|
|
91
95
|
}
|
|
92
96
|
|
|
93
97
|
_install_editor_wrapper() {
|
package/karnel/modules/games.sh
CHANGED
|
@@ -25,6 +25,7 @@ install_games() {
|
|
|
25
25
|
fi
|
|
26
26
|
separator
|
|
27
27
|
echo
|
|
28
|
+
return "$rc"
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
uninstall_games() {
|
|
@@ -47,6 +48,7 @@ uninstall_games() {
|
|
|
47
48
|
else
|
|
48
49
|
log_warn "$rc game(s) failed to uninstall"
|
|
49
50
|
fi
|
|
51
|
+
return "$rc"
|
|
50
52
|
}
|
|
51
53
|
|
|
52
54
|
update_games() {
|
|
@@ -65,6 +67,7 @@ update_games() {
|
|
|
65
67
|
else
|
|
66
68
|
log_warn "$rc game(s) failed to update"
|
|
67
69
|
fi
|
|
70
|
+
return "$rc"
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
reinstall_games() {
|
|
@@ -85,4 +88,5 @@ reinstall_games() {
|
|
|
85
88
|
fi
|
|
86
89
|
separator
|
|
87
90
|
echo
|
|
91
|
+
return "$rc"
|
|
88
92
|
}
|