karnel-termux 4.17.41 → 4.17.43

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 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.41-0078D4?style=for-the-badge" alt="Version">
11
+ <img src="https://img.shields.io/badge/version-4.17.43-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.41
81
+ version=4.17.43
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
@@ -1 +1 @@
1
- 4277f0390226e9a4b99f13cb14a6938bd071b29e
1
+ 3b64b17a6f9d7a93bcbfbcd7f0c86e858cd5195d
@@ -4,8 +4,8 @@ import "@/utils/log"
4
4
  import "@/utils/colors"
5
5
 
6
6
  # AI Manager (karnel ia) — router for all AI agents and sessions
7
- IA_SESSIONS_DIR="$HOME/.local/share/karnel-data/ia/sessions"
8
- IA_DATA_DIR="$HOME/.local/share/karnel-data/ia"
7
+ IA_SESSIONS_DIR="${KARNEL_DATA:-$HOME/.local/share/karnel-data}/ia/sessions"
8
+ IA_DATA_DIR="${KARNEL_DATA:-$HOME/.local/share/karnel-data}/ia"
9
9
 
10
10
  ia_help() {
11
11
  echo
@@ -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=()
@@ -131,8 +131,8 @@ _reinstall_full_module() {
131
131
  reinstall_auto
132
132
  ;;
133
133
  games)
134
- import "@/tools/games/all"
135
- reinstall_all_games
134
+ import "@/modules/games"
135
+ reinstall_games
136
136
  ;;
137
137
  deploy)
138
138
  import "@/modules/deploy"
@@ -683,10 +683,10 @@ _reinstall_specific_tools() {
683
683
  _batch_tool_action "utils" "reinstall" "${tools[@]}" || return 1
684
684
  ;;
685
685
  security|deploy)
686
- _batch_tool_action "$module" "reinstall" "${tools[@]}" || return 1
686
+ _batch_tool_action "$target" "reinstall" "${tools[@]}" || return 1
687
687
  ;;
688
688
  *)
689
- log_warn "Unknown reinstall target: $module"
689
+ log_warn "Unknown reinstall target: $target"
690
690
  echo "Run 'karnel reinstall' to see available targets"
691
691
  return 1
692
692
  ;;
