karnel-termux 4.17.42 → 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.
Files changed (85) hide show
  1. package/README.md +7 -2
  2. package/docs/CHANGELOG.md +99 -0
  3. package/docs/troubleshooting/index.md +7 -7
  4. package/karnel/RELEASE_COMMIT +1 -1
  5. package/karnel/bin/karnel +1 -1
  6. package/karnel/cli/commands/agent.sh +1 -1
  7. package/karnel/cli/commands/brain.sh +3 -3
  8. package/karnel/cli/commands/cleanup.sh +2 -1
  9. package/karnel/cli/commands/doctor/code_langs.sh +1 -1
  10. package/karnel/cli/commands/doctor/fixes.sh +9 -22
  11. package/karnel/cli/commands/doctor.sh +18 -10
  12. package/karnel/cli/commands/env.sh +2 -2
  13. package/karnel/cli/commands/ia.sh +1 -7
  14. package/karnel/cli/commands/init.sh +1 -1
  15. package/karnel/cli/commands/install.sh +13 -3
  16. package/karnel/cli/commands/list.sh +15 -10
  17. package/karnel/cli/commands/open.sh +50 -15
  18. package/karnel/cli/commands/pg.sh +2 -2
  19. package/karnel/cli/commands/reinstall.sh +3 -3
  20. package/karnel/cli/commands/restore.sh +1 -1
  21. package/karnel/cli/commands/search.sh +47 -14
  22. package/karnel/cli/commands/stats.sh +163 -0
  23. package/karnel/cli/commands/uninstall.sh +7 -0
  24. package/karnel/cli/karnel.sh +95 -131
  25. package/karnel/modules/ui.sh +0 -5
  26. package/karnel/tools/ai/ampcode/install.sh +3 -8
  27. package/karnel/tools/ai/antigravity-cli/install.sh +17 -202
  28. package/karnel/tools/ai/cactus-needle/install.sh +15 -15
  29. package/karnel/tools/ai/claude-code/install.sh +0 -1
  30. package/karnel/tools/ai/codebuff/install.sh +3 -17
  31. package/karnel/tools/ai/freebuff/install.sh +1 -1
  32. package/karnel/tools/ai/keelcode/install.sh +2 -2
  33. package/karnel/tools/ai/mimocode/install.sh +3 -14
  34. package/karnel/tools/ai/omni-route/README.md +0 -2
  35. package/karnel/tools/ai/opencode/install.sh +0 -1
  36. package/karnel/tools/ai/supercode-cli/install.sh +2 -2
  37. package/karnel/tools/dev/tmate/README.md +1 -1
  38. package/karnel/tools/network/dark/install.sh +2 -1
  39. package/karnel/tools/network/dedsec-network/install.sh +2 -1
  40. package/karnel/tools/npm/turbopack/README.md +36 -4
  41. package/karnel/tools/npm/turbopack/bin/next-turbopack +1 -1
  42. package/karnel/tools/npm/turbopack/bin/node-glibc.sh +1 -1
  43. package/karnel/tools/plugins/install.sh +1 -1
  44. package/karnel/tools/security/aircrack-ng/install.sh +19 -8
  45. package/karnel/tools/security/binwalk/install.sh +16 -6
  46. package/karnel/tools/security/dirb/install.sh +16 -6
  47. package/karnel/tools/security/exiftool/install.sh +16 -6
  48. package/karnel/tools/security/foremost/install.sh +16 -6
  49. package/karnel/tools/security/hashcat/install.sh +16 -6
  50. package/karnel/tools/security/hydra/install.sh +16 -6
  51. package/karnel/tools/security/john/install.sh +16 -6
  52. package/karnel/tools/security/netcat/install.sh +19 -8
  53. package/karnel/tools/security/nmap/install.sh +16 -6
  54. package/karnel/tools/security/smbclient/install.sh +16 -6
  55. package/karnel/tools/security/steghide/install.sh +16 -6
  56. package/karnel/tools/security/tcpdump/install.sh +16 -6
  57. package/karnel/tools/security/template.sh +39 -18
  58. package/karnel/tools/security/whois/install.sh +16 -6
  59. package/karnel/tools/ui/banner/install.sh +9 -0
  60. package/karnel/tools/utils/qrcode/install.sh +2 -1
  61. package/karnel/tools/utils/zork/install.sh +18 -7
  62. package/karnel/tools/utils/zork/zork.sh +1 -1
  63. package/karnel/utils/agent_actions.sh +9 -5
  64. package/karnel/utils/banner.sh +128 -35
  65. package/karnel/utils/env.sh +5 -3
  66. package/karnel/utils/log.sh +15 -5
  67. package/karnel/utils/tools.sh +131 -13
  68. package/package.json +2 -1
  69. package/scripts/check-package.js +71 -1
  70. package/scripts/completion.bash +1 -1
  71. package/scripts/completion.zsh +1 -0
  72. package/scripts/publish.js +49 -0
  73. package/karnel/tools/ai/ampcode/bin/amp.proot +0 -22
  74. package/karnel/tools/ai/antigravity-cli/bin/agy.proot +0 -22
  75. package/karnel/tools/ai/claude-code/bin/claude.proot +0 -22
  76. package/karnel/tools/ai/cline/bin/cline.proot +0 -28
  77. package/karnel/tools/ai/cline/helper/cline_helper.c +0 -54
  78. package/karnel/tools/ai/cursor-cli/bin/cursor.proot +0 -33
  79. package/karnel/tools/ai/gga/termux.patch +0 -70
  80. package/karnel/tools/ai/keelcode/bin/keelcode.proot +0 -23
  81. package/karnel/tools/ai/kilocode-cli/bin/kilocode.proot +0 -22
  82. package/karnel/tools/ai/mimocode/bin/mimo.proot +0 -22
  83. package/karnel/tools/ai/oh-my-pi/bin/omp.proot +0 -22
  84. package/karnel/tools/ai/opencode/bin/opencode.proot +0 -22
  85. 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.42-0078D4?style=for-the-badge" alt="Version">
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.42
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"
@@ -142,6 +142,7 @@ aliases, or options; use `karnel help` and the CLI reference for the full set.
142
142
  | `karnel upgrade` | Upgrade the framework (self-update) |
