karnel-termux 4.17.13 → 4.17.20

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 (63) hide show
  1. package/README.md +22 -21
  2. package/docs/ARCHITECTURE/index.md +12 -4
  3. package/docs/CHANGELOG.md +117 -1
  4. package/docs/_config.yml +1 -0
  5. package/docs/_layouts/base.html +1 -7
  6. package/docs/_layouts/default.html +43 -0
  7. package/docs/assets/css/style.scss +15 -49
  8. package/docs/cli/index.md +67 -8
  9. package/docs/index.md +10 -6
  10. package/docs/karnel/ai/index.md +2 -2
  11. package/docs/karnel/auto/index.md +2 -2
  12. package/docs/karnel/db/index.md +2 -2
  13. package/docs/karnel/deploy/index.md +2 -2
  14. package/docs/karnel/dev/index.md +3 -3
  15. package/docs/karnel/editor/index.md +2 -2
  16. package/docs/karnel/games/index.md +2 -2
  17. package/docs/karnel/lang/index.md +2 -2
  18. package/docs/karnel/network/index.md +2 -2
  19. package/docs/karnel/npm/index.md +2 -2
  20. package/docs/karnel/osint/index.md +2 -2
  21. package/docs/karnel/plugin/index.md +2 -2
  22. package/docs/karnel/security/index.md +3 -3
  23. package/docs/karnel/shell/index.md +2 -2
  24. package/docs/karnel/ui/index.md +2 -2
  25. package/docs/karnel/utils/index.md +2 -2
  26. package/docs/karnel/voice/index.md +2 -2
  27. package/docs/troubleshooting/index.md +4 -2
  28. package/karnel/RELEASE_COMMIT +1 -1
  29. package/karnel/cli/commands/backup.sh +2 -2
  30. package/karnel/cli/commands/brain.sh +4 -4
  31. package/karnel/cli/commands/doctor/code_exec.sh +5 -0
  32. package/karnel/cli/commands/env.sh +6 -0
  33. package/karnel/cli/commands/ia.sh +6 -2
  34. package/karnel/cli/commands/init.sh +47 -34
  35. package/karnel/cli/commands/list.sh +1 -0
  36. package/karnel/cli/commands/open.sh +4 -0
  37. package/karnel/cli/commands/pg.sh +7 -4
  38. package/karnel/cli/commands/restore.sh +3 -3
  39. package/karnel/cli/commands/search.sh +2 -2
  40. package/karnel/cli/commands/supabase.sh +4 -1
  41. package/karnel/cli/commands/voice.sh +3 -3
  42. package/karnel/modules/shell.sh +3 -1
  43. package/karnel/tools/ai/cactus/install.sh +1 -1
  44. package/karnel/tools/ai/cline/install.sh +54 -6
  45. package/karnel/tools/ai/crush/install.sh +1 -1
  46. package/karnel/tools/ai/droid/install.sh +10 -10
  47. package/karnel/tools/ai/keelcode/install.sh +54 -6
  48. package/karnel/tools/ai/kilocode-cli/install.sh +54 -6
  49. package/karnel/tools/ai/kimchi-code/install.sh +16 -14
  50. package/karnel/tools/ai/kiro/install.sh +54 -6
  51. package/karnel/tools/ai/oh-my-pi/install.sh +14 -14
  52. package/karnel/tools/deploy/supabase/install.sh +54 -6
  53. package/karnel/tools/lang/bun/install.sh +6 -6
  54. package/karnel/tools/utils/applaunch/applaunch.py +18 -14
  55. package/karnel/tools/utils/passman/passman.py +20 -1
  56. package/karnel/tools/utils/splash/splash.py +10 -2
  57. package/karnel/tools/utils/treex/treex.py +4 -0
  58. package/karnel/tools/utils/zork/install.sh +2 -7
  59. package/karnel/tools/utils/zork/zork.sh +29 -5
  60. package/karnel/utils/agent_actions.sh +40 -16
  61. package/karnel/utils/agent_llm.sh +9 -9
  62. package/karnel/utils/tools.sh +6 -0
  63. package/package.json +1 -1
@@ -11,7 +11,7 @@ Databases such as PostgreSQL, MongoDB, Redis and companions.
11
11
 