@@ -0,0 +1,103 @@
1
+ #!/usr/bin/env bash
2
+
3
+ import "@/utils/log"
4
+ import "@/utils/colors"
5
+
6
+ stats_main() {
7
+ separator
8
+ box "◈ KARNEL STATS ◈"
9
+ separator
10
+ echo
11
+
12
+ _stats_version
13
+ echo
14
+ _stats_modules
15
+ echo
16
+ _stats_disk
17
+ echo
18
+ _stats_tools
19
+ echo
20
+ }
21
+
22
+ _stats_version() {
23
+ printf " ${D_CYAN}%-14s${NC} v%s\n" "Version:" "$KARNEL_VERSION"
24
+ printf " ${D_CYAN}%-14s${NC} %s\n" "KARNEL_PATH:" "$KARNEL_PATH"
25
+ printf " ${D_CYAN}%-14s${NC} %s\n" "Shell:" "${SHELL##*/}"
26
+ printf " ${D_CYAN}%-14s${NC} %s\n" "Node:" "$(node -v 2>/dev/null || echo 'not installed')"
27
+ printf " ${D_CYAN}%-14s${NC} %s\n" "npm:" "$(npm -v 2>/dev/null || echo 'not installed')"
28
+ printf " ${D_CYAN}%-14s${NC} %s\n" "Python:" "$(python3 -V 2>/dev/null | awk '{print $2}' || echo 'not installed')"
29
+ printf " ${D_CYAN}%-14s${NC} %s\n" "Go:" "$(go version 2>/dev/null | awk '{print $3}' || echo 'not installed')"
30
+ printf " ${D_CYAN}%-14s${NC} %s\n" "Rust:" "$(rustc --version 2>/dev/null | awk '{print $2}' || echo 'not installed')"
31
+ }
32
+
33
+ _stats_modules() {
34
+ log_info "Installed Modules"
35
+ echo
36
+ local -a modules=(ai auto db deploy dev editor games lang network npm osint plugin security shell ui utils voice)
37
+ local installed=0
38
+ local not_installed=0
39
+ local status
40
+
41
+ for mod in "${modules[@]}"; do
42
+ local marker="${KARNEL_DATA:-$HOME/.local/share/karnel-data}/${mod}/.installed"
43
+ if [[ -f "$marker" ]]; then
44
+ status="${GREEN}installed${NC}"
45
+ ((installed++))
46
+ else
47
+ status="${D_RED}—${NC}"
48
+ ((not_installed++))
49
+ fi
50
+ printf " %-12s %b\n" "$mod" "$status"
51
+ done
52
+ echo
53
+ printf " ${D_CYAN}Total:${NC} %d installed, %d not installed\n" "$installed" "$not_installed"
54
+ }
55
+
56
+ _stats_disk() {
57
+ log_info "Disk Usage"
58
+ echo
59
+ local karnel_size data_size cache_size config_size
60
+
61
+ karnel_size=$(du -sh "$KARNEL_PATH/.." 2>/dev/null | awk '{print $1}')
62
+ data_size=$(du -sh "${KARNEL_DATA:-$HOME/.local/share/karnel-data}" 2>/dev/null | awk '{print $1}')
63
+ cache_size=$(du -sh "$KARNEL_CACHE" 2>/dev/null | awk '{print $1}')
64
+ config_size=$(du -sh "${KARNEL_CONFIG:-$HOME/.config/karnel}" 2>/dev/null | awk '{print $1}')
65
+
66
+ printf " ${D_CYAN}%-14s${NC} %s\n" "Framework:" "${karnel_size:-0}"
67
+ printf " ${D_CYAN}%-14s${NC} %s\n" "Data:" "${data_size:-0}"
68
+ printf " ${D_CYAN}%-14s${NC} %s\n" "Cache:" "${cache_size:-0}"
69
+ printf " ${D_CYAN}%-14s${NC} %s\n" "Config:" "${config_size:-0}"
70
+
71
+ local total_storage
72
+ total_storage=$(du -sh "$KARNEL_PATH/.." "${KARNEL_DATA:-$HOME/.local/share/karnel-data}" "$KARNEL_CACHE" 2>/dev/null | tail -1 | awk '{print $1}')
73
+ echo
74
+ printf " ${D_CYAN}%-14s${NC} %s\n" "Total:" "${total_storage:-unknown}"
75
+ }
76
+
77
+ _stats_tools() {
78
+ log_info "Tool Counts"
79
+ echo
80
+ local -A tool_counts=(
81
+ [ai]=0 [auto]=0 [db]=0 [deploy]=0 [dev]=0 [editor]=0
82
+ [games]=0 [lang]=0 [network]=0 [npm]=0 [osint]=0
83
+ [plugin]=0 [security]=0 [shell]=0 [ui]=0 [utils]=0 [voice]=0
84
+ )
85
+
86
+ local total=0
87
+ for mod in "${!tool_counts[@]}"; do
88
+ local tools_dir="$KARNEL_PATH/tools/$mod"
89
+ if [[ -d "$tools_dir" ]]; then
90
+ local count
91
+ count=$(find "$tools_dir" -maxdepth 1 -mindepth 1 -type d 2>/dev/null | wc -l)
92
+ tool_counts[$mod]=$count
93
+ ((total += count))
94
+ fi
95
+ done
96
+
97
+ for mod in ai auto db deploy dev editor games lang network npm osint plugin security shell ui utils voice; do
98
+ local count=${tool_counts[$mod]:-0}
99
+ [[ "$count" -gt 0 ]] && printf " %-12s %d tools\n" "$mod" "$count"
100
+ done
101
+ echo
102
+ printf " ${D_CYAN}%-14s${NC} %d tools across %d modules\n" "Total:" "$total" "${#tool_counts[@]}"
103
+ }
@@ -149,8 +149,8 @@ _uninstall_full_module() {
149
149
  uninstall_security
150
150
  ;;
151
151
  games)
152
- import "@/tools/games/all"
153
- uninstall_all_games
152
+ import "@/modules/games"
153
+ uninstall_games
154
154
  ;;
155
155
  supabase)
156
156
  import "@/tools/deploy/supabase/install"
@@ -131,8 +131,8 @@ _update_full_module() {
131
131
  update_auto
132
132
  ;;
133
133
  games)
134
- import "@/tools/games/all"
135
- update_all_games
134
+ import "@/modules/games"
135
+ update_games
136
136
  ;;
137
137
  osint)
138
138
  import "@/modules/osint"
@@ -26,7 +26,11 @@ upgrade_main() {
26
26
  echo
27
27
  log_info "Running cleanup..."
28
28
  import "@/cli/commands/cleanup"
29
- cleanup_main
29
+ local cleanup_rc=0
30
+ cleanup_main || cleanup_rc=$?
31
+ if [[ "$cleanup_rc" -ne 0 ]]; then
32
+ log_warn "Cleanup completed with warnings"
33
+ fi
30
34
  echo
31
35
  log_success "Karnel is up to date (v$KARNEL_VERSION)"
32
36
  echo
@@ -115,6 +115,7 @@ karnel_help() {
115
115
  printf " ${D_CYAN}%-18s${NC} %s\n" "search <query>" "Search across all tools and memories"
116
116
  printf " ${D_CYAN}%-18s${NC} %s\n" "show <module> [--tool]" "Show README/docs for a tool"
117
117
  printf " ${D_CYAN}%-18s${NC} %s\n" "start [editor,robin]" "Start services (code-server, etc.)"
118
+ printf " ${D_CYAN}%-18s${NC} %s\n" "stats" "System overview: modules, tools, disk usage"
118
119
  printf " ${D_CYAN}%-18s${NC} %s\n" "status" "Quick system overview"
119
120
  printf " ${D_CYAN}%-18s${NC} %s\n" "supabase [doctor,types,migrate,link,remote,remote-status,install,uninstall]" "Supabase CLI (types, migrate, functions, secrets)"
120
121
  printf " ${D_CYAN}%-18s${NC} %s\n" "uninstall <module>" "Remove installed modules"
@@ -1,25 +1,65 @@
1
1
  #!/usr/bin/env bash
2
2
  # shellcheck shell=bash
3
3
 
4
+ import "@/utils/log"
5
+ import "@/utils/colors"
6
+
7
+ LOG_FILE="$KARNEL_CACHE/install_security.log"
8
+
4
9
  install_security() {
5
10
  separator
6
11
  box "Installing Security Tools"
7
12
  separator
13
+ echo
14
+ log_info "Installing security tools..."
15
+ mkdir -p "$(dirname "$LOG_FILE")"
16
+ local rc=0
8
17
  import "@/tools/security/all"
9
- install_all_security
18
+ install_all_security || rc=$?
19
+ separator
20
+ [[ "$rc" -eq 0 ]] && log_success "Security tools installed" || log_warn "$rc security tool(s) failed to install"
21
+ return "$rc"
10
22
  }
11
23
 
12
24
  uninstall_security() {
25
+ separator
26
+ box "Uninstalling Security Tools"
27
+ separator
28
+ echo
29
+ log_info "Uninstalling security tools..."
30
+ local rc=0
13
31
  import "@/tools/security/all"
14
- uninstall_all_security
32
+ uninstall_all_security || rc=$?
33
+ separator
34
+ [[ "$rc" -eq 0 ]] && log_success "Security tools uninstalled" || log_warn "$rc security tool(s) failed to uninstall"
35
+ return "$rc"
15
36
  }
16
37
 
17
38
  update_security() {
39
+ separator
40
+ box "Updating Security Tools"
41
+ separator
42
+ echo
43
+ log_info "Updating security tools..."
44
+ local rc=0
18
45
  import "@/tools/security/all"
19
- update_all_security
46
+ update_all_security || rc=$?
47
+ separator
48
+ [[ "$rc" -eq 0 ]] && log_success "Security tools updated" || log_warn "$rc security tool(s) failed to update"
49
+ return "$rc"
20
50
  }
21
51
 
22
52
  reinstall_security() {
53
+ separator
54
+ box "Reinstalling Security Tools"
55
+ separator
56
+ echo
57
+ log_info "Reinstalling security tools..."
58
+ mkdir -p "$(dirname "$LOG_FILE")"
59
+ local rc=0
23
60
  import "@/tools/security/all"
24
- reinstall_all_security
61
+ reinstall_all_security || rc=$?
62
+ separator
63
+ [[ "$rc" -eq 0 ]] && log_success "Security tools reinstalled" || log_warn "$rc security tool(s) failed to reinstall"
64
+ return "$rc"
25
65
  }
@@ -4,13 +4,8 @@ import "@/utils/log"
4
4
  import "@/utils/colors"
5
5
 
6
6
  TERMUX_DIR="$HOME/.termux"
7
- TERMUX_ASSETS_DIR="$(dirname "$KARNEL_PATH")/assets"
8
7
  LOG_FILE="$KARNEL_CACHE/install_ui.log"
9
8
 
10
- install_ui() {
11
- setup_ui
12
- }
13
-
14
9
  setup_ui() {
15
10
  separator
16
11
  box "Configuring Termux UI"
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env bash
2
2
 
3
- LOG_FILE="${LOG_FILE:-$KARNEL_CACHE/install_ai.log}"
3
+ LOG_FILE="${LOG_FILE:-$KARNEL_CACHE/install.log}"
4
4
 
5
5
  # ── Dependency installation ────────────────────────────────────
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "karnel-termux",
3
- "version": "4.17.41",
3
+ "version": "4.17.43",
4
4
  "description": "Modular Dev Environment for Termux — install languages, databases, AI agents, editors, and more with one command",
5
5
  "bin": {
6
6
  "karnel": "karnel/bin/karnel"
@@ -35,7 +35,7 @@ _karnel_completions() {
35
35
  local cur prev words cword
36
36
  _init_completion || return
37
37
 
38
- local commands="agent backup brain cleanup deploy doctor env help ia init install list open pg plugin reinstall restore robin search show start status supabase uninstall update upgrade version voice"
38
+ local commands="agent backup brain cleanup deploy doctor env help ia init install list open pg plugin reinstall restore robin search show start stats status supabase uninstall update upgrade version voice"
39
39
  local modules="ai auto db deploy dev editor games lang network npm osint plugin security shell ui utils voice"
40
40
  local install_targets="$modules supabase"
41
41
  local update_targets="$modules supabase karnel"
@@ -28,6 +28,7 @@ _karnel_commands() {
28
28
  'search:Search tools and memories'
29
29
  'show:Show tool documentation'
30
30
  'start:Start a service'
31
+ 'stats:System overview with versions, modules, and tool counts'
31
32
  'status:Show a quick system overview'
32
33
  'supabase:Manage Supabase CLI remote workflows'
33
34
  'uninstall:Remove modules and tools'