143
143
  | `karnel ia` | Manage AI agent sessions, install tools, show launchers |
144
144
  | `karnel search <query>` | Search tools and Brain memories |
145
+ | `karnel stats` | System overview: versions, modules, disk usage, tool counts |
145
146
  | `karnel status` | System health dashboard (disk, RAM, services, connectivity) |
146
147
  | `karnel start editor [port]` | Start code-server (VS Code in browser) |
147
148
  | `karnel start robin` | Start Robin OSINT (Tor + web UI) |
@@ -157,6 +158,10 @@ aliases, or options; use `karnel help` and the CLI reference for the full set.
157
158
  | `karnel deploy` | Run Vercel, Railway, Netlify, or Supabase CLI commands |
158
159
  | `karnel supabase` | Manage the Supabase CLI and remote-project helpers |
159
160
  | `karnel robin` | Manage the Robin OSINT service |
161
+ | `karnel backup` | Backup Termux configs and package metadata |
162
+ | `karnel restore` | Restore Termux from a backup |
163
+ | `karnel cleanup` | Clean caches, logs, and temp files |
164
+ | `karnel plugin` | Plugin manager — search, install, enable, disable, config |
160
165
  | `karnel --version` | Show installed version |
161
166
 
162
167
  ### Modules
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 mirror is a Jekyll (cayman theme) site built from the `docs/`
57
- directory and published to GitHub Pages by the `Publish Docs` workflow
58
- (`.github/workflows/docs.yml`) on every push to `main` that changes `docs/**`.
59
- The workflow runs `actions/jekyll-build-pages` (from `docs/`, output to
60
- `docs/_site`), uploads the result as a Pages artifact, and deploys it to the
61
- `github-pages` environment. The mirror is
62
- `https://israelmarques1024-dotcom.github.io/karnel-termux/`.
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
@@ -1 +1 @@
1
- 14253a4bd8af3c1c2ae600f7bf4663e959a5d9ac
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
@@ -115,7 +115,7 @@ agent_main() {
115
115
  log_error "Unknown subcommand: ${D_CYAN}$cmd${D_NC}"
116
116
  echo
117
117
  agent_help
118
- exit 1
118
+ return 1
119
119
  ;;
120
120
  esac
121
121
  }
@@ -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
- rm -f "$KARNEL_CACHE/banner_cache" 2>/dev/null
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\" --no-missiglob|npx --no-install markdownlint-cli2 --fix \"**/*.md\"|safe|native"
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 "$dir" && chmod 755 "$dir" 2>/dev/null || { rc=1; log_warn "Failed to create $dir"; }
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
- local shell_config=""
124
- if [[ -f "$HOME/.zshrc" ]]; then
125
- shell_config="$HOME/.zshrc"
126
- elif [[ -f "$HOME/.bashrc" ]]; then
127
- shell_config="$HOME/.bashrc"
128
- fi
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 755 \"$dir\"")
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
- if [[ -f "$HOME/.zshrc" ]]; then
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; then
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"
@@ -30,13 +30,7 @@ ia_help() {
30
30
 
31
31
  # List all AI sessions from known tools
32
32
  ia_sessions() {
33
- # $1 was historically `--all`; agent names are always shown now, so the
34
- # flag is accepted for back-compat and ignored.
35
- local show_all="${1:-0}"
36
- if [[ "$show_all" == "--all" ]]; then
37
- show_all=0
38
- fi
39
-
33
+ # $1 was historically `--all`; agent names are always shown now.
40
34
  mkdir -p "$IA_SESSIONS_DIR"
41
35
 
42
36
  local -a sessions=()
@@ -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
- import "@/tools/deploy/supabase/install"
291
- install_supabase
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
- printf " ${D_GREEN}%-18s${NC} %s\n" "vercel" "Frontend & serverless deployment"
109
- printf " ${D_GREEN}%-18s${NC} %s\n" "railway" "Full-stack with databases"
110
- printf " ${D_GREEN}%-18s${NC} %s\n" "netlify" "Static sites & edge functions"
111
- printf " ${D_GREEN}%-18s${NC} %s\n" "supabase" "PostgreSQL, Edge Functions, types, migrations"
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 "MiMoCode" "--mimocode" "mimo" "$(_check_cmd "mimo")"
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 "terminal-cursor-blink-rate=500" "$HOME/.termux/termux.properties" 2>/dev/null; then
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
- printf " ${D_GREEN}%-18s${NC} %s\n" "voice" "Speech-to-agent AI command"
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
- if [[ -f "$KARNEL_PATH/modules/$target.sh" ]]; then
39
- url="$OPEN_DOCS/karnel/$target"
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 "$target" "reinstall" "${tools[@]}" || return 1
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: $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; }