karnel-termux 4.17.43 → 4.17.44
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 +2 -2
- package/docs/CHANGELOG.md +99 -0
- package/docs/troubleshooting/index.md +7 -7
- package/karnel/RELEASE_COMMIT +1 -1
- package/karnel/bin/karnel +1 -1
- package/karnel/cli/commands/agent.sh +1 -1
- package/karnel/cli/commands/brain.sh +3 -3
- package/karnel/cli/commands/cleanup.sh +2 -1
- package/karnel/cli/commands/doctor/code_langs.sh +1 -1
- package/karnel/cli/commands/doctor/fixes.sh +9 -22
- package/karnel/cli/commands/doctor.sh +18 -10
- package/karnel/cli/commands/env.sh +2 -2
- package/karnel/cli/commands/init.sh +1 -1
- package/karnel/cli/commands/install.sh +13 -3
- package/karnel/cli/commands/list.sh +15 -10
- package/karnel/cli/commands/open.sh +50 -15
- package/karnel/cli/commands/pg.sh +2 -2
- package/karnel/cli/commands/reinstall.sh +3 -3
- package/karnel/cli/commands/restore.sh +1 -1
- package/karnel/cli/commands/search.sh +47 -14
- package/karnel/cli/commands/stats.sh +70 -10
- package/karnel/cli/commands/uninstall.sh +7 -0
- package/karnel/cli/karnel.sh +94 -131
- package/karnel/tools/ai/ampcode/install.sh +3 -8
- package/karnel/tools/ai/antigravity-cli/install.sh +17 -202
- package/karnel/tools/ai/cactus-needle/install.sh +15 -15
- package/karnel/tools/ai/claude-code/install.sh +0 -1
- package/karnel/tools/ai/codebuff/install.sh +3 -17
- package/karnel/tools/ai/freebuff/install.sh +1 -1
- package/karnel/tools/ai/keelcode/install.sh +2 -2
- package/karnel/tools/ai/mimocode/install.sh +3 -14
- package/karnel/tools/ai/omni-route/README.md +0 -2
- package/karnel/tools/ai/opencode/install.sh +0 -1
- package/karnel/tools/ai/supercode-cli/install.sh +2 -2
- package/karnel/tools/dev/tmate/README.md +1 -1
- package/karnel/tools/network/dark/install.sh +2 -1
- package/karnel/tools/network/dedsec-network/install.sh +2 -1
- package/karnel/tools/npm/turbopack/README.md +36 -4
- package/karnel/tools/npm/turbopack/bin/next-turbopack +1 -1
- package/karnel/tools/npm/turbopack/bin/node-glibc.sh +1 -1
- package/karnel/tools/plugins/install.sh +1 -1
- package/karnel/tools/security/aircrack-ng/install.sh +19 -8
- package/karnel/tools/security/binwalk/install.sh +16 -6
- package/karnel/tools/security/dirb/install.sh +16 -6
- package/karnel/tools/security/exiftool/install.sh +16 -6
- package/karnel/tools/security/foremost/install.sh +16 -6
- package/karnel/tools/security/hashcat/install.sh +16 -6
- package/karnel/tools/security/hydra/install.sh +16 -6
- package/karnel/tools/security/john/install.sh +16 -6
- package/karnel/tools/security/netcat/install.sh +19 -8
- package/karnel/tools/security/nmap/install.sh +16 -6
- package/karnel/tools/security/smbclient/install.sh +16 -6
- package/karnel/tools/security/steghide/install.sh +16 -6
- package/karnel/tools/security/tcpdump/install.sh +16 -6
- package/karnel/tools/security/template.sh +39 -18
- package/karnel/tools/security/whois/install.sh +16 -6
- package/karnel/tools/ui/banner/install.sh +9 -0
- package/karnel/tools/utils/qrcode/install.sh +2 -1
- package/karnel/tools/utils/zork/install.sh +18 -7
- package/karnel/tools/utils/zork/zork.sh +1 -1
- package/karnel/utils/agent_actions.sh +9 -5
- package/karnel/utils/banner.sh +128 -35
- package/karnel/utils/env.sh +5 -3
- package/karnel/utils/log.sh +15 -5
- package/karnel/utils/tools.sh +131 -13
- package/package.json +2 -1
- package/scripts/check-package.js +71 -1
- package/scripts/publish.js +49 -0
- package/karnel/tools/ai/ampcode/bin/amp.proot +0 -22
- package/karnel/tools/ai/antigravity-cli/bin/agy.proot +0 -22
- package/karnel/tools/ai/claude-code/bin/claude.proot +0 -22
- package/karnel/tools/ai/cline/bin/cline.proot +0 -28
- package/karnel/tools/ai/cline/helper/cline_helper.c +0 -54
- package/karnel/tools/ai/cursor-cli/bin/cursor.proot +0 -33
- package/karnel/tools/ai/gga/termux.patch +0 -70
- package/karnel/tools/ai/keelcode/bin/keelcode.proot +0 -23
- package/karnel/tools/ai/kilocode-cli/bin/kilocode.proot +0 -22
- package/karnel/tools/ai/mimocode/bin/mimo.proot +0 -22
- package/karnel/tools/ai/oh-my-pi/bin/omp.proot +0 -22
- package/karnel/tools/ai/opencode/bin/opencode.proot +0 -22
- package/karnel/tools/ai/qoder/bin/qodercli.proot +0 -22
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.17.
|
|
11
|
+
<img src="https://img.shields.io/badge/version-4.17.44-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">
|
|
@@ -78,7 +78,7 @@ Why it's great:
|
|
|
78
78
|
### Via checksummed GitHub release (recommended)
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
version=4.17.
|
|
81
|
+
version=4.17.44
|
|
82
82
|
tmpdir=$(mktemp -d) && trap 'rm -rf "$tmpdir"' EXIT
|
|
83
83
|
base="https://github.com/israelmarques1024-dotcom/karnel-termux/releases/download/v$version"
|
|
84
84
|
curl -fsSL "$base/karnel-termux-install.sh" -o "$tmpdir/karnel-termux-install.sh"
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,105 @@ layout: base
|
|
|
6
6
|
|
|
7
7
|
# Documentation Changelog
|
|
8
8
|
|
|
9
|
+
## 4.17.44
|
|
10
|
+
|
|
11
|
+
- **CLI correctness:** `karnel search` builds its catalog from tool READMEs in one pass instead of per-directory subshells; `karnel stats` counts modules that actually carry install markers and prints `not installed` instead of empty probes; `karnel open` gained routes for `doctor`, `brain`, `pg`, `init`, `env`, `backup`, `show`, `cleanup`, `supabase`, `linux`, `plugin`, `voice`, `security`, `osint`, `termux`, `termux-api` and `terms`.
|
|
12
|
+
- **Confirmation safety:** `--auto` now takes the safe answer on destructive prompts instead of answering `y`, and the agent declines to run code unless `-y`/`AGENT_YES` says so explicitly; doctor's dangerous fixes require `-t 0` and a non-auto run.
|
|
13
|
+
- **Installer method selection:** menus only list methods that can succeed — AMP Code, Codebuff, MiMo Code and Antigravity CLI no longer offer a proot entry that always failed, and Antigravity's proot install/update refuse before provisioning or mutating a container.
|
|
14
|
+
- **Installer fixes:** Freebuff repairs the npm shebang after a successful install instead of inside the failure branch; Claude Code and OpenCode no longer call a host-only shebang helper inside the Ubuntu container; the doctor markdownlint entry no longer passes a nonexistent `--no-missiglob` flag.
|
|
15
|
+
- **Ownership and stats:** central ownership covers 96 of 166 tools (was 61), modules write install markers on success, and security installers keep their per-package ownership intact.
|
|
16
|
+
- **Packaging:** `pack:check` normalizes modes from the git index on a real filesystem (shared storage masks every mode to 0660), asserts the CLI entry point ships executable, and `npm run release` publishes the validated tarball.
|
|
17
|
+
- **Links and data safety:** Zork downloads over HTTP with pinned SHA-256 digests because the host's TLS does not validate; dead `karnelroute.online` references were dropped and GitHub Pages links now name the Vercel production site as canonical.
|
|
18
|
+
- **Banner portability:** `banner.sh` keys its colour, figlet and tip tables as associative arrays so bash and zsh draw the same picture (zsh was losing the left border and shifting the gradient), resolves `KARNEL_VERSION` from `package.json` instead of always showing `v4.x`, draws the text logo as valid UTF-8 at the exact terminal width, caches per width for the `clear()` override, bounds the tip picker and restores the caller's traps.
|
|
19
|
+
- **List coverage:** every group exposes the same `Install Flag`/`Status` columns, `karnel list plugins` is accepted, the TUI counts installers at runtime instead of advertising a stale `AI Tools (43)`, and dialog menus/checklists show the whole list (they used to render half and a third of it, which hid lower entries such as Walkie).
|
|
20
|
+
- **Installer exit codes:** KeelCode and Supercode CLI now capture npm's exit status instead of a `rc` that was always zero, and repair the shebang only after a successful install.
|
|
21
|
+
- **Regression tests:** `tests/list-coverage.sh` proves all 17 targets list all 166 installers, `tests/banner.sh` renders in bash and zsh at the exact width as valid UTF-8, and the site catalog is checked against the CLI registries.
|
|
22
|
+
- **Housekeeping:** removed 11 unreferenced `.proot` wrapper templates, `gga/termux.patch`, `cline/helper/cline_helper.c` and `assets/banner/banner.txt`; restored 16 files deleted from the site worktree; `lint:shell` no longer depends on how the suite was invoked.
|
|
23
|
+
|
|
24
|
+
## 4.17.43
|
|
25
|
+
|
|
26
|
+
- Added `stats` to the bash and zsh completion catalogs.
|
|
27
|
+
|
|
28
|
+
## 4.17.42
|
|
29
|
+
|
|
30
|
+
- **Audit fixes:** `$module` vs `$target` in `reinstall` for full security/deploy reinstalls; games routed through the module layer for consistent headers and error handling; security module gained separator/box/log feedback; `ia.sh` hardcoded paths now respect `KARNEL_DATA`; the default `LOG_FILE` moved off `install_ai.log`; `upgrade` captures the cleanup exit code.
|
|
31
|
+
|
|
32
|
+
## 4.17.41
|
|
33
|
+
|
|
34
|
+
- Version references bumped to `4.17.41`.
|
|
35
|
+
|
|
36
|
+
## 4.17.40
|
|
37
|
+
|
|
38
|
+
- **Deduplication:** extracted `pkg-tool.sh` (14 security tools) and a `module-lifecycle.sh` factory (4 modules), converting deploy, games, network, utils and 14 pkg-only security installers to them — roughly 700 lines of duplicated boilerplate removed.
|
|
39
|
+
|
|
40
|
+
## 4.17.39
|
|
41
|
+
|
|
42
|
+
- **Plugins:** `karnel plugin enable|disable <name>` and `karnel plugin config <name> [key] [value]`; metadata tracks enabled state (default `true`) and a config object; disabled plugins are skipped by command collection and tagged in listings.
|
|
43
|
+
|
|
44
|
+
## 4.17.38
|
|
45
|
+
|
|
46
|
+
- **Installer consistency:** 129 `reinstall_*` functions now check the uninstall return code; 13 AI tools gained the Termux shebang repair they were missing.
|
|
47
|
+
|
|
48
|
+
## 4.17.37
|
|
49
|
+
|
|
50
|
+
- **Installer bugs:** nine utils tools logged to `install_dev.log` instead of `install_utils.log`; 14 security pkg uninstallers silently ignored failures; the opencode uninstall `sed` pattern mangled unrelated `.bashrc` lines.
|
|
51
|
+
|
|
52
|
+
## 4.17.36
|
|
53
|
+
|
|
54
|
+
- **Managed lifecycle:** netlify, vercel, masscan and metasploit installers preserve managed files, and `utils/env.sh` hardened the environment they run in.
|
|
55
|
+
|
|
56
|
+
## 4.17.35
|
|
57
|
+
|
|
58
|
+
- **Ownership hardening:** `update.sh` and the amass, burpsuite, ffuf, gobuster and subfinder installers refuse to touch installs Karnel does not own.
|
|
59
|
+
|
|
60
|
+
## 4.17.34
|
|
61
|
+
|
|
62
|
+
- **Auto mode:** added non-interactive `--auto` (`read_confirm` gained an auto answer, `agent_actions` participates) with matching completion entries and tests.
|
|
63
|
+
|
|
64
|
+
## 4.17.33
|
|
65
|
+
|
|
66
|
+
- **Supply chain:** hardened release downloads across installers.
|
|
67
|
+
|
|
68
|
+
## 4.17.32
|
|
69
|
+
|
|
70
|
+
- **Supply chain:** GitHub release asset digests are verified before install.
|
|
71
|
+
|
|
72
|
+
## 4.17.31
|
|
73
|
+
|
|
74
|
+
- **Docs:** README synchronized with the current AI catalog.
|
|
75
|
+
|
|
76
|
+
## 4.17.30
|
|
77
|
+
|
|
78
|
+
- **10Router:** repaired Termux shebangs on already-installed 10Router CLIs.
|
|
79
|
+
|
|
80
|
+
## 4.17.29
|
|
81
|
+
|
|
82
|
+
- **10Router:** added the 10Router AI server CLI to the AI catalog, registry and completions.
|
|
83
|
+
|
|
84
|
+
## 4.17.28
|
|
85
|
+
|
|
86
|
+
- **QR Code:** resolved launcher symlinks.
|
|
87
|
+
|
|
88
|
+
## 4.17.27
|
|
89
|
+
|
|
90
|
+
- **QR Code:** isolated dependency tests.
|
|
91
|
+
|
|
92
|
+
## 4.17.26
|
|
93
|
+
|
|
94
|
+
- **QR Code:** stabilized release validation.
|
|
95
|
+
|
|
96
|
+
## 4.17.25
|
|
97
|
+
|
|
98
|
+
- **QR Code:** covered installer dependencies in tests.
|
|
99
|
+
|
|
100
|
+
## 4.17.24
|
|
101
|
+
|
|
102
|
+
- **QR Code:** made QR code installation Termux-safe.
|
|
103
|
+
|
|
104
|
+
## 4.17.23
|
|
105
|
+
|
|
106
|
+
- **Tool installation:** repaired the Termux tool installation runtime across doctor, AI installers and the npm module.
|
|
107
|
+
|
|
9
108
|
## 4.17.22
|
|
10
109
|
|
|
11
110
|
- **Data safety and correctness (8):** restore rejects ambiguous multiple archives; Brain preserves same-day title collisions, uses file paths for AI context, initializes/pushes `main`, detects missing `origin`, and supports editors with arguments; PostgreSQL backup filenames are path-safe; AI-session persistence escapes JSON correctly.
|
|
@@ -53,13 +53,13 @@ exists and the token used by GitHub Actions has write access.
|
|
|
53
53
|
|
|
54
54
|
## Documentation mirror (GitHub Pages)
|
|
55
55
|
|
|
56
|
-
The documentation
|
|
57
|
-
|
|
58
|
-
(`.github/workflows/docs.yml`)
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
`github-
|
|
62
|
-
|
|
56
|
+
The documentation source is the `docs/` directory, and the published site is
|
|
57
|
+
the Vercel production site, `https://karneltermux.vercel.app`. The `Publish Docs`
|
|
58
|
+
workflow (`.github/workflows/docs.yml`) runs `actions/jekyll-build-pages` on
|
|
59
|
+
every push to `main` that changes `docs/**`, uploads the result as a Pages
|
|
60
|
+
artifact and deploys it to the `github-pages` environment; that mirror,
|
|
61
|
+
`https://israelmarques1024-dotcom.github.io/karnel-termux/`, is served only
|
|
62
|
+
while GitHub Pages is enabled for the repository.
|
|
63
63
|
|
|
64
64
|
If a build fails, open the Actions run for the failing job and read the Jekyll
|
|
65
65
|
output: the usual causes are invalid `_config.yml` YAML, an SCSS compile error
|
package/karnel/RELEASE_COMMIT
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
993646aa095b290adc04835c38c98a56ff05c212
|
package/karnel/bin/karnel
CHANGED
|
@@ -36,7 +36,7 @@ set -- "${_karnel_args[@]}"
|
|
|
36
36
|
|
|
37
37
|
# Informational flags must not initialize user state or trigger update checks.
|
|
38
38
|
case "${1:-}" in
|
|
39
|
-
--help|-h|--version|help|version|list|show) KARNEL_READ_ONLY=1 ;;
|
|
39
|
+
--help|-h|--version|help|version|list|show|search|stats|status) KARNEL_READ_ONLY=1 ;;
|
|
40
40
|
esac
|
|
41
41
|
|
|
42
42
|
# cargar entorno
|
|
@@ -1122,7 +1122,7 @@ brain_skill() {
|
|
|
1122
1122
|
local skill_dir="$base_dir/$skill_name"
|
|
1123
1123
|
if [[ -d "$skill_dir" ]]; then
|
|
1124
1124
|
log_warn "Skill already exists: $skill_dir"
|
|
1125
|
-
read_confirm "Overwrite?" confirm
|
|
1125
|
+
read_confirm "Overwrite?" confirm n
|
|
1126
1126
|
[[ "$confirm" != "y" ]] && return 0
|
|
1127
1127
|
rm -rf "$skill_dir"
|
|
1128
1128
|
fi
|
|
@@ -1294,7 +1294,7 @@ brain_delete() {
|
|
|
1294
1294
|
title=$(_brain_title "$file")
|
|
1295
1295
|
echo
|
|
1296
1296
|
log_warn "Delete memory: ${D_CYAN}$title${D_NC}?"
|
|
1297
|
-
read_confirm "This cannot be undone" confirm
|
|
1297
|
+
read_confirm "This cannot be undone" confirm n
|
|
1298
1298
|
if [[ "$confirm" != "y" ]]; then
|
|
1299
1299
|
log_info "Cancelled"
|
|
1300
1300
|
return 0
|
|
@@ -1344,7 +1344,7 @@ brain_reset() {
|
|
|
1344
1344
|
list_item "Location: ${D_CYAN}$BRAIN_DIR${D_NC}"
|
|
1345
1345
|
echo
|
|
1346
1346
|
|
|
1347
|
-
read_confirm "Are you sure?" confirm
|
|
1347
|
+
read_confirm "Are you sure?" confirm n
|
|
1348
1348
|
if [[ "$confirm" != "y" ]]; then
|
|
1349
1349
|
log_info "Cancelled"
|
|
1350
1350
|
separator
|
|
@@ -63,7 +63,8 @@ cleanup_main() {
|
|
|
63
63
|
fi
|
|
64
64
|
|
|
65
65
|
# karnel banner cache (regenerate)
|
|
66
|
-
|
|
66
|
+
# The cache is keyed by terminal width (banner_cache.<cols>).
|
|
67
|
+
rm -f "$KARNEL_CACHE"/banner_cache* 2>/dev/null
|
|
67
68
|
rm -f "$KARNEL_CACHE/.last_tip_index" 2>/dev/null
|
|
68
69
|
|
|
69
70
|
echo
|
|
@@ -13,7 +13,7 @@ _init_lang_tools() {
|
|
|
13
13
|
LANG_TOOLS["JavaScript:npm_audit"]="npm audit|deps|npm audit --audit-level=high|||native"
|
|
14
14
|
LANG_TOOLS["JavaScript:vitest"]="vitest|test|npx --no-install vitest run|||native"
|
|
15
15
|
LANG_TOOLS["JavaScript:jest"]="jest|test|npx --no-install jest|||native"
|
|
16
|
-
LANG_TOOLS["JavaScript:markdownlint"]="markdownlint-cli2|docs|npx --no-install markdownlint-cli2 \"**/*.md\"
|
|
16
|
+
LANG_TOOLS["JavaScript:markdownlint"]="markdownlint-cli2|docs|npx --no-install markdownlint-cli2 \"**/*.md\"|npx --no-install markdownlint-cli2 --fix \"**/*.md\"|safe|native"
|
|
17
17
|
|
|
18
18
|
# TypeScript
|
|
19
19
|
LANG_TOOLS["TypeScript:tsc"]="tsc|type-check|npx --no-install tsc --noEmit|||native"
|
|
@@ -13,7 +13,9 @@ _fix_storage() {
|
|
|
13
13
|
_fix_mkdir() {
|
|
14
14
|
local rc=0
|
|
15
15
|
for dir in "$KARNEL_CONFIG" "$KARNEL_CACHE" "$KARNEL_DATA"; do
|
|
16
|
-
mkdir -p
|
|
16
|
+
mkdir -p -m 700 "$dir" 2>/dev/null &&
|
|
17
|
+
{ [[ -d "$dir" && ! -L "$dir" ]] && chmod 700 "$dir"; } ||
|
|
18
|
+
{ rc=1; log_warn "Failed to create $dir"; }
|
|
17
19
|
done
|
|
18
20
|
return $rc
|
|
19
21
|
}
|
|
@@ -120,27 +122,12 @@ _fix_symlinks() {
|
|
|
120
122
|
}
|
|
121
123
|
|
|
122
124
|
_fix_banner() {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
if [[ -z "$shell_config" ]]; then
|
|
130
|
-
shell_config="$HOME/.zshrc"
|
|
131
|
-
touch "$shell_config"
|
|
132
|
-
fi
|
|
133
|
-
local marker="# ===== Karnel Banner ====="
|
|
134
|
-
if ! grep -qF "$marker" "$shell_config" 2>/dev/null; then
|
|
135
|
-
cat >>"$shell_config" <<EOF
|
|
136
|
-
|
|
137
|
-
$marker
|
|
138
|
-
source "$KARNEL_UTILS/banner.sh"
|
|
139
|
-
render_banner
|
|
140
|
-
EOF
|
|
141
|
-
return 0
|
|
142
|
-
fi
|
|
143
|
-
return 0
|
|
125
|
+
# Always go through the canonical installer: it writes the full block with
|
|
126
|
+
# start *and* end markers (plus the zsh precmd hook), which is what the
|
|
127
|
+
# uninstall path expects. Hand-rolled blocks used to leave `render_banner`
|
|
128
|
+
# orphaned in .zshrc after an uninstall.
|
|
129
|
+
import "@/tools/ui/banner/install"
|
|
130
|
+
install_banner
|
|
144
131
|
}
|
|
145
132
|
|
|
146
133
|
_fix_ai_install() {
|
|
@@ -178,7 +178,7 @@ doctor_termux() {
|
|
|
178
178
|
else
|
|
179
179
|
log_warn "Directory missing or read-only: $(basename "$dir")"
|
|
180
180
|
((warnings++))
|
|
181
|
-
fix_commands+=("mkdir -p \"$dir\" && chmod
|
|
181
|
+
fix_commands+=("mkdir -p -m 700 \"$dir\" && chmod 700 \"$dir\"")
|
|
182
182
|
fix_descriptions+=("Recreate directory: $(basename "$dir")")
|
|
183
183
|
fix_callbacks+=("_fix_mkdir")
|
|
184
184
|
fi
|
|
@@ -569,16 +569,24 @@ doctor_termux() {
|
|
|
569
569
|
fix_callbacks+=("_fix_symlinks")
|
|
570
570
|
fi
|
|
571
571
|
|
|
572
|
-
# Check if banner is installed in shell config
|
|
572
|
+
# Check if banner is installed in shell config. Reuse the installer's own
|
|
573
|
+
# detection so doctor and `karnel install ui --banner` can never disagree on
|
|
574
|
+
# which rc file owns the banner.
|
|
575
|
+
import "@/tools/ui/banner/install"
|
|
573
576
|
local shell_config=""
|
|
574
|
-
|
|
575
|
-
shell_config="$HOME/.zshrc"
|
|
576
|
-
elif [[ -f "$HOME/.bashrc" ]]; then
|
|
577
|
-
shell_config="$HOME/.bashrc"
|
|
578
|
-
fi
|
|
577
|
+
shell_config="$(_detect_shell_config)"
|
|
579
578
|
|
|
580
579
|
if [[ -n "$shell_config" ]]; then
|
|
581
|
-
if grep -qF "# ===== Karnel Banner =====" "$shell_config" 2>/dev/null
|
|
580
|
+
if grep -qF "# ===== Karnel Banner =====" "$shell_config" 2>/dev/null &&
|
|
581
|
+
! grep -qF "# ===== /Karnel Banner =====" "$shell_config" 2>/dev/null; then
|
|
582
|
+
# Legacy block: no end marker, so uninstalling it leaves the
|
|
583
|
+
# `render_banner` call orphaned in the shell config.
|
|
584
|
+
log_warn "Partial Karnel banner block in $(basename "$shell_config")"
|
|
585
|
+
((warnings++))
|
|
586
|
+
fix_commands+=("karnel reinstall ui --banner")
|
|
587
|
+
fix_descriptions+=("Repair legacy Karnel banner block")
|
|
588
|
+
fix_callbacks+=("_fix_banner")
|
|
589
|
+
elif grep -qF "# ===== Karnel Banner =====" "$shell_config" 2>/dev/null; then
|
|
582
590
|
log_success "Banner installed in $(basename "$shell_config")"
|
|
583
591
|
else
|
|
584
592
|
log_warn "Banner not installed in $(basename "$shell_config")"
|
|
@@ -1434,8 +1442,8 @@ doctor_termux() {
|
|
|
1434
1442
|
# caches, reinstalling packages or deleting unrelated software.
|
|
1435
1443
|
if [[ -n "$callback" && -n "${DESTRUCTIVE_FIXES[$callback]:-}" ]]; then
|
|
1436
1444
|
if $FIX_MODE; then
|
|
1437
|
-
if [[ -t 0 ]]; then
|
|
1438
|
-
read_confirm "DANGEROUS: ${fix_descriptions[$i]}. Apply?" apply_this
|
|
1445
|
+
if [[ -t 0 && "${KARNEL_AUTO:-0}" != "1" ]]; then
|
|
1446
|
+
read_confirm "DANGEROUS: ${fix_descriptions[$i]}. Apply?" apply_this n
|
|
1439
1447
|
else
|
|
1440
1448
|
log_warn "Skipping destructive fix (non-interactive): ${fix_descriptions[$i]}"
|
|
1441
1449
|
continue
|
|
@@ -70,7 +70,7 @@ env_set() {
|
|
|
70
70
|
if grep -q "^export $escaped_key=" "$rc_file" 2>/dev/null; then
|
|
71
71
|
echo
|
|
72
72
|
log_warn "Variable $D_CYAN$key$D_YELLOW already exists in $(basename "$rc_file")"
|
|
73
|
-
read_confirm "Replace it?" confirm
|
|
73
|
+
read_confirm "Replace it?" confirm n
|
|
74
74
|
if [[ "$confirm" != "y" ]]; then
|
|
75
75
|
echo
|
|
76
76
|
log_warn "Operation cancelled"
|
|
@@ -155,7 +155,7 @@ env_unset() {
|
|
|
155
155
|
|
|
156
156
|
echo
|
|
157
157
|
log_warn "This will remove $D_CYAN$key$D_YELLOW from $(basename "$rc_file")"
|
|
158
|
-
read_confirm "Are you sure?" confirm
|
|
158
|
+
read_confirm "Are you sure?" confirm n
|
|
159
159
|
if [[ "$confirm" != "y" ]]; then
|
|
160
160
|
echo
|
|
161
161
|
log_warn "Operation cancelled"
|
|
@@ -1235,7 +1235,7 @@ EOF
|
|
|
1235
1235
|
|
|
1236
1236
|
_init_confirm_overwrite() {
|
|
1237
1237
|
local confirm
|
|
1238
|
-
read_confirm "Karnel may overwrite existing project files. Continue?" confirm
|
|
1238
|
+
read_confirm "Karnel may overwrite existing project files. Continue?" confirm n
|
|
1239
1239
|
if [[ "$confirm" != "y" ]]; then
|
|
1240
1240
|
log_warn "Cancelled"
|
|
1241
1241
|
return 1
|
|
@@ -172,6 +172,13 @@ _install_full_module() {
|
|
|
172
172
|
return 1
|
|
173
173
|
;;
|
|
174
174
|
esac
|
|
175
|
+
|
|
176
|
+
local rc=$?
|
|
177
|
+
if (( rc == 0 || rc == 2 )); then
|
|
178
|
+
karnel_mark_module_installed "$target"
|
|
179
|
+
return 0
|
|
180
|
+
fi
|
|
181
|
+
return "$rc"
|
|
175
182
|
}
|
|
176
183
|
|
|
177
184
|
# Install specific tools within a module
|
|
@@ -286,10 +293,13 @@ _install_specific_tools() {
|
|
|
286
293
|
security)
|
|
287
294
|
_batch_tool_action "security" "install" "${tools[@]}" || return 1
|
|
288
295
|
;;
|
|
296
|
+
plugin|voice)
|
|
297
|
+
_batch_tool_action "$module" "install" "${tools[@]}"
|
|
298
|
+
return $?
|
|
299
|
+
;;
|
|
289
300
|
supabase)
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
case $? in 0) log_success "Supabase CLI installed";; 2) log_info "Supabase CLI already installed";; *) log_error "Failed to install Supabase CLI"; return 1;; esac
|
|
301
|
+
_batch_tool_action "supabase" "install" "${tools[@]}"
|
|
302
|
+
return $?
|
|
293
303
|
;;
|
|
294
304
|
*)
|
|
295
305
|
log_warn "Unknown install target: $module"
|
|
@@ -79,7 +79,7 @@ list_main() {
|
|
|
79
79
|
utils)
|
|
80
80
|
_list_utils
|
|
81
81
|
;;
|
|
82
|
-
plugin)
|
|
82
|
+
plugin | plugins)
|
|
83
83
|
import "@/tools/plugins/install"
|
|
84
84
|
echo "Installed Plugins:"
|
|
85
85
|
_list_plugins
|
|
@@ -105,10 +105,12 @@ _list_deploy() {
|
|
|
105
105
|
echo
|
|
106
106
|
box "Deploy CLIs"
|
|
107
107
|
echo
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
108
|
+
table_start "Tool" "Install Flag" "Command" "Status"
|
|
109
|
+
table_row "Vercel CLI" "--vercel" "vercel" "$(_check_cmd "vercel")"
|
|
110
|
+
table_row "Railway CLI" "--railway" "railway" "$(_check_cmd "railway")"
|
|
111
|
+
table_row "Netlify CLI" "--netlify" "netlify" "$(_check_cmd "netlify")"
|
|
112
|
+
table_row "Supabase CLI" "--supabase" "supabase" "$(_check_cmd "supabase")"
|
|
113
|
+
table_end
|
|
112
114
|
echo
|
|
113
115
|
list_item "Usage: ${D_CYAN}karnel install deploy${NC} to install all"
|
|
114
116
|
list_item "Usage: ${D_CYAN}karnel install deploy --vercel${NC} for specific"
|
|
@@ -182,7 +184,7 @@ _list_ai() {
|
|
|
182
184
|
table_row "Ollama" "--ollama" "ollama" "$(_check_pkg "ollama")"
|
|
183
185
|
table_row "Codex CLI" "--codex" "codex" "$(_check_cmd "codex")"
|
|
184
186
|
table_row "OpenCode" "--opencode" "opencode" "$(_check_cmd "opencode")"
|
|
185
|
-
table_row "
|
|
187
|
+
table_row "MiMo Code" "--mimocode" "mimo" "$(_check_cmd "mimo")"
|
|
186
188
|
table_row "Engram" "--engram" "engram" "$(_check_cmd "engram")"
|
|
187
189
|
table_row "CodeGraph" "--codegraph" "codegraph" "$(_check_cmd "codegraph")"
|
|
188
190
|
table_row "Pi Coding Agent" "--pi" "pi" "$(_check_cmd "pi")"
|
|
@@ -203,7 +205,7 @@ _list_ai() {
|
|
|
203
205
|
table_row "Kimchi CLI" "--kimchi-code" "kimchi" "$(_check_cmd "kimchi")"
|
|
204
206
|
table_row "omniRoute" "--omni-route" "omni-route" "$(_check_omni_route)"
|
|
205
207
|
table_row "Context7 Docs" "--ctx7" "ctx7" "$(_check_cmd "ctx7")"
|
|
206
|
-
table_row "OpenSpec SDD" "--openspec" "openspec" "$(_check_cmd "openspec")"
|
|
208
|
+
table_row "OpenSpec SDD Framework" "--openspec" "openspec" "$(_check_cmd "openspec")"
|
|
207
209
|
table_row "Qoder" "--qoder" "qodercli" "$(_check_cmd "qodercli")"
|
|
208
210
|
table_row "AMP Code CLI" "--ampcode" "amp" "$(_check_cmd "amp")"
|
|
209
211
|
table_row "Cursor CLI" "--cursor-cli" "cursor,cursor-agent" "$(_check_cmd_any "cursor,cursor-agent")"
|
|
@@ -212,7 +214,7 @@ _list_ai() {
|
|
|
212
214
|
table_row "Factory Droid" "--droid" "droid" "$(_check_cmd "droid")"
|
|
213
215
|
table_row "Cactus" "--cactus" "cactus" "$(_check_cmd "cactus")"
|
|
214
216
|
table_row "Cactus Needle" "--cactus-needle" "needle" "$(_check_cmd "needle")"
|
|
215
|
-
table_row "Walkie" "--walkie" "walkie" "$(_check_cmd "walkie")"
|
|
217
|
+
table_row "Walkie Agent" "--walkie" "walkie" "$(_check_cmd "walkie")"
|
|
216
218
|
table_row "Hugging Face" "--hugging-face" "hf" "$(_check_cmd "hf")"
|
|
217
219
|
table_row "Copilot-Termux" "--copilot-termux" "copilot" "$(_check_cmd "copilot")"
|
|
218
220
|
table_row "Supercode CLI" "--supercode-cli" "supercode" "$(_check_cmd "supercode")"
|
|
@@ -552,7 +554,8 @@ _check_cursor() {
|
|
|
552
554
|
|
|
553
555
|
# Check if extra-keys are configured by karnel
|
|
554
556
|
_check_extra_keys() {
|
|
555
|
-
if grep -qF "
|
|
557
|
+
if grep -qF "# Karnel extra-keys begin" "$HOME/.termux/termux.properties" 2>/dev/null &&
|
|
558
|
+
grep -qF "extra-keys = " "$HOME/.termux/termux.properties" 2>/dev/null; then
|
|
556
559
|
echo -e "${D_GREEN}installed${NC}"
|
|
557
560
|
else
|
|
558
561
|
echo -e "${D_RED}not installed${NC}"
|
|
@@ -633,7 +636,9 @@ _list_voice() {
|
|
|
633
636
|
echo
|
|
634
637
|
box "Voice Command"
|
|
635
638
|
echo
|
|
636
|
-
|
|
639
|
+
table_start "Component" "Install Flag" "Status"
|
|
640
|
+
table_row "Voice Command" "voice" "built-in"
|
|
641
|
+
table_end
|
|
637
642
|
echo
|
|
638
643
|
list_item "Usage: ${D_CYAN}karnel install voice${NC}"
|
|
639
644
|
echo
|
|
@@ -5,6 +5,46 @@ import "@/utils/colors"
|
|
|
5
5
|
|
|
6
6
|
OPEN_DOCS="https://karneltermux.vercel.app"
|
|
7
7
|
|
|
8
|
+
# Resolves a documented target to its site URL, or prints nothing when the
|
|
9
|
+
# target has no page. Covers every route the site actually publishes plus the
|
|
10
|
+
# aliases users are most likely to type; anything else falls back to the
|
|
11
|
+
# module registry so new modules keep working without touching this file.
|
|
12
|
+
_open_url_for() {
|
|
13
|
+
local target="$1"
|
|
14
|
+
case "$target" in
|
|
15
|
+
# Aliases kept for backwards compatibility with older docs/README hints.
|
|
16
|
+
herdr) target="utils" ;;
|
|
17
|
+
robin) target="osint" ;;
|
|
18
|
+
esac
|
|
19
|
+
|
|
20
|
+
# Commands that are not modules but still have a documentation page.
|
|
21
|
+
case "$target" in
|
|
22
|
+
doctor | brain | pg | init | env | backup | show | cleanup | supabase | linux | plugin | voice | security | osint)
|
|
23
|
+
printf '%s/karnel/%s' "$OPEN_DOCS" "$target"
|
|
24
|
+
return 0
|
|
25
|
+
;;
|
|
26
|
+
termux)
|
|
27
|
+
printf '%s/termux' "$OPEN_DOCS"
|
|
28
|
+
return 0
|
|
29
|
+
;;
|
|
30
|
+
termux-api | api)
|
|
31
|
+
printf '%s/termux/api' "$OPEN_DOCS"
|
|
32
|
+
return 0
|
|
33
|
+
;;
|
|
34
|
+
terms)
|
|
35
|
+
printf '%s/terms' "$OPEN_DOCS"
|
|
36
|
+
return 0
|
|
37
|
+
;;
|
|
38
|
+
esac
|
|
39
|
+
|
|
40
|
+
# Modules are published one-to-one under /karnel/<module>.
|
|
41
|
+
if [[ -f "${KARNEL_PATH:-}/modules/$target.sh" ]]; then
|
|
42
|
+
printf '%s/karnel/%s' "$OPEN_DOCS" "$target"
|
|
43
|
+
return 0
|
|
44
|
+
fi
|
|
45
|
+
return 1
|
|
46
|
+
}
|
|
47
|
+
|
|
8
48
|
open_main() {
|
|
9
49
|
if [[ $# -eq 0 ]]; then
|
|
10
50
|
open_help
|
|
@@ -18,26 +58,13 @@ open_main() {
|
|
|
18
58
|
karnel | help)
|
|
19
59
|
url="$OPEN_DOCS/"
|
|
20
60
|
;;
|
|
21
|
-
herdr)
|
|
22
|
-
url="$OPEN_DOCS/karnel/utils"
|
|
23
|
-
;;
|
|
24
|
-
robin)
|
|
25
|
-
url="$OPEN_DOCS/karnel/osint"
|
|
26
|
-
;;
|
|
27
|
-
supabase)
|
|
28
|
-
url="$OPEN_DOCS/karnel/supabase"
|
|
29
|
-
;;
|
|
30
|
-
cleanup)
|
|
31
|
-
url="$OPEN_DOCS/karnel/cleanup"
|
|
32
|
-
;;
|
|
33
61
|
--help | -h)
|
|
34
62
|
open_help
|
|
35
63
|
return
|
|
36
64
|
;;
|
|
37
65
|
*)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
else
|
|
66
|
+
url="$(_open_url_for "$target")"
|
|
67
|
+
if [[ -z "$url" ]]; then
|
|
41
68
|
log_error "Unknown target: $target"
|
|
42
69
|
echo
|
|
43
70
|
open_help
|
|
@@ -102,6 +129,14 @@ open_help() {
|
|
|
102
129
|
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "plugin" "Plugin system"
|
|
103
130
|
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "security" "Security tools"
|
|
104
131
|
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "herdr" "Herdr terminal AI assistant"
|
|
132
|
+
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "doctor" "Diagnostics & auto-fix"
|
|
133
|
+
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "brain" "Second Brain memories"
|
|
134
|
+
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "pg" "PostgreSQL helpers"
|
|
135
|
+
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "backup" "Backup & restore"
|
|
136
|
+
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "init" "Project scaffolding"
|
|
137
|
+
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "env" "Environment variables"
|
|
138
|
+
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "termux" "Termux setup guide"
|
|
139
|
+
printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "linux" "Linux stack guide"
|
|
105
140
|
echo
|
|
106
141
|
separator_section "Website"
|
|
107
142
|
echo
|
|
@@ -325,7 +325,7 @@ pg_drop() {
|
|
|
325
325
|
|
|
326
326
|
log_warn "This will permanently delete database: $db_name"
|
|
327
327
|
|
|
328
|
-
read_confirm "Are you sure?" CONFIRM
|
|
328
|
+
read_confirm "Are you sure?" CONFIRM n
|
|
329
329
|
if [[ "$CONFIRM" != "y" ]]; then
|
|
330
330
|
log_warn "Operation cancelled"
|
|
331
331
|
return 0
|
|
@@ -629,7 +629,7 @@ pg_restore_db() {
|
|
|
629
629
|
|
|
630
630
|
local success=false
|
|
631
631
|
local pg_confirm
|
|
632
|
-
read_confirm "Restore will clean ($db_name) and replace all objects. Continue?" pg_confirm
|
|
632
|
+
read_confirm "Restore will clean ($db_name) and replace all objects. Continue?" pg_confirm n
|
|
633
633
|
if [[ "$pg_confirm" != "y" ]]; then
|
|
634
634
|
log_info "Restore cancelled"
|
|
635
635
|
return 0
|
|
@@ -682,11 +682,11 @@ _reinstall_specific_tools() {
|
|
|
682
682
|
utils)
|
|
683
683
|
_batch_tool_action "utils" "reinstall" "${tools[@]}" || return 1
|
|
684
684
|
;;
|
|
685
|
-
security|deploy)
|
|
686
|
-
_batch_tool_action "$
|
|
685
|
+
security|deploy|plugin|voice|supabase)
|
|
686
|
+
_batch_tool_action "$module" "reinstall" "${tools[@]}" || return 1
|
|
687
687
|
;;
|
|
688
688
|
*)
|
|
689
|
-
log_warn "Unknown reinstall target: $
|
|
689
|
+
log_warn "Unknown reinstall target: $module"
|
|
690
690
|
echo "Run 'karnel reinstall' to see available targets"
|
|
691
691
|
return 1
|
|
692
692
|
;;
|
|
@@ -135,7 +135,7 @@ restore_main() {
|
|
|
135
135
|
|
|
136
136
|
local confirm=""
|
|
137
137
|
echo
|
|
138
|
-
read_confirm "Proceed with restore?" confirm
|
|
138
|
+
read_confirm "Proceed with restore?" confirm n
|
|
139
139
|
[[ "$confirm" != "y" ]] && { rm -rf "$tmp"; log_info "Cancelled"; return 0; }
|
|
140
140
|
|
|
141
141
|
transaction=$(mktemp -d "$HOME/.karnel-restore.XXXXXX") || { rm -rf "$tmp"; return 1; }
|