karnel-termux 4.7.6 → 4.7.7
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 +230 -225
- package/install.sh +30 -9
- package/karnel/bin/karnel +2 -2
- package/karnel/cli/commands/backup.sh +10 -2
- package/karnel/cli/commands/brain.sh +28 -23
- package/karnel/cli/commands/cleanup.sh +10 -4
- package/karnel/cli/commands/deploy.sh +53 -0
- package/karnel/cli/commands/doctor/code.sh +225 -0
- package/karnel/cli/commands/doctor/code_detect.sh +184 -0
- package/karnel/cli/commands/doctor/code_exec.sh +278 -0
- package/karnel/cli/commands/doctor/code_langs.sh +229 -0
- package/karnel/cli/commands/doctor/fixes.sh +63 -46
- package/karnel/cli/commands/doctor.sh +222 -80
- package/karnel/cli/commands/env.sh +2 -0
- package/karnel/cli/commands/ia.sh +12 -2
- package/karnel/cli/commands/init.sh +17 -9
- package/karnel/cli/commands/install.sh +90 -54
- package/karnel/cli/commands/list.sh +36 -0
- package/karnel/cli/commands/pg.sh +21 -6
- package/karnel/cli/commands/reinstall.sh +99 -0
- package/karnel/cli/commands/restore.sh +43 -3
- package/karnel/cli/commands/search.sh +2 -2
- package/karnel/cli/commands/update.sh +6 -1
- package/karnel/cli/commands/upgrade.sh +8 -1
- package/karnel/cli/commands/voice.sh +2 -1
- package/karnel/cli/karnel.sh +11 -5
- package/karnel/modules/games.sh +11 -0
- package/karnel/tools/ai/all.sh +1 -0
- package/karnel/tools/ai/copilot-termux/README.md +40 -0
- package/karnel/tools/ai/copilot-termux/install.sh +80 -0
- package/karnel/tools/ai/copilot-termux/package.json +20 -0
- package/karnel/tools/db/all.sh +2 -0
- package/karnel/tools/deploy/railway/install.sh +2 -2
- package/karnel/tools/dev/all.sh +8 -0
- package/karnel/tools/dev/applaunch/__pycache__/applaunch.cpython-314.pyc +0 -0
- package/karnel/tools/dev/applaunch/applaunch.py +434 -0
- package/karnel/tools/dev/applaunch/install.sh +51 -0
- package/karnel/tools/dev/fconv/__pycache__/fconv.cpython-314.pyc +0 -0
- package/karnel/tools/dev/fconv/fconv.py +749 -0
- package/karnel/tools/dev/fconv/install.sh +51 -0
- package/karnel/tools/dev/filecheck/__pycache__/filecheck.cpython-314.pyc +0 -0
- package/karnel/tools/dev/filecheck/filecheck.py +429 -0
- package/karnel/tools/dev/filecheck/install.sh +51 -0
- package/karnel/tools/dev/notes/__pycache__/notes.cpython-314.pyc +0 -0
- package/karnel/tools/dev/notes/install.sh +51 -0
- package/karnel/tools/dev/notes/notes.py +849 -0
- package/karnel/tools/dev/passman/__pycache__/passman.cpython-314.pyc +0 -0
- package/karnel/tools/dev/passman/install.sh +51 -0
- package/karnel/tools/dev/passman/passman.py +536 -0
- package/karnel/tools/dev/splash/__pycache__/splash.cpython-314.pyc +0 -0
- package/karnel/tools/dev/splash/install.sh +51 -0
- package/karnel/tools/dev/splash/splash.py +188 -0
- package/karnel/tools/dev/treex/install.sh +51 -0
- package/karnel/tools/dev/treex/treex.py +2036 -0
- package/karnel/tools/dev/websites/__pycache__/websites.cpython-314.pyc +0 -0
- package/karnel/tools/dev/websites/install.sh +51 -0
- package/karnel/tools/dev/websites/websites.py +844 -0
- package/karnel/tools/games/all.sh +62 -0
- package/karnel/tools/games/arcade/__pycache__/arcade.cpython-314.pyc +0 -0
- package/karnel/tools/games/arcade/arcade.py +193 -0
- package/karnel/tools/games/arcade/install.sh +51 -0
- package/karnel/tools/games/buzz/__pycache__/buzz.cpython-314.pyc +0 -0
- package/karnel/tools/games/buzz/buzz.py +1264 -0
- package/karnel/tools/games/buzz/install.sh +51 -0
- package/karnel/tools/games/ctfgod/__pycache__/ctfgod.cpython-314.pyc +0 -0
- package/karnel/tools/games/ctfgod/ctfgod.py +1576 -0
- package/karnel/tools/games/ctfgod/install.sh +51 -0
- package/karnel/tools/games/detective/__pycache__/detective.cpython-314.pyc +0 -0
- package/karnel/tools/games/detective/detective.py +2091 -0
- package/karnel/tools/games/detective/install.sh +51 -0
- package/karnel/tools/games/pet-friends/__pycache__/pet-friends.cpython-314.pyc +0 -0
- package/karnel/tools/games/pet-friends/install.sh +51 -0
- package/karnel/tools/games/pet-friends/pet-friends.py +15802 -0
- package/karnel/tools/games/tamagotchi/__pycache__/tamagotchi.cpython-314.pyc +0 -0
- package/karnel/tools/games/tamagotchi/install.sh +51 -0
- package/karnel/tools/games/tamagotchi/tamagotchi.py +1224 -0
- package/karnel/tools/games/terminal-arcade/__pycache__/terminal-arcade.cpython-314.pyc +0 -0
- package/karnel/tools/games/terminal-arcade/terminal-arcade.py +193 -0
- package/karnel/tools/npm/all.sh +1 -0
- package/karnel/utils/log.sh +34 -12
- package/package.json +1 -1
|
@@ -3,60 +3,6 @@
|
|
|
3
3
|
import "@/utils/log"
|
|
4
4
|
import "@/utils/colors"
|
|
5
5
|
|
|
6
|
-
# Generic tool installer helper
|
|
7
|
-
_install_tool() {
|
|
8
|
-
local tool_name="$1"
|
|
9
|
-
local install_func="$2"
|
|
10
|
-
local display_name="${3:-$tool_name}"
|
|
11
|
-
|
|
12
|
-
if command -v "$tool_name" &>/dev/null; then
|
|
13
|
-
log_info "$display_name is already installed"
|
|
14
|
-
return 2
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
$install_func
|
|
18
|
-
return $?
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
# Generic module installer with progress tracking
|
|
22
|
-
_install_tools_in_module() {
|
|
23
|
-
local module="$1"
|
|
24
|
-
local action="${2:-install}"
|
|
25
|
-
shift 2
|
|
26
|
-
local -a tools=("$@")
|
|
27
|
-
|
|
28
|
-
local success_count=0
|
|
29
|
-
local failed_count=0
|
|
30
|
-
local total=${#tools[@]}
|
|
31
|
-
local current=0
|
|
32
|
-
|
|
33
|
-
progress_start "$total" "${action^}ing tools..."
|
|
34
|
-
|
|
35
|
-
for tool in "${tools[@]}"; do
|
|
36
|
-
((current++))
|
|
37
|
-
|
|
38
|
-
local func_name="${action}_${tool//-/_}"
|
|
39
|
-
loading "${action^}ing ${tool}" "$func_name"
|
|
40
|
-
case $? in
|
|
41
|
-
0|2) ((success_count++)) ;;
|
|
42
|
-
1) ((failed_count++)) ;;
|
|
43
|
-
esac
|
|
44
|
-
|
|
45
|
-
progress_update "$current" "$total"
|
|
46
|
-
done
|
|
47
|
-
|
|
48
|
-
progress_done "$total"
|
|
49
|
-
if [[ $success_count -gt 0 ]]; then
|
|
50
|
-
log_success "$success_count tool(s) ${action}ed"
|
|
51
|
-
fi
|
|
52
|
-
if [[ $failed_count -gt 0 ]]; then
|
|
53
|
-
log_warn "$failed_count tool(s) failed to ${action}"
|
|
54
|
-
fi
|
|
55
|
-
echo
|
|
56
|
-
|
|
57
|
-
return 0
|
|
58
|
-
}
|
|
59
|
-
|
|
60
6
|
install_main() {
|
|
61
7
|
|
|
62
8
|
if [[ $# -eq 0 ]]; then
|
|
@@ -184,6 +130,10 @@ _install_full_module() {
|
|
|
184
130
|
import "@/modules/voice"
|
|
185
131
|
install_voice
|
|
186
132
|
;;
|
|
133
|
+
games)
|
|
134
|
+
import "@/modules/games"
|
|
135
|
+
install_games
|
|
136
|
+
;;
|
|
187
137
|
*)
|
|
188
138
|
log_warn "Unknown install target: $target"
|
|
189
139
|
echo "Run 'karnel install' to see available targets"
|
|
@@ -352,6 +302,14 @@ _install_specific_tools() {
|
|
|
352
302
|
install_tmate
|
|
353
303
|
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
354
304
|
;;
|
|
305
|
+
openssh)
|
|
306
|
+
install_openssh
|
|
307
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
308
|
+
;;
|
|
309
|
+
tmux)
|
|
310
|
+
install_tmux
|
|
311
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
312
|
+
;;
|
|
355
313
|
cloudflared)
|
|
356
314
|
install_cloudflared
|
|
357
315
|
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
@@ -408,6 +366,38 @@ _install_specific_tools() {
|
|
|
408
366
|
install_zork
|
|
409
367
|
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
410
368
|
;;
|
|
369
|
+
fconv)
|
|
370
|
+
install_fconv
|
|
371
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
372
|
+
;;
|
|
373
|
+
filecheck)
|
|
374
|
+
install_filecheck
|
|
375
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
376
|
+
;;
|
|
377
|
+
websites)
|
|
378
|
+
install_websites
|
|
379
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
380
|
+
;;
|
|
381
|
+
notes)
|
|
382
|
+
install_notes
|
|
383
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
384
|
+
;;
|
|
385
|
+
treex)
|
|
386
|
+
install_treex
|
|
387
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
388
|
+
;;
|
|
389
|
+
passman)
|
|
390
|
+
install_passman
|
|
391
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
392
|
+
;;
|
|
393
|
+
applaunch)
|
|
394
|
+
install_applaunch
|
|
395
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
396
|
+
;;
|
|
397
|
+
splash)
|
|
398
|
+
install_splash
|
|
399
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
400
|
+
;;
|
|
411
401
|
*)
|
|
412
402
|
log_warn "Unknown tool: --$tool"
|
|
413
403
|
;;
|
|
@@ -423,6 +413,52 @@ _install_specific_tools() {
|
|
|
423
413
|
fi
|
|
424
414
|
echo
|
|
425
415
|
;;
|
|
416
|
+
games)
|
|
417
|
+
import "@/tools/games/all"
|
|
418
|
+
local installed_count=0
|
|
419
|
+
local failed_count=0
|
|
420
|
+
|
|
421
|
+
for tool in "${tools[@]}"; do
|
|
422
|
+
case "$tool" in
|
|
423
|
+
buzz)
|
|
424
|
+
install_buzz
|
|
425
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
426
|
+
;;
|
|
427
|
+
ctfgod)
|
|
428
|
+
install_ctfgod
|
|
429
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
430
|
+
;;
|
|
431
|
+
detective)
|
|
432
|
+
install_detective
|
|
433
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
434
|
+
;;
|
|
435
|
+
pet-friends)
|
|
436
|
+
install_pet_friends
|
|
437
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
438
|
+
;;
|
|
439
|
+
tamagotchi)
|
|
440
|
+
install_tamagotchi
|
|
441
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
442
|
+
;;
|
|
443
|
+
arcade)
|
|
444
|
+
install_arcade
|
|
445
|
+
case $? in 0|2) ((installed_count++));; 1) ((failed_count++));; esac
|
|
446
|
+
;;
|
|
447
|
+
*)
|
|
448
|
+
log_warn "Unknown game: --$tool"
|
|
449
|
+
;;
|
|
450
|
+
esac
|
|
451
|
+
done
|
|
452
|
+
|
|
453
|
+
echo
|
|
454
|
+
if [[ $installed_count -gt 0 ]]; then
|
|
455
|
+
log_success "$installed_count game(s) installed"
|
|
456
|
+
fi
|
|
457
|
+
if [[ $failed_count -gt 0 ]]; then
|
|
458
|
+
log_warn "$failed_count game(s) failed to install"
|
|
459
|
+
fi
|
|
460
|
+
echo
|
|
461
|
+
;;
|
|
426
462
|
npm)
|
|
427
463
|
import "@/tools/npm/all"
|
|
428
464
|
local installed_count=0
|
|
@@ -23,6 +23,7 @@ list_main() {
|
|
|
23
23
|
list_item "ui - List Termux UI components"
|
|
24
24
|
list_item "auto - List automation tools"
|
|
25
25
|
list_item "deploy - List deploy CLIs"
|
|
26
|
+
list_item "games - List games"
|
|
26
27
|
echo
|
|
27
28
|
return
|
|
28
29
|
fi
|
|
@@ -59,6 +60,9 @@ list_main() {
|
|
|
59
60
|
deploy)
|
|
60
61
|
_list_deploy
|
|
61
62
|
;;
|
|
63
|
+
games)
|
|
64
|
+
_list_games
|
|
65
|
+
;;
|
|
62
66
|
*)
|
|
63
67
|
log_warn "Unknown list target: $arg"
|
|
64
68
|
echo "Run 'karnel list' to see available targets"
|
|
@@ -167,6 +171,7 @@ _list_ai() {
|
|
|
167
171
|
table_row "omniRoute" "--omni-route" "omni-route" "$(_check_cmd "omni-route")"
|
|
168
172
|
table_row "Context7 Docs" "--ctx7" "ctx7" "$(_check_cmd "ctx7")"
|
|
169
173
|
table_row "OpenSpec SDD" "--openspec" "openspec" "$(_check_cmd "openspec")"
|
|
174
|
+
table_row "Copilot-Termux" "--copilot-termux" "copilot" "$(_check_cmd "copilot")"
|
|
170
175
|
table_end
|
|
171
176
|
|
|
172
177
|
echo
|
|
@@ -226,6 +231,14 @@ _list_dev() {
|
|
|
226
231
|
table_row "Snyk" "--snyk" "$(_check_cmd "snyk")"
|
|
227
232
|
table_row "httptmux" "--httptmux" "$(_check_cmd "httptmux")"
|
|
228
233
|
table_row "Zork" "--zork" "$(_check_cmd "zork")"
|
|
234
|
+
table_row "File Converter" "--fconv" "$(_check_cmd "fconv")"
|
|
235
|
+
table_row "File Checker" "--filecheck" "$(_check_cmd "filecheck")"
|
|
236
|
+
table_row "Websites Creator" "--websites" "$(_check_cmd "websites")"
|
|
237
|
+
table_row "Smart Notes" "--notes" "$(_check_cmd "notes")"
|
|
238
|
+
table_row "Tree Explorer" "--treex" "$(_check_cmd "treex")"
|
|
239
|
+
table_row "Password Master" "--passman" "$(_check_cmd "passman")"
|
|
240
|
+
table_row "App Launcher" "--applaunch" "$(_check_cmd "applaunch")"
|
|
241
|
+
table_row "Loading Screen" "--splash" "$(_check_cmd "splash")"
|
|
229
242
|
table_end
|
|
230
243
|
|
|
231
244
|
echo
|
|
@@ -234,6 +247,29 @@ _list_dev() {
|
|
|
234
247
|
echo
|
|
235
248
|
}
|
|
236
249
|
|
|
250
|
+
# ===== LIST GAMES =====
|
|
251
|
+
_list_games() {
|
|
252
|
+
echo
|
|
253
|
+
box "Games"
|
|
254
|
+
echo
|
|
255
|
+
log_info "Available games and install commands:"
|
|
256
|
+
echo
|
|
257
|
+
|
|
258
|
+
table_start "Game" "Install Flag" "Status"
|
|
259
|
+
table_row "Buzz" "--buzz" "$(_check_cmd "buzz")"
|
|
260
|
+
table_row "CTF God" "--ctfgod" "$(_check_cmd "ctfgod")"
|
|
261
|
+
table_row "Detective" "--detective" "$(_check_cmd "detective")"
|
|
262
|
+
table_row "Pet Friends" "--pet-friends" "$(_check_cmd "pet-friends")"
|
|
263
|
+
table_row "Tamagotchi" "--tamagotchi" "$(_check_cmd "tamagotchi")"
|
|
264
|
+
table_row "Terminal Arcade" "--arcade" "$(_check_cmd "arcade")"
|
|
265
|
+
table_end
|
|
266
|
+
|
|
267
|
+
echo
|
|
268
|
+
log_info "Install specific: ${D_CYAN}karnel install games --buzz --ctf-god${NC}"
|
|
269
|
+
log_info "Install all: ${D_CYAN}karnel install games${NC}"
|
|
270
|
+
echo
|
|
271
|
+
}
|
|
272
|
+
|
|
237
273
|
# ===== LIST NODE =====
|
|
238
274
|
_list_npm() {
|
|
239
275
|
echo
|
|
@@ -112,10 +112,15 @@ pg_init() {
|
|
|
112
112
|
|
|
113
113
|
# Executar initdb
|
|
114
114
|
if loading "Initializing database" initdb -D "$PG_DATA_DEFAULT"; then
|
|
115
|
+
local os_user; os_user=$(whoami 2>/dev/null || id -un 2>/dev/null || echo "unknown")
|
|
115
116
|
log_success "PostgreSQL initialized successfully"
|
|
116
117
|
echo
|
|
117
118
|
list_item "Data directory: $PG_DATA_DEFAULT"
|
|
118
|
-
list_item "
|
|
119
|
+
list_item "OS user: $os_user (superuser)"
|
|
120
|
+
list_item "PostgreSQL user: $PG_USER (may need to be created)"
|
|
121
|
+
echo
|
|
122
|
+
log_info "To create the 'postgres' role:"
|
|
123
|
+
list_item "${D_CYAN}psql -d postgres -c \"CREATE ROLE $PG_USER LOGIN SUPERUSER;\"${NC}"
|
|
119
124
|
echo
|
|
120
125
|
log_info "Start PostgreSQL with: ${D_CYAN}karnel pg start${NC}"
|
|
121
126
|
else
|
|
@@ -288,7 +293,7 @@ pg_create() {
|
|
|
288
293
|
log_success "Database '$db_name' created successfully"
|
|
289
294
|
else
|
|
290
295
|
log_error "Failed to create database '$db_name'"
|
|
291
|
-
log_warn "
|
|
296
|
+
log_warn "Check that PostgreSQL is running (karnel pg status) and the pg_user role exists"
|
|
292
297
|
return 1
|
|
293
298
|
fi
|
|
294
299
|
}
|
|
@@ -352,7 +357,7 @@ pg_list() {
|
|
|
352
357
|
else
|
|
353
358
|
echo
|
|
354
359
|
log_error "Failed to list databases"
|
|
355
|
-
log_warn "
|
|
360
|
+
log_warn "Check that PostgreSQL is running (karnel pg status) and the pg_user role exists"
|
|
356
361
|
return 1
|
|
357
362
|
fi
|
|
358
363
|
}
|
|
@@ -613,6 +618,12 @@ pg_restore_db() {
|
|
|
613
618
|
success=true
|
|
614
619
|
fi
|
|
615
620
|
else
|
|
621
|
+
local pg_confirm
|
|
622
|
+
read_confirm "Restore will clean ($db_name) and replace all objects. Continue?" pg_confirm
|
|
623
|
+
if [[ "$pg_confirm" != "y" ]]; then
|
|
624
|
+
log_info "Restore cancelled"
|
|
625
|
+
return 0
|
|
626
|
+
fi
|
|
616
627
|
if loading "Restoring database" pg_restore -d "$db_name" -c "$backup_file" 2>/dev/null || pg_restore -d "$db_name" "$backup_file" 2>/dev/null; then
|
|
617
628
|
success=true
|
|
618
629
|
fi
|
|
@@ -665,8 +676,10 @@ pg_list_backups() {
|
|
|
665
676
|
|
|
666
677
|
local integrity="OK"
|
|
667
678
|
if [[ -f "${f}.sha256" ]]; then
|
|
668
|
-
local current_hash
|
|
669
|
-
|
|
679
|
+
local current_hash
|
|
680
|
+
current_hash=$(sha256sum "$f" | cut -d' ' -f1)
|
|
681
|
+
local expected_hash
|
|
682
|
+
expected_hash=$(cat "${f}.sha256" 2>/dev/null)
|
|
670
683
|
if [[ "$current_hash" != "$expected_hash" ]]; then
|
|
671
684
|
integrity="Corrupted"
|
|
672
685
|
fi
|
|
@@ -710,7 +723,9 @@ pg_schedule() {
|
|
|
710
723
|
pkg install -y cronie >/dev/null 2>&1 || true
|
|
711
724
|
fi
|
|
712
725
|
|
|
713
|
-
local
|
|
726
|
+
local escaped_db; printf -v escaped_db '%q' "$db_name"
|
|
727
|
+
local escaped_path; printf -v escaped_path '%q' "$KARNEL_PATH"
|
|
728
|
+
local job="$cron_expr KARNEL_PATH=$escaped_path $escaped_path/bin/karnel pg backup $escaped_db >/dev/null 2>&1"
|
|
714
729
|
(crontab -l 2>/dev/null | grep -v "karnel pg backup $db_name"; echo "$job") | crontab -
|
|
715
730
|
log_success "Backup scheduled successfully ($interval) for database '$db_name'!"
|
|
716
731
|
list_item "Ensure cron daemon is running (run: 'crond')"
|
|
@@ -23,6 +23,7 @@ reinstall_main() {
|
|
|
23
23
|
list_item "shell - Reinstall ZSH + Oh My Zsh"
|
|
24
24
|
list_item "ui - Reinstall Termux UI"
|
|
25
25
|
list_item "auto - Reinstall automation tools"
|
|
26
|
+
list_item "games - Reinstall games"
|
|
26
27
|
echo
|
|
27
28
|
log_info "Reinstall specific tools with flags:"
|
|
28
29
|
echo
|
|
@@ -100,6 +101,10 @@ _reinstall_full_module() {
|
|
|
100
101
|
import "@/modules/auto"
|
|
101
102
|
reinstall_auto
|
|
102
103
|
;;
|
|
104
|
+
games)
|
|
105
|
+
import "@/tools/games/all"
|
|
106
|
+
reinstall_all_games
|
|
107
|
+
;;
|
|
103
108
|
*)
|
|
104
109
|
log_warn "Unknown reinstall target: $target"
|
|
105
110
|
echo "Run 'karnel reinstall' to see available targets"
|
|
@@ -220,6 +225,10 @@ _reinstall_specific_tools() {
|
|
|
220
225
|
reinstall_openspec
|
|
221
226
|
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
222
227
|
;;
|
|
228
|
+
copilot-termux)
|
|
229
|
+
reinstall_copilot_termux
|
|
230
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
231
|
+
;;
|
|
223
232
|
*)
|
|
224
233
|
log_warn "Unknown AI tool: --$tool"
|
|
225
234
|
;;
|
|
@@ -368,6 +377,50 @@ _reinstall_specific_tools() {
|
|
|
368
377
|
reinstall_udocker
|
|
369
378
|
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
370
379
|
;;
|
|
380
|
+
snyk)
|
|
381
|
+
reinstall_snyk
|
|
382
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
383
|
+
;;
|
|
384
|
+
httptmux)
|
|
385
|
+
reinstall_httptmux
|
|
386
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
387
|
+
;;
|
|
388
|
+
zork)
|
|
389
|
+
reinstall_zork
|
|
390
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
391
|
+
;;
|
|
392
|
+
fconv)
|
|
393
|
+
reinstall_fconv
|
|
394
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
395
|
+
;;
|
|
396
|
+
filecheck)
|
|
397
|
+
reinstall_filecheck
|
|
398
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
399
|
+
;;
|
|
400
|
+
websites)
|
|
401
|
+
reinstall_websites
|
|
402
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
403
|
+
;;
|
|
404
|
+
notes)
|
|
405
|
+
reinstall_notes
|
|
406
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
407
|
+
;;
|
|
408
|
+
treex)
|
|
409
|
+
reinstall_treex
|
|
410
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
411
|
+
;;
|
|
412
|
+
passman)
|
|
413
|
+
reinstall_passman
|
|
414
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
415
|
+
;;
|
|
416
|
+
applaunch)
|
|
417
|
+
reinstall_applaunch
|
|
418
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
419
|
+
;;
|
|
420
|
+
splash)
|
|
421
|
+
reinstall_splash
|
|
422
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
423
|
+
;;
|
|
371
424
|
*)
|
|
372
425
|
log_warn "Unknown tool: --$tool"
|
|
373
426
|
;;
|
|
@@ -383,6 +436,52 @@ _reinstall_specific_tools() {
|
|
|
383
436
|
fi
|
|
384
437
|
echo
|
|
385
438
|
;;
|
|
439
|
+
games)
|
|
440
|
+
import "@/tools/games/all"
|
|
441
|
+
local reinstalled_count=0
|
|
442
|
+
local failed_count=0
|
|
443
|
+
|
|
444
|
+
for tool in "${tools[@]}"; do
|
|
445
|
+
case "$tool" in
|
|
446
|
+
buzz)
|
|
447
|
+
reinstall_buzz
|
|
448
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
449
|
+
;;
|
|
450
|
+
ctfgod)
|
|
451
|
+
reinstall_ctfgod
|
|
452
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
453
|
+
;;
|
|
454
|
+
detective)
|
|
455
|
+
reinstall_detective
|
|
456
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
457
|
+
;;
|
|
458
|
+
pet-friends)
|
|
459
|
+
reinstall_pet_friends
|
|
460
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
461
|
+
;;
|
|
462
|
+
tamagotchi)
|
|
463
|
+
reinstall_tamagotchi
|
|
464
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
465
|
+
;;
|
|
466
|
+
arcade)
|
|
467
|
+
reinstall_arcade
|
|
468
|
+
case $? in 0) ((reinstalled_count++));; 1) ((failed_count++));; esac
|
|
469
|
+
;;
|
|
470
|
+
*)
|
|
471
|
+
log_warn "Unknown game: --$tool"
|
|
472
|
+
;;
|
|
473
|
+
esac
|
|
474
|
+
done
|
|
475
|
+
|
|
476
|
+
echo
|
|
477
|
+
if [[ $reinstalled_count -gt 0 ]]; then
|
|
478
|
+
log_success "$reinstalled_count game(s) reinstalled"
|
|
479
|
+
fi
|
|
480
|
+
if [[ $failed_count -gt 0 ]]; then
|
|
481
|
+
log_warn "$failed_count game(s) failed to reinstall"
|
|
482
|
+
fi
|
|
483
|
+
echo
|
|
484
|
+
;;
|
|
386
485
|
npm)
|
|
387
486
|
import "@/tools/npm/all"
|
|
388
487
|
local reinstalled_count=0
|
|
@@ -52,9 +52,49 @@ restore_main() {
|
|
|
52
52
|
read_confirm "Proceed with restore?" confirm
|
|
53
53
|
[[ "$confirm" != "y" ]] && { log_info "Cancelled"; return 0; }
|
|
54
54
|
|
|
55
|
-
# Configs
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
# Configs — extract to temp then copy to correct locations
|
|
56
|
+
local tmp
|
|
57
|
+
tmp=$(mktemp -d)
|
|
58
|
+
tar -xzf "$file" -C "$tmp" 2>/dev/null
|
|
59
|
+
|
|
60
|
+
if [[ -d "$tmp/config/home" ]]; then
|
|
61
|
+
log_info "Restoring shell configs..."
|
|
62
|
+
for f in "$tmp/config/home/"*; do
|
|
63
|
+
cp "$f" "$HOME/$(basename "$f")" 2>/dev/null
|
|
64
|
+
done
|
|
65
|
+
log_success "Shell configs restored"
|
|
66
|
+
fi
|
|
67
|
+
|
|
68
|
+
if [[ -d "$tmp/config/termux" ]]; then
|
|
69
|
+
log_info "Restoring Termux configs..."
|
|
70
|
+
cp -r "$tmp/config/termux/.termux" "$HOME/" 2>/dev/null
|
|
71
|
+
log_success "Termux configs restored"
|
|
72
|
+
fi
|
|
73
|
+
|
|
74
|
+
if [[ -d "$tmp/config/ssh" ]]; then
|
|
75
|
+
log_info "Restoring SSH keys..."
|
|
76
|
+
mkdir -p "$HOME/.ssh"
|
|
77
|
+
chmod 700 "$HOME/.ssh"
|
|
78
|
+
for f in "$tmp/config/ssh/"*; do
|
|
79
|
+
cp "$f" "$HOME/.ssh/$(basename "$f")" 2>/dev/null
|
|
80
|
+
done
|
|
81
|
+
chmod 600 "$HOME/.ssh/id_"* 2>/dev/null
|
|
82
|
+
log_success "SSH keys restored"
|
|
83
|
+
fi
|
|
84
|
+
|
|
85
|
+
if [[ -d "$tmp/config/config" ]]; then
|
|
86
|
+
log_info "Restoring .config..."
|
|
87
|
+
cp -r "$tmp/config/config/"* "$HOME/.config/" 2>/dev/null
|
|
88
|
+
log_success ".config restored"
|
|
89
|
+
fi
|
|
90
|
+
|
|
91
|
+
if [[ -d "$tmp/config/prefix-etc" ]]; then
|
|
92
|
+
log_info "Restoring apt sources..."
|
|
93
|
+
cp "$tmp/config/prefix-etc/"* "$PREFIX/etc/apt/" 2>/dev/null
|
|
94
|
+
log_success "APT sources restored"
|
|
95
|
+
fi
|
|
96
|
+
|
|
97
|
+
rm -rf "$tmp"
|
|
58
98
|
log_success "Configs restored"
|
|
59
99
|
|
|
60
100
|
# Packages
|
|
@@ -45,12 +45,12 @@ search_main() {
|
|
|
45
45
|
separator_section "Brain Memories"
|
|
46
46
|
echo
|
|
47
47
|
if [[ -d "$KARNEL_DATA/brain" ]]; then
|
|
48
|
-
|
|
48
|
+
while IFS= read -r file; do
|
|
49
49
|
local title
|
|
50
50
|
title=$(head -1 "$file" 2>/dev/null | sed 's/^# //')
|
|
51
51
|
list_item "${D_CYAN}$(basename "$file")${NC}: ${title:-$file}"
|
|
52
52
|
any_found=true
|
|
53
|
-
done
|
|
53
|
+
done < <(grep -ril "$query" "$KARNEL_DATA/brain" 2>/dev/null)
|
|
54
54
|
if ! $any_found; then
|
|
55
55
|
log_info "No memories found matching '$query'"
|
|
56
56
|
fi
|
|
@@ -108,6 +108,10 @@ _update_full_module() {
|
|
|
108
108
|
import "@/modules/auto"
|
|
109
109
|
update_auto
|
|
110
110
|
;;
|
|
111
|
+
games)
|
|
112
|
+
import "@/tools/games/all"
|
|
113
|
+
update_all_games
|
|
114
|
+
;;
|
|
111
115
|
*)
|
|
112
116
|
log_warn "Unknown update target: $target"
|
|
113
117
|
echo "Run 'karnel update' to see available targets"
|
|
@@ -146,7 +150,8 @@ update_karnel() {
|
|
|
146
150
|
rm -f "$KARNEL_CACHE/new_version" "$KARNEL_CACHE/last_version_check"
|
|
147
151
|
else
|
|
148
152
|
log_warn "Not a git repository, cannot update"
|
|
149
|
-
log_info "If
|
|
153
|
+
log_info "If installed via npm/pnpm, run: npm update -g karnel-termux"
|
|
154
|
+
log_info "If installed via curl, reinstall with:"
|
|
150
155
|
echo " curl -fsSL https://raw.githubusercontent.com/israelmarques1024-dotcom/karnel-termux/main/install.sh | bash"
|
|
151
156
|
fi
|
|
152
157
|
|
|
@@ -10,8 +10,15 @@ upgrade_main() {
|
|
|
10
10
|
|
|
11
11
|
log_info "Upgrading Karnel framework to latest version..."
|
|
12
12
|
|
|
13
|
+
local karnel_root
|
|
14
|
+
karnel_root="$(cd "$KARNEL_PATH/.." && pwd 2>/dev/null || echo "")"
|
|
15
|
+
if [[ ! -d "$karnel_root/.git" ]]; then
|
|
16
|
+
log_warn "Installed via npm/pnpm — use 'npm update -g karnel-termux' or 'pnpm update -g karnel-termux'"
|
|
17
|
+
return 1
|
|
18
|
+
fi
|
|
19
|
+
|
|
13
20
|
# Pull latest from git
|
|
14
|
-
if ! git -C "$
|
|
21
|
+
if ! git -C "$karnel_root" pull origin main 2>/dev/null; then
|
|
15
22
|
log_warn "Git pull failed — check your internet connection"
|
|
16
23
|
return 1
|
|
17
24
|
fi
|
|
@@ -62,7 +62,7 @@ voice_main() {
|
|
|
62
62
|
# Parse options before agent
|
|
63
63
|
while [[ $# -gt 0 ]]; do
|
|
64
64
|
case "$1" in
|
|
65
|
-
--lang) lang="$2"; shift 2 ;;
|
|
65
|
+
--lang) lang="${2:-}"; shift 2 ;;
|
|
66
66
|
--raw) skip_edit=true; shift ;;
|
|
67
67
|
--no-clip) no_clip=true; shift ;;
|
|
68
68
|
--help|-h) voice_help; return ;;
|
|
@@ -72,6 +72,7 @@ voice_main() {
|
|
|
72
72
|
done
|
|
73
73
|
|
|
74
74
|
agent="${1:-}"
|
|
75
|
+
[[ -z "$agent" ]] && { voice_help; return; }
|
|
75
76
|
|
|
76
77
|
if [[ -z "$agent" ]] || [[ "$agent" == "--help" ]] || [[ "$agent" == "-h" ]]; then
|
|
77
78
|
voice_help
|
package/karnel/cli/karnel.sh
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
# Importar funciones de log y colores para el help
|
|
4
3
|
import "@/utils/log"
|
|
5
4
|
import "@/utils/colors"
|
|
6
5
|
|
|
@@ -73,9 +72,9 @@ karnel_help() {
|
|
|
73
72
|
printf " ${D_CYAN}%-12s${NC} %s\n" "list" "List available tools in modules"
|
|
74
73
|
printf " ${D_CYAN}%-12s${NC} %s\n" "pg" "PostgreSQL database manager"
|
|
75
74
|
printf " ${D_CYAN}%-12s${NC} %s\n" "status" "Quick system overview"
|
|
76
|
-
printf " ${D_CYAN}%-12s${NC} %s\n" "doctor" "
|
|
77
|
-
printf " ${D_CYAN}%-12s${NC} %s\n" "doctor
|
|
78
|
-
printf " ${D_CYAN}%-12s${NC} %s\n" "
|
|
75
|
+
printf " ${D_CYAN}%-12s${NC} %s\n" "doctor" "Show doctor subcommands"
|
|
76
|
+
printf " ${D_CYAN}%-12s${NC} %s\n" "doctor termux" "Full Termux environment diagnostics"
|
|
77
|
+
printf " ${D_CYAN}%-12s${NC} %s\n" "doctor code" "Analyze project code structure"
|
|
79
78
|
printf " ${D_CYAN}%-12s${NC} %s\n" "upgrade" "Upgrade Karnel framework"
|
|
80
79
|
printf " ${D_CYAN}%-12s${NC} %s\n" "init" "Configure existing projects"
|
|
81
80
|
printf " ${D_CYAN}%-12s${NC} %s\n" "start" "Start services (editor, etc.)"
|
|
@@ -104,6 +103,7 @@ karnel_help() {
|
|
|
104
103
|
printf " ${D_GREEN}%-10s${NC} %s\n" "ui" "Font, Cursor, Extra-keys, Banner"
|
|
105
104
|
printf " ${D_GREEN}%-10s${NC} %s\n" "auto" "Automation Tools (n8n)"
|
|
106
105
|
printf " ${D_GREEN}%-10s${NC} %s\n" "deploy" "Vercel, Railway, Netlify CLIs"
|
|
106
|
+
printf " ${D_GREEN}%-10s${NC} %s\n" "games" "Buzz, CTF God, Detective, Tamagotchi, etc."
|
|
107
107
|
|
|
108
108
|
echo
|
|
109
109
|
separator_section "Help"
|
|
@@ -211,7 +211,7 @@ _tui_main_menu() {
|
|
|
211
211
|
"init" "Project Initializer" \
|
|
212
212
|
"voice" "Speech-to-Agent" \
|
|
213
213
|
"ia" "AI Agent Manager" \
|
|
214
|
-
"doctor" "Run Diagnostics" \
|
|
214
|
+
"doctor" "Run Diagnostics (termux/code)" \
|
|
215
215
|
"cleanup" "Clean caches and temp files" \
|
|
216
216
|
"status" "Quick System Overview" \
|
|
217
217
|
"upgrade" "Upgrade Karnel Framework" \
|
|
@@ -495,6 +495,7 @@ _tui_install_checklist() {
|
|
|
495
495
|
"omni-route" "omniRoute" OFF
|
|
496
496
|
"ctx7" "Context7 Docs" OFF
|
|
497
497
|
"openspec" "OpenSpec SDD" OFF
|
|
498
|
+
"copilot-termux" "Copilot-Termux" OFF
|
|
498
499
|
)
|
|
499
500
|
;;
|
|
500
501
|
dev)
|
|
@@ -518,6 +519,11 @@ _tui_install_checklist() {
|
|
|
518
519
|
"shfmt" "Shfmt" OFF
|
|
519
520
|
"make" "Make" OFF
|
|
520
521
|
"udocker" "Udocker" OFF
|
|
522
|
+
"tmux" "Tmux" OFF
|
|
523
|
+
"openssh" "OpenSSH" OFF
|
|
524
|
+
"snyk" "Snyk" OFF
|
|
525
|
+
"httptmux" "Httptmux" OFF
|
|
526
|
+
"zork" "Zork" OFF
|
|
521
527
|
)
|
|
522
528
|
;;
|
|
523
529
|
shell)
|
package/karnel/tools/ai/all.sh
CHANGED