12
12
  | `db` | `--postgresql`, `--mariadb`, `--sqlite`, `--mongodb`, `--redis` |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#db) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#db) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/db.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ Deploy CLIs (Railway, Netlify, Vercel, Supabase).
11
11
 
12
12
  | `deploy` | `--vercel`, `--railway`, `--netlify`, `--supabase` |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#deploy) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#deploy) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/deploy.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -6,12 +6,12 @@ layout: base
6
6
 
7
7
  # Dev module
8
8
 
9
- General development utilities (fzf, bat, make, proot-distro, tmux, and more).
9
+ General development utilities (fzf, bat, make, proot, tmux, and more).
10
10
  ## Install
11
11
 
12
12
  | `dev` | `--gh`, `--wget`, `--curl`, `--lsd`, `--bat`, `--proot`, `--ncurses`, `--tmate`, `--openssh`, `--tmux`, `--cloudflared`, `--translate`, `--html2text`, `--jq`, `--bc`, `--tree`, `--fzf`, `--imagemagick`, `--shfmt`, `--make`, `--udocker`, `--snyk` |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#dev) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#dev) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/dev.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ Terminal and browser-based editors (code-server, Neovim, and more).
11
11
 
12
12
  | `editor` | `--code-server`, `--neovim`, `--nvchad` |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#editor) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#editor) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/editor.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ Terminal games to relax between sessions.
11
11
 
12
12
  | `games` | `--buzz`, `--ctfgod`, `--detective`, `--pet-friends`, `--tamagotchi`, `--arcade` |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#games) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#games) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/games.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ Programming-language runtimes (Python, Node.js, Rust, Go, and more).
11
11
 
12
12
  | `lang` | `--bun`, `--nodejs`, `--python`, `--perl`, `--php`, `--rust`, `--clang`, `--golang` |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#lang) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#lang) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/lang.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ Network utilities (dark, dedsec-network).
11
11
 
12
12
  | `network` | `--dark`, `--dedsec-network` |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#network) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#network) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/network.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ Node.js packages and JavaScript tooling.
11
11
 
12
12
  | `npm` | `--typescript`, `--nestjs`, `--prettier`, `--live-server`, `--localtunnel`, `--vercel`, `--markserv`, `--psqlformat`, `--ncu`, `--ngrok`, `--turbopack` |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#npm) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#npm) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/npm.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ OSINT tooling, centered on Robin.
11
11
 
12
12
  | `osint` | Robin OSINT |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#osint) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#osint) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/osint.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ The plugin system and manager.
11
11
 
12
12
  | `plugin` | Plugin system |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#plugin) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#plugin) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/plugin.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -6,12 +6,12 @@ layout: base
6
6
 
7
7
  # Security module
8
8
 
9
- Security and pentest tooling (30+ tools).
9
+ Security and pentest tooling (30 tools).
10
10
  ## Install
11
11
 
12
12
  | `security` | Security tools |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#security) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#security) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/security.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ Shell enhancements (ZSH, Oh My Zsh, zoxide).
11
11
 
12
12
  | `shell` | `--powerlevel10k`, `--zsh-defer`, `--zsh-autosuggestions`, `--zsh-syntax-highlighting`, `--history-substring`, `--zsh-completions`, `--fzf-tab`, `--you-should-use`, `--zsh-autopair`, `--better-npm` |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#shell) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#shell) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/shell.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ Termux UI components.
11
11
 
12
12
  | `ui` | `--font`, `--extra-keys`, `--cursor`, `--banner` |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#ui) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#ui) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/ui.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -15,7 +15,7 @@ and tracked with Karnel ownership markers so `karnel uninstall utils --herdr` is
15
15
 
16
16
  | `utils` | `--fconv`, `--filecheck`, `--websites`, `--notes`, `--treex`, `--passman`, `--applaunch`, `--splash`, `--httptmux`, `--zork`, `--qrcode`, `--superfile`, `--herdr` |
17
17
 
18
- See the [CLI reference]({ '/cli/' | relative_url }#utils) for the full command list, or the
18
+ See the [CLI reference]({{ '/cli/' | relative_url }}#utils) for the full command list, or the
19
19
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/utils.sh).
20
20
 
21
- [← Back to docs]({ '/' | relative_url })
21
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -11,7 +11,7 @@ Voice commands for AI agents.
11
11
 
12
12
  | `voice` | Voice command |
13
13
 
14
- See the [CLI reference]({ '/cli/' | relative_url }#voice) for the full command list, or the
14
+ See the [CLI reference]({{ '/cli/' | relative_url }}#voice) for the full command list, or the
15
15
  [source on GitHub](https://github.com/israelmarques1024-dotcom/karnel-termux/tree/main/karnel/modules/voice.sh).
16
16
 
17
- [← Back to docs]({ '/' | relative_url })
17
+ [← Back to docs]({{ '/' | relative_url }}) · [CLI reference]({{ '/cli/' | relative_url }})
@@ -24,8 +24,10 @@ npm/pnpm installs.
24
24
  | `All update methods failed` | Every fallback failed. Check network, the Git checkout state, and npm connectivity. |
25
25
  | Update stays on the same version | Old releases (`v4.13.3`, `v4.13.4`) do not ship installer assets, so the curl path falls back to git. A release that includes the installer assets enables the verified curl path. |
26
26
 
27
- Logs: `$KARNEL_CACHE/install_dev.log` (GitHub/installer) and
28
- `$KARNEL_CACHE/install_npm.log` (npm).
27
+ The updater prints its progress to the terminal only; it does not write log
28
+ files. For module installs, `karnel install dev` logs to
29
+ `$KARNEL_CACHE/install_dev.log` and `karnel install npm` logs to
30
+ `$KARNEL_CACHE/install_npm.log`.
29
31
 
30
32
  ## npm publishing
31
33
 
@@ -1 +1 @@
1
- 3d9d862c0be40df2c3f17648f56bf83ef74507b7
1
+ 4d6f527bfdc17d468eee7881aca77083528e7961
@@ -61,7 +61,7 @@ backup_run() {
61
61
  echo
62
62
 
63
63
  local tmp archive_tmp checksum_tmp
64
- tmp=$(mktemp -d) || { _backup_release_output; return 1; }
64
+ tmp=$(mktemp -d "${TMPDIR:-${KARNEL_CACHE:-$HOME/.cache/karnel}}/karnel-XXXXXX") || { _backup_release_output; return 1; }
65
65
  archive_tmp="$BACKUP_DIR/.$(basename "$file").$$.tmp"
66
66
  checksum_tmp="$archive_tmp.sha256"
67
67
  if ! _backup_collect_payload "$tmp"; then
@@ -130,7 +130,7 @@ backup_snapshot() {
130
130
  echo
131
131
 
132
132
  local tmp archive_tmp checksum_tmp checksum
133
- tmp=$(mktemp -d) || { _backup_release_output; return 1; }
133
+ tmp=$(mktemp -d "${TMPDIR:-${KARNEL_CACHE:-$HOME/.cache/karnel}}/karnel-XXXXXX") || { _backup_release_output; return 1; }
134
134
  archive_tmp="$BACKUP_DIR/.$(basename "$file").$$.tmp"
135
135
  checksum_tmp="$archive_tmp.sha256"
136
136
  if ! _backup_collect_payload "$tmp" ||
@@ -142,7 +142,7 @@ _brain_update_related() {
142
142
  if grep -q "^related:" "$tmp" 2>/dev/null; then
143
143
  sed -i "s/^related: \[\(.*\)\]/related: [\1, $escaped]/" "$tmp"
144
144
  else
145
- sed -i "/^---$/a related: [$slug]" "$tmp"
145
+ sed -i "/^---$/a related: [$escaped]" "$tmp"
146
146
  fi
147
147
  tail -n +$((frontmatter_end)) "$file" >>"$tmp"
148
148
  mv "$tmp" "$file"
@@ -230,7 +230,7 @@ _brain_editor() {
230
230
  fi
231
231
 
232
232
  local tmpfile
233
- tmpfile=$(mktemp)
233
+ tmpfile=$(mktemp "${TMPDIR:-${KARNEL_CACHE:-$HOME/.cache/karnel}}/karnel-XXXXXX")
234
234
 
235
235
  echo "# $title" >"$tmpfile"
236
236
  echo >>"$tmpfile"
@@ -1466,7 +1466,7 @@ EOF
1466
1466
 
1467
1467
  if command -v jq &>/dev/null; then
1468
1468
  local temp
1469
- temp=$(mktemp)
1469
+ temp=$(mktemp "${TMPDIR:-${KARNEL_CACHE:-$HOME/.cache/karnel}}/karnel-XXXXXX")
1470
1470
  if [[ "$val" == "true" ]] || [[ "$val" == "false" ]]; then
1471
1471
  jq --argjson v "$val" ".${key} = \$v" "$config_file" > "$temp" && mv "$temp" "$config_file"
1472
1472
  elif [[ "$val" =~ ^[0-9]+$ ]]; then
@@ -1635,7 +1635,7 @@ EOF
1635
1635
  echo
1636
1636
 
1637
1637
  local ai_response_temp
1638
- ai_response_temp=$(mktemp)
1638
+ ai_response_temp=$(mktemp "${TMPDIR:-${KARNEL_CACHE:-$HOME/.cache/karnel}}/karnel-XXXXXX")
1639
1639
 
1640
1640
  if loading "Generating AI response" _run_ai_query "$ai_cmd" "$full_prompt" "$default_model" "$ai_response_temp"; then
1641
1641
  echo
@@ -115,6 +115,11 @@ _exec_apply_fix() {
115
115
  local tool="$1" fix_cmd="$2" lang="$3" file="$4" dir="${5:-$PWD}"
116
116
  local full_cmd; full_cmd="$(_tool_command "$fix_cmd" "$file")"
117
117
 
118
+ # NOTE: fix/check commands come exclusively from the in-repo LANG_TOOLS
119
+ # registry (code_langs.sh); some legitimate fixes are multi-statement
120
+ # loops (e.g. Go gofmt) or contain pipes, so pattern-based "injection"
121
+ # guards here would refuse valid commands. Do not re-add one.
122
+
118
123
  if [[ "$fix_cmd" == *'{}'* && -z "$file" ]]; then
119
124
  log_warn "Cannot fix — no matching file found for $tool"
120
125
  return 1
@@ -86,6 +86,12 @@ env_set() {
86
86
 
87
87
  printf 'export %s=%q\n' "$key" "$value" >>"$rc_file"
88
88
 
89
+ # Secrets stored in a shell rc are world-readable by default; tighten the
90
+ # file's permissions so other local users cannot read them.
91
+ if [[ "$key" =~ (SECRET|TOKEN|KEY|PASSWORD|PASSWD|API_|ACCESS|PRIVATE|CREDENTIAL) ]]; then
92
+ chmod go-rwx "$rc_file" 2>/dev/null || true
93
+ fi
94
+
89
95
  echo
90
96
  log_success "Variable ${D_CYAN}${key}${D_GREEN} set in ${D_NC}$(basename "$rc_file")"
91
97
  list_item "Run: ${D_CYAN}source $(basename "$rc_file")${D_NC} to apply, or restart your terminal"
@@ -22,7 +22,6 @@ ia_help() {
22
22
  separator_section "Examples"
23
23
  echo
24
24
  printf " ${D_CYAN}karnel ia sessions${NC} # Show all AI sessions\n"
25
- printf " ${D_CYAN}karnel ia sessions --all${NC} # Include agent names\n"
26
25
  printf " ${D_CYAN}karnel ia install omni-route${NC} # Install omniRoute\n"
27
26
  printf " ${D_CYAN}karnel ia routes${NC} # Show AI CLI routes\n"
28
27
  printf " ${D_CYAN}karnel list ai${NC} # List installed AI tools\n"
@@ -31,7 +30,12 @@ ia_help() {
31
30
 
32
31
  # List all AI sessions from known tools
33
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.
34
35
  local show_all="${1:-0}"
36
+ if [[ "$show_all" == "--all" ]]; then
37
+ show_all=0
38
+ fi
35
39
 
36
40
  mkdir -p "$IA_SESSIONS_DIR"
37
41
 
@@ -407,7 +411,7 @@ PY
407
411
  # Persist all discovered sessions to IA_SESSIONS_DIR for history
408
412
  local persist_file="$IA_SESSIONS_DIR/.all_sessions.json"
409
413
  local tmp_persist
410
- tmp_persist=$(mktemp)
414
+ tmp_persist=$(mktemp "${TMPDIR:-${KARNEL_CACHE:-$HOME/.cache/karnel}}/karnel-XXXXXX")
411
415
  echo "[" > "$tmp_persist"
412
416
  local first=1
413
417
  for session in "${sessions[@]}"; do
@@ -80,9 +80,8 @@ EOF
80
80
  log_success "Created .prettierrc"
81
81
 
82
82
  log_info "Creating karnel landing page..."
83
- [[ -f "src/app/page.tsx" ]] && cat >src/app/page.tsx <<'EOF'
83
+ [[ -f "src/app/page.tsx" ]] && cat >src/app/page.tsx <<'EOF'
84
84
  "use client"
85
- import { Button } from "@/components/ui/button"
86
85
  import { motion } from "framer-motion"
87
86
  import { Terminal, Code2, Rocket } from "lucide-react"
88
87
  import { Toaster } from "sonner"
@@ -113,9 +112,9 @@ export default function Home() {
113
112
  <div className="p-6 rounded-xl bg-slate-900/50 border border-slate-800"><Terminal className="w-12 h-12 text-pink-400 mb-4 mx-auto" /><h3 className="text-lg font-semibold text-white mb-2">Comunidad Activa</h3></div>
114
113
  </motion.div>
115
114
  <motion.div initial={{ opacity: 0, scale: 0.8 }} animate={{ opacity: 1, scale: 1 }} transition={{ delay: 0.7 }} className="w-full max-w-sm mx-auto">
116
- <Button size="lg" onClick={() => window.open("mailto:israelmarques1024@gmail.com", "_blank")} className="w-full bg-gradient-to-r from-blue-500 to-purple-600 hover:from-blue-600 hover:to-purple-700 text-white px-8 py-6 text-lg font-semibold">
117
- <Rocket className="w-5 h-5 mr-2" /> Contato: israelmarques1024@gmail.com
118
- </Button>
115
+ <button type="button" onClick={() => window.open("mailto:israelmarques1024@gmail.com", "_blank")} className="w-full rounded-md bg-gradient-to-r from-blue-500 to-purple-600 px-8 py-6 text-lg font-semibold text-white hover:from-blue-600 hover:to-purple-700">
116
+ <Rocket className="w-5 h-5 mr-2" /> Contato: israelmarques1024@gmail.com
117
+ </button>
119
118
  </motion.div>
120
119
  <motion.p initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ delay: 0.8 }} className="mt-16 text-sm text-slate-600">Built with ❤️ using karnel tools</motion.p>
121
120
  </motion.div>
@@ -132,7 +131,7 @@ EOF
132
131
  log_warn "jq not found — skipping package.json update"
133
132
  else
134
133
  local temp
135
- temp=$(mktemp)
134
+ temp=$(mktemp "${TMPDIR:-${KARNEL_CACHE:-$HOME/.cache/karnel}}/karnel-XXXXXX")
136
135
  jq '.scripts.dev = "next dev --webpack" | .scripts.build = "next build --webpack" | .scripts.start = "next start"' package.json > "$temp" && mv "$temp" package.json
137
136
  log_success "Added --webpack flag to dev and build scripts"
138
137
  fi
@@ -296,7 +295,7 @@ EOF
296
295
  }
297
296
 
298
297
  _install_react_deps() {
299
- npm install axios lucide-react framer-motion sonner zod react-hook-form @hookform/resolvers @tanstack/react-query zustand tailwindcss &>"$LOG_FILE"
298
+ npm install axios lucide-react framer-motion sonner zod react-hook-form @hookform/resolvers @tanstack/react-query zustand tailwindcss clsx tailwind-merge &>"$LOG_FILE"
300
299
  npm install -D prettier prettier-plugin-tailwindcss &>>"$LOG_FILE"
301
300
  }
302
301
 
@@ -431,8 +430,6 @@ EOF
431
430
  import "reflect-metadata";
432
431
  import { DataSource } from "typeorm";
433
432
  import { DATABASE_URL, NODE_ENV } from "@/config/env";
434
- import { ExampleEntity1 } from "@/entities/ExampleEntity1";
435
- import { ExampleEntity2 } from "@/entities/ExampleEntity2";
436
433
 
437
434
  const isDevelopment = NODE_ENV === "development";
438
435
  const isProduction = NODE_ENV === "production";
@@ -440,10 +437,10 @@ const isProduction = NODE_ENV === "production";
440
437
  export const AppDataSource = new DataSource({
441
438
  type: "postgres",
442
439
  url: DATABASE_URL,
443
- ssl: isDevelopment ? false : { rejectUnauthorized: false },
440
+ ssl: isDevelopment ? false : { rejectUnauthorized: true },
444
441
  synchronize: isDevelopment,
445
442
  logging: isDevelopment ? ["query", "error"] : false,
446
- entities: [ExampleEntity1, ExampleEntity2],
443
+ entities: [],
447
444
  migrations: isDevelopment
448
445
  ? [__dirname + "/migrations/*.ts"]
449
446
  : [__dirname + "/migrations/*.js"],
@@ -463,8 +460,6 @@ import morgan from "morgan";
463
460
  import cors from "cors";
464
461
  import cookieParser from "cookie-parser";
465
462
  import { FRONTEND_URL } from "@/config/env";
466
- import exampleRoutes1 from "@/routes/example1.routes";
467
- import exampleRoutes2 from "@/routes/example2.routes";
468
463
 
469
464
  const app = express();
470
465
 
@@ -497,10 +492,6 @@ app.use(express.json());
497
492
  // manejar cookies
498
493
  app.use(cookieParser());
499
494
 
500
- // endpoints
501
- app.use("/api/example1", exampleRoutes1);
502
- app.use("/api/example2", exampleRoutes2);
503
-
504
495
  export default app;
505
496
  EOF
506
497
  log_success "Created src/app.ts"
@@ -533,7 +524,7 @@ EOF
533
524
  log_warn "jq not found — skipping package.json update"
534
525
  else
535
526
  local temp
536
- temp=$(mktemp)
527
+ temp=$(mktemp "${TMPDIR:-${KARNEL_CACHE:-$HOME/.cache/karnel}}/karnel-XXXXXX")
537
528
  jq '.scripts += {
538
529
  "dev": "ts-node-dev --require tsconfig-paths/register --env-file=.env --respawn src/index.ts",
539
530
  "build": "tsc && tsc-alias -p tsconfig.json",
@@ -854,6 +845,12 @@ configure_go() {
854
845
  go mod init "$mod_name" 2>/dev/null || go mod init project
855
846
  log_success "Created go.mod"
856
847
  fi
848
+ local go_module
849
+ go_module=$(awk '$1 == "module" { print $2; exit }' go.mod)
850
+ if [[ -z "$go_module" ]]; then
851
+ log_error "Unable to determine Go module name from go.mod"
852
+ return 1
853
+ fi
857
854
 
858
855
  log_info "Creating folder structure..."
859
856
  mkdir -p cmd/api internal/config internal/db internal/handlers internal/models scripts 2>/dev/null
@@ -888,14 +885,14 @@ EOF
888
885
 
889
886
  # Create main.go based on framework
890
887
  if [[ "$framework_choice" == "Gin" ]]; then
891
- cat >cmd/api/main.go <<'EOF'
888
+ cat >cmd/api/main.go <<EOF
892
889
  package main
893
890
 
894
891
  import (
895
892
  "fmt"
896
893
  "net/http"
897
- "project/internal/config"
898
- "project/internal/handlers"
894
+ "$go_module/internal/config"
895
+ "$go_module/internal/handlers"
899
896
  "github.com/gin-gonic/gin"
900
897
  )
901
898
 
@@ -917,13 +914,13 @@ func main() {
917
914
  }
918
915
  EOF
919
916
  else
920
- cat >cmd/api/main.go <<'EOF'
917
+ cat >cmd/api/main.go <<EOF
921
918
  package main
922
919
 
923
920
  import (
924
921
  "fmt"
925
- "project/internal/config"
926
- "project/internal/handlers"
922
+ "$go_module/internal/config"
923
+ "$go_module/internal/handlers"
927
924
  "github.com/gofiber/fiber/v2"
928
925
  )
929
926
 
@@ -1107,6 +1104,12 @@ configure_rust() {
1107
1104
  done
1108
1105
  log_success "Configured Cargo.toml"
1109
1106
  fi
1107
+ local rust_binary
1108
+ rust_binary=$(awk -F '"' '/^name[[:space:]]*=/ { print $2; exit }' Cargo.toml)
1109
+ if [[ -z "$rust_binary" ]]; then
1110
+ log_error "Unable to determine Rust package name from Cargo.toml"
1111
+ return 1
1112
+ fi
1110
1113
 
1111
1114
  # Create src/main.rs
1112
1115
  mkdir -p src scripts 2>/dev/null
@@ -1197,7 +1200,7 @@ EOF
1197
1200
  chmod +x scripts/run.sh
1198
1201
 
1199
1202
  # Create Dockerfile
1200
- cat >Dockerfile <<'EOF'
1203
+ cat >Dockerfile <<EOF
1201
1204
  FROM rust:1.70 AS builder
1202
1205
  WORKDIR /app
1203
1206
  COPY . .
@@ -1205,9 +1208,9 @@ RUN cargo build --release
1205
1208
 
1206
1209
  FROM debian:bullseye-slim
1207
1210
  WORKDIR /app
1208
- COPY --from=builder /app/target/release/project .
1211
+ COPY --from=builder /app/target/release/$rust_binary .
1209
1212
  EXPOSE 3000
1210
- CMD ["./project"]
1213
+ CMD ["./$rust_binary"]
1211
1214
  EOF
1212
1215
  log_success "Created Dockerfile"
1213
1216
 
@@ -1230,6 +1233,15 @@ EOF
1230
1233
  echo
1231
1234
  }
1232
1235
 
1236
+ _init_confirm_overwrite() {
1237
+ local confirm
1238
+ read_confirm "Karnel may overwrite existing project files. Continue?" confirm
1239
+ if [[ "$confirm" != "y" ]]; then
1240
+ log_warn "Cancelled"
1241
+ return 1
1242
+ fi
1243
+ }
1244
+
1233
1245
  # ===== MAIN =====
1234
1246
  init_main() {
1235
1247
  local template="$1"
@@ -1239,19 +1251,20 @@ init_main() {
1239
1251
  init_help
1240
1252
  return
1241
1253
  ;;
1242
- next | nextjs) configure_next ;;
1243
- react | vite) configure_react ;;
1244
- nest | nestjs) configure_nest ;;
1245
- express | exp) configure_express ;;
1246
- python | fastapi) configure_python ;;
1247
- go | gin) configure_go ;;
1248
- rust | axum) configure_rust ;;
1254
+ next | nextjs) _init_confirm_overwrite || return 0; configure_next ;;
1255
+ react | vite) _init_confirm_overwrite || return 0; configure_react ;;
1256
+ nest | nestjs) _init_confirm_overwrite || return 0; configure_nest ;;
1257
+ express | exp) _init_confirm_overwrite || return 0; configure_express ;;
1258
+ python | fastapi) _init_confirm_overwrite || return 0; configure_python ;;
1259
+ go | gin) _init_confirm_overwrite || return 0; configure_go ;;
1260
+ rust | axum) _init_confirm_overwrite || return 0; configure_rust ;;
1249
1261
  "")
1250
1262
  local detected
1251
1263
  detected=$(detect_project_type)
1252
1264
  if [[ "$detected" != "unknown" ]]; then
1253
1265
  log_info "Detected project type: $detected"
1254
1266
  echo
1267
+ _init_confirm_overwrite || return 0
1255
1268
  case "$detected" in
1256
1269
  next) configure_next ;;
1257
1270
  react) configure_react ;;
@@ -461,6 +461,7 @@ _list_utils() {
461
461
  table_row "Zork (text adventure)" "--zork" "zork" "$(_check_cmd "zork")"
462
462
  table_row "QR Code Generator" "--qrcode" "qrcode" "$(_check_cmd "qrcode")"
463
463
  table_row "SuperFile" "--superfile" "spf" "$(_check_cmd "spf")"
464
+ table_row "Herdr (AI assistant)" "--herdr" "herdr" "$(_check_cmd "herdr")"
464
465
  table_end
465
466
 
466
467
  echo
@@ -21,6 +21,9 @@ open_main() {
21
21
  herdr)
22
22
  url="$OPEN_DOCS/karnel/utils"
23
23
  ;;
24
+ robin)
25
+ url="$OPEN_DOCS/karnel/osint"
26
+ ;;
24
27
  supabase)
25
28
  url="$OPEN_DOCS/karnel/deploy"
26
29
  ;;
@@ -95,6 +98,7 @@ open_help() {
95
98
  printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "utils" "Utility tools"
96
99
  printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "voice" "Voice command"
97
100
  printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "osint" "OSINT tools"
101
+ printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "robin" "Robin OSINT service"
98
102
  printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "plugin" "Plugin system"
99
103
  printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "security" "Security tools"
100
104
  printf " ${D_GREEN}%-14s${NC} ${D_DIM}%s${NC}\n" "herdr" "Herdr terminal AI assistant"
@@ -209,6 +209,7 @@ pg_stop() {
209
209
  log_success "PostgreSQL stopped successfully"
210
210
  else
211
211
  log_warn "PostgreSQL may not be running or failed to stop"
212
+ return 1
212
213
  fi
213
214
 
214
215
  echo
@@ -230,11 +231,11 @@ pg_restart() {
230
231
  pg_init || return 1
231
232
  sleep 1
232
233
  else
233
- pg_stop
234
+ pg_stop || return 1
234
235
  sleep 1
235
236
  fi
236
237
 
237
- pg_start
238
+ pg_start || return 1
238
239
 
239
240
  echo
240
241
  separator
@@ -466,7 +467,7 @@ _run_restore_cmd() {
466
467
  local file_path="$2"
467
468
  local _rs_ret=0
468
469
  set -o pipefail
469
- gunzip -c "$file_path" | pg_restore -d "$db_name" -c 2>/dev/null || _rs_ret=$?
470
+ gunzip -c "$file_path" | pg_restore -d "$db_name" -c 2>>"${KARNEL_CACHE:-$HOME/.cache/karnel}/karnel-pg.log" || _rs_ret=$?
470
471
  set +o pipefail
471
472
  return $_rs_ret
472
473
  }
@@ -755,8 +756,10 @@ pg_schedule() {
755
756
  list_item "Ensure cron daemon is running (run: 'crond')"
756
757
  else
757
758
  log_error "Failed to schedule backup for database '$db_name'"
759
+ rm -f "$tmpcron"
760
+ return 1
758
761
  fi
759
762
  rm -f "$tmpcron"
760
763
  fi
761
764
  echo
762
- }
765
+ }
@@ -114,10 +114,10 @@ restore_main() {
114
114
  log_success "Checksum verified"
115
115
 
116
116
  local tmp transaction
117
- tmp=$(mktemp -d) || return 1
118
- if ! tar -xzf "$file" -C "$tmp" --no-same-owner --no-same-permissions 2>/dev/null; then
117
+ tmp=$(mktemp -d "${TMPDIR:-${KARNEL_CACHE:-$HOME/.cache/karnel}}/karnel-XXXXXX") || return 1
118
+ if ! tar -xzf "$file" -C "$tmp" --no-same-owner --no-same-permissions 2>"$tmp/extract.err"; then
119
+ log_error "Failed to extract backup: $(cat "$tmp/extract.err" 2>/dev/null)"
119
120
  rm -rf "$tmp"
120
- log_error "Failed to extract backup"
121
121
  return 1
122
122
  fi
123
123
  local pkgs="$tmp/metadata/packages.list"
@@ -31,7 +31,7 @@ search_main() {
31
31
  local id name
32
32
  id=$(echo "$line" | cut -d: -f1 | tr -d '"' | xargs)
33
33
  name=$(echo "$line" | cut -d: -f2 | tr -d '"' | xargs)
34
- if echo "$id $name" | grep -qi "$query"; then
34
+ if printf '%s\n' "$id $name" | grep -Fqi -- "$query"; then
35
35
  list_item "${D_CYAN}$mod${NC}: $name ($id)"
36
36
  any_found=true
37
37
  fi
@@ -51,7 +51,7 @@ search_main() {
51
51
  title=$(head -1 "$file" 2>/dev/null | sed 's/^# //')
52
52
  list_item "${D_CYAN}$(basename "$file")${NC}: ${title:-$file}"
53
53
  any_found=true
54
- done < <(grep -ril "$query" "$KARNEL_DATA/brain" 2>/dev/null)
54
+ done < <(grep -rFil -- "$query" "$KARNEL_DATA/brain" 2>/dev/null)
55
55
  if ! $any_found; then
56
56
  log_info "No memories found matching '$query'"
57
57
  fi
@@ -219,7 +219,10 @@ supabase_remote_status() {
219
219
  log_error "Supabase CLI not installed"
220
220
  return 1
221
221
  fi
222
- supabase_safe status 2>/dev/null || log_warn "Unable to check Supabase status"
222
+ supabase_safe status 2>/dev/null || {
223
+ log_warn "Unable to check Supabase status"
224
+ return 1
225
+ }
223
226
  }
224
227
 
225
228
  supabase_link() {