karnel-termux 0.0.4 → 4.7.6

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 (46) hide show
  1. package/README.md +7 -9
  2. package/install.sh +9 -0
  3. package/karnel/bin/karnel +1 -1
  4. package/karnel/cli/commands/backup.sh +100 -0
  5. package/karnel/cli/commands/doctor/fixes.sh +310 -0
  6. package/karnel/cli/commands/doctor/system.sh +87 -0
  7. package/karnel/cli/commands/doctor.sh +7 -308
  8. package/karnel/cli/commands/install.sh +21 -2
  9. package/karnel/cli/commands/list.sh +5 -0
  10. package/karnel/cli/commands/reinstall.sh +5 -1
  11. package/karnel/cli/commands/restore.sh +83 -0
  12. package/karnel/cli/commands/search.sh +62 -0
  13. package/karnel/cli/commands/show.sh +102 -38
  14. package/karnel/cli/commands/uninstall.sh +3 -551
  15. package/karnel/cli/commands/update.sh +3 -551
  16. package/karnel/cli/karnel.sh +5 -0
  17. package/karnel/modules/db.sh +2 -0
  18. package/karnel/modules/dev.sh +9 -3
  19. package/karnel/tools/ai/antigravity-cli/bin/agy +1 -1
  20. package/karnel/tools/ai/claude-code/bin/claude +1 -1
  21. package/karnel/tools/ai/codegraph/bin/codegraph +1 -1
  22. package/karnel/tools/ai/freebuff/bin/freebuff +1 -1
  23. package/karnel/tools/ai/kilocode-cli/bin/kilocode +1 -1
  24. package/karnel/tools/ai/kilocode-cli/install.sh +1 -1
  25. package/karnel/tools/ai/kimchi-code/bin/kimchi +1 -1
  26. package/karnel/tools/ai/mimocode/bin/mimo +1 -1
  27. package/karnel/tools/ai/omni-route/README.md +17 -15
  28. package/karnel/tools/ai/opencode/bin/opencode +1 -1
  29. package/karnel/tools/db/redis/install.sh +1 -1
  30. package/karnel/tools/dev/all.sh +3 -0
  31. package/karnel/tools/dev/httptmux/install.sh +75 -0
  32. package/karnel/tools/dev/openssh/install.sh +1 -1
  33. package/karnel/tools/dev/snyk/install.sh +75 -0
  34. package/karnel/tools/dev/tmux/install.sh +1 -1
  35. package/karnel/tools/dev/zork/install.sh +133 -0
  36. package/karnel/tools/editor/neovim/install.sh +1 -1
  37. package/karnel/tools/editor/nvchad/install.sh +1 -1
  38. package/karnel/tools/npm/turbopack/bin/next-turbopack +1 -1
  39. package/karnel/tools/npm/turbopack/bin/node-glibc.sh +1 -1
  40. package/karnel/utils/env.sh +1 -1
  41. package/karnel/utils/log.sh +70 -0
  42. package/karnel/utils/tools.sh +34 -0
  43. package/karnel/utils/version.sh +1 -1
  44. package/package.json +1 -1
  45. package/scripts/completion.bash +28 -0
  46. package/scripts/completion.zsh +90 -0
@@ -12,14 +12,16 @@ show_main() {
12
12
  echo
13
13
  log_info "Display help information for a specific tool."
14
14
  echo
15
- log_info "Available targets:"
16
- echo
17
- list_item "karnel show ai --opencode"
18
- list_item "karnel show ai --ollama"
19
- list_item "karnel show db --postgresql"
20
- list_item "karnel show dev --gh"
21
- list_item "karnel show npm --typescript"
22
- list_item "karnel show all --<tool>"
15
+ log_info "Available targets:"
16
+ echo
17
+ list_item "karnel show ai --opencode"
18
+ list_item "karnel show ai --ollama"
19
+ list_item "karnel show db --postgresql"
20
+ list_item "karnel show dev --gh"
21
+ list_item "karnel show npm --typescript"
22
+ list_item "karnel show backup Show backup docs"
23
+ list_item "karnel show restore Show restore docs"
24
+ list_item "karnel show all --<tool>"
23
25
  echo
24
26
  log_info "Run ${D_CYAN}karnel list <module>${NC} to see available tools"
25
27
  echo
@@ -42,35 +44,45 @@ show_main() {
42
44
  return 1
43
45
  fi
44
46
 
45
- if [[ -z "$tool" ]]; then
46
- separator_section "$module - Available Tools"
47
- echo
48
- local tool_dir="$KARNEL_PATH/tools/$module"
49
- if [[ ! -d "$tool_dir" ]]; then
50
- log_error "Unknown module: $module"
51
- return 1
52
- fi
53
- for t in "$tool_dir"/*/; do
54
- local name="${t%/}"
55
- name="${name##*/}"
56
- if [[ -f "$tool_dir/$name/README.md" ]]; then
57
- local first_line
58
- first_line=$(head -1 "$tool_dir/$name/README.md" 2>/dev/null)
59
- printf " ${D_CYAN}%-16s${NC} %s\n" "$name" "${first_line#\# }"
60
- fi
61
- done
62
- echo
63
- log_info "Run ${D_CYAN}karnel show $module --<tool>${NC} for details"
64
- echo
65
- return
66
- fi
47
+ if [[ "$module" == "backup" ]]; then
48
+ _show_backup_docs "$tool"
49
+ return
50
+ fi
67
51
 
68
- local readme_path="$KARNEL_PATH/tools/$module/$tool/README.md"
52
+ if [[ "$module" == "restore" ]]; then
53
+ _show_restore_docs "$tool"
54
+ return
55
+ fi
69
56
 
70
- if [[ ! -f "$readme_path" ]]; then
71
- log_error "No documentation found for $module/$tool"
72
- return 1
73
- fi
57
+ if [[ -z "$tool" ]]; then
58
+ separator_section "$module - Available Tools"
59
+ echo
60
+ local tool_dir="$KARNEL_PATH/tools/$module"
61
+ if [[ ! -d "$tool_dir" ]]; then
62
+ log_error "Unknown module: $module"
63
+ return 1
64
+ fi
65
+ for t in "$tool_dir"/*/; do
66
+ local name="${t%/}"
67
+ name="${name##*/}"
68
+ if [[ -f "$tool_dir/$name/README.md" ]]; then
69
+ local first_line
70
+ first_line=$(head -1 "$tool_dir/$name/README.md" 2>/dev/null)
71
+ printf " ${D_CYAN}%-16s${NC} %s\n" "$name" "${first_line#\# }"
72
+ fi
73
+ done
74
+ echo
75
+ log_info "Run ${D_CYAN}karnel show $module --<tool>${NC} for details"
76
+ echo
77
+ return
78
+ fi
79
+
80
+ local readme_path="$KARNEL_PATH/tools/$module/$tool/README.md"
81
+
82
+ if [[ ! -f "$readme_path" ]]; then
83
+ log_error "No documentation found for $module/$tool"
84
+ return 1
85
+ fi
74
86
 
75
87
  separator_section "$tool ($module)"
76
88
 
@@ -84,7 +96,59 @@ show_main() {
84
96
  cat "$readme_path"
85
97
  fi
86
98
 
87
- echo
88
- separator
89
- echo
99
+ echo
100
+ separator
101
+ echo
102
+ }
103
+
104
+ _show_backup_docs() {
105
+ local tool="$1"
106
+ if [[ -n "$tool" ]]; then
107
+ separator_section "backup ($tool)"
108
+ echo
109
+ log_warn "backup is a CLI command, not a tool module"
110
+ echo
111
+ return
112
+ fi
113
+
114
+ separator_section "backup - Full Termux Backup"
115
+ echo
116
+ list_item "karnel backup Salva tudo (configs + pacotes + tools)"
117
+ list_item "karnel backup --cloud Salva + upload Google Drive"
118
+ echo
119
+ log_info "O backup inclui:"
120
+ list_item "Lista de todos os pacotes (dpkg --get-selections)"
121
+ list_item "Manifest das ferramentas Karnel instaladas"
122
+ list_item "Configs do shell (.bashrc, .zshrc, .profile)"
123
+ list_item "Configurações do Termux (fontes, cores, propriedades)"
124
+ list_item "Chaves SSH"
125
+ list_item "Configs de apps (~/.config)"
126
+ list_item "Repositórios APT"
127
+ echo
128
+ log_info "Cloud: usa rclone (open-source) — Google Drive, Dropbox, etc."
129
+ list_item "Configure: rclone config (nomeie o remote como 'karnel')"
130
+ echo
131
+ }
132
+
133
+ _show_restore_docs() {
134
+ local tool="$1"
135
+ if [[ -n "$tool" ]]; then
136
+ separator_section "restore ($tool)"
137
+ echo
138
+ log_warn "restore is a CLI command, not a tool module"
139
+ echo
140
+ return
141
+ fi
142
+
143
+ separator_section "restore - Full Termux Restore"
144
+ echo
145
+ list_item "karnel restore Restaura o backup mais recente"
146
+ list_item "karnel restore <arquivo> Restaura um arquivo específico"
147
+ list_item "karnel restore --cloud Restaura do Google Drive"
148
+ echo
149
+ log_info "O restore:"
150
+ list_item "Extrai configs para ~/"
151
+ list_item "Restaura lista de pacotes (dpkg)"
152
+ list_item "Reinstala ferramentas Karnel"
153
+ echo
90
154
  }