karnel-termux 4.17.5 → 4.17.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.
Files changed (51) hide show
  1. package/README.md +16 -16
  2. package/docs/{ARCHITECTURE.md → ARCHITECTURE/index.md} +15 -9
  3. package/docs/_config.yml +13 -0
  4. package/docs/assets/css/style.css +205 -0
  5. package/docs/assets/images/karnel-logo.png +0 -0
  6. package/docs/cli/{README.md → index.md} +43 -4
  7. package/docs/index.md +43 -0
  8. package/karnel/RELEASE_COMMIT +1 -1
  9. package/karnel/cli/commands/agent.sh +5 -6
  10. package/karnel/cli/commands/brain.sh +7 -5
  11. package/karnel/cli/commands/env.sh +8 -6
  12. package/karnel/cli/commands/install.sh +0 -566
  13. package/karnel/cli/commands/pg.sh +24 -17
  14. package/karnel/modules/shell.sh +35 -12
  15. package/karnel/tools/ai/all.sh +1 -1
  16. package/karnel/tools/ai/droid/install.sh +4 -2
  17. package/karnel/tools/ai/keelcode/install.sh +13 -2
  18. package/karnel/tools/ai/kilocode-cli/install.sh +8 -1
  19. package/karnel/tools/ai/kimchi-code/install.sh +4 -2
  20. package/karnel/tools/ai/oh-my-pi/install.sh +6 -3
  21. package/karnel/tools/db/mongodb/install.sh +3 -0
  22. package/karnel/tools/deploy/netlify/install.sh +42 -19
  23. package/karnel/tools/deploy/railway/install.sh +2 -1
  24. package/karnel/tools/deploy/supabase/install.sh +6 -1
  25. package/karnel/tools/deploy/vercel/install.sh +30 -11
  26. package/karnel/tools/dev/fzf/install.sh +4 -2
  27. package/karnel/tools/editor/code-server/install.sh +20 -8
  28. package/karnel/tools/editor/nvchad/install.sh +1 -1
  29. package/karnel/tools/lang/bun/install.sh +1 -1
  30. package/karnel/tools/lang/rust/install.sh +1 -1
  31. package/karnel/tools/npm/live-server/install.sh +4 -3
  32. package/karnel/tools/npm/localtunnel/install.sh +4 -3
  33. package/karnel/tools/npm/markserv/install.sh +4 -3
  34. package/karnel/tools/npm/ncu/install.sh +4 -3
  35. package/karnel/tools/npm/nestjs/install.sh +4 -3
  36. package/karnel/tools/npm/ngrok/install.sh +4 -3
  37. package/karnel/tools/npm/prettier/install.sh +4 -3
  38. package/karnel/tools/npm/psqlformat/install.sh +4 -3
  39. package/karnel/tools/npm/typescript/install.sh +4 -3
  40. package/karnel/tools/npm/vercel/install.sh +4 -3
  41. package/karnel/tools/voice/uninstall.sh +10 -1
  42. package/karnel/utils/agent_actions.sh +11 -6
  43. package/karnel/utils/agent_llm.sh +2 -2
  44. package/karnel/utils/install.sh +20 -12
  45. package/karnel/utils/log.sh +2 -2
  46. package/karnel/utils/uninstall.sh +16 -2
  47. package/karnel/utils/version.sh +25 -25
  48. package/package.json +1 -1
  49. package/docs/README.md +0 -35
  50. /package/docs/doctor/{README.md → index.md} +0 -0
  51. /package/docs/{troubleshooting.md → troubleshooting/index.md} +0 -0
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.16.1-0078D4?style=for-the-badge" alt="Version">
11
+ <img src="https://img.shields.io/badge/version-4.17.7-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">
@@ -25,9 +25,6 @@
25
25
  <a href="https://karneltermux.vercel.app">
26
26
  <img src="https://img.shields.io/badge/Site-karneltermux.vercel.app-0078D4?style=for-the-badge" alt="Website">
27
27
  </a>
28
- <a href="https://www.youtube.com/@capideb">
29
- <img src="https://img.shields.io/badge/YouTube-Capi.deb-FF0000?style=for-the-badge&logo=youtube&logoColor=white" alt="YouTube — Capi.deb">
30
- </a>
31
28
  </p>
32
29
 
33
30
  ---
@@ -38,7 +35,7 @@ Created by **Israel Marques**.
38
35
 
39
36
  Core agent contributions by **devcorex**.
40
37
 
41
- - **43 AI tools** — Claude, Gemini, OpenCode, Cactus, Hugging Face, Ollama, KeelCode, Goose, Factory Droid and more
38
+ - **45 AI tools** — Claude, Gemini, OpenCode, Cactus, Hugging Face, Ollama, KeelCode, Goose, Factory Droid and more
42
39
  - **8 languages** — Node.js, Python, Go, Rust, C/C++, PHP, Perl, Bun
43
40
  - **5 databases** — PostgreSQL, MariaDB, SQLite, MongoDB, Redis
44
41
  - **22 dev tools** — gh, curl, fzf, bat, lsd, jq, tmux, openssh, snyk and more
@@ -64,7 +61,7 @@ Core agent contributions by **devcorex**.
64
61
  ### Via checksummed GitHub release (recommended)
65
62
 
66
63
  ```bash
67
- version=4.16.1
64
+ version=4.17.7
68
65
  tmpdir=$(mktemp -d) && trap 'rm -rf "$tmpdir"' EXIT
69
66
  base="https://github.com/israelmarques1024-dotcom/karnel-termux/releases/download/v$version"
70
67
  curl -fsSL "$base/karnel-termux-install.sh" -o "$tmpdir/karnel-termux-install.sh"
@@ -115,6 +112,7 @@ aliases, or options; use `karnel help` and the CLI reference for the full set.
115
112
  | `karnel brain` | Second brain — memories and search |
116
113
  | `karnel env` | Manage environment variables |
117
114
  | `karnel voice` | Voice commands for AI agents |
115
+ | `karnel agent` | Local AI assistant — chat (`ask`) and task agent (`run`) |
118
116
  | `karnel start editor` | Start code-server (VS Code in browser) |
119
117
  | `karnel pg` | PostgreSQL manager |
120
118
  | `karnel init <template>` | Initialize projects with templates |
@@ -129,7 +127,7 @@ aliases, or options; use `karnel help` and the CLI reference for the full set.
129
127
  |--------|-------------|--------------|
130
128
  | `lang` | Node.js, Python, Go, Rust, C/C++, PHP, Perl, Bun | `karnel install lang` |
131
129
  | `db` | PostgreSQL, MariaDB, SQLite, MongoDB, Redis | `karnel install db` |
132
- | `ai` | 43 AI tools, agents, and local inference clients | `karnel install ai` |
130
+ | `ai` | 45 AI tools, agents, and local inference clients | `karnel install ai` |
133
131
  | `editor` | code-server (VS Code in browser), Neovim, NvChad | `karnel install editor` |
134
132
  | `dev` | gh, curl, fzf, bat, lsd, jq and more | `karnel install dev` |
135
133
  | `npm` | TypeScript, NestJS CLI, Prettier and more | `karnel install npm` |
@@ -273,7 +271,7 @@ See the bundled reference with `karnel show osint --robin`.
273
271
 
274
272
  ---
275
273
 
276
- ## AI Tools (43)
274
+ ## AI Tools (45)
277
275
 
278
276
  ```bash
279
277
  karnel install ai # Install all
@@ -328,7 +326,9 @@ karnel install ai --opencode --ollama # Install specific agents
328
326
  | **Supercode CLI** | `--supercode-cli` | Supercode CLI — official npm package |
329
327
  | **Puter CLI** | `--puter` | Puter CLI for sites and workers |
330
328
  | **KeelCode** | `--keelcode` | Hosted coding-agent CLI |
331
-
329
+ | **Cactus Needle** | `--cactus-needle` | Lightweight Cactus inference helper |
330
+ | **Walkie Agent** | `--walkie` | Voice-first Walkie AI agent |
331
+
332
332
  </details>
333
333
 
334
334
  ---
@@ -357,7 +357,7 @@ definitions across 68 distinct tool labels. It detects subprojects, executes
357
357
  checks in the matching project or subproject directory, preserves command exit status, and writes
358
358
  timestamped text reports under `$KARNEL_DATA/doctor_code_reports/`.
359
359
 
360
- Read the **[complete Doctor reference](docs/doctor/README.md)** for modes,
360
+ Read the **[complete Doctor reference](docs/doctor/index.md)** for modes,
361
361
  supported ecosystems, tool coverage, JSON schema, reports, and auto-fix safety.
362
362
 
363
363
  ---
@@ -513,11 +513,11 @@ Documentation loads from https://karneltermux.vercel.app.
513
513
 
514
514
  ## Documentation
515
515
 
516
- - [Documentation index](docs/README.md)
517
- - [CLI reference](docs/cli/README.md)
518
- - [Doctor reference](docs/doctor/README.md)
519
- - [Troubleshooting](docs/troubleshooting.md)
520
- - [Architecture](docs/ARCHITECTURE.md)
516
+ - [Documentation index](docs/index.md)
517
+ - [CLI reference](docs/cli/index.md)
518
+ - [Doctor reference](docs/doctor/index.md)
519
+ - [Troubleshooting](docs/troubleshooting/index.md)
520
+ - [Architecture](docs/ARCHITECTURE/index.md)
521
521
  - [Documentation changelog](docs/CHANGELOG.md)
522
522
  - [Official website](https://karneltermux.vercel.app)
523
523
 
@@ -564,7 +564,7 @@ karnel/
564
564
  │ │ └── karnel.sh # Main CLI (with TUI)
565
565
  │ ├── modules/ # Module orchestrators
566
566
  │ ├── tools/ # Tool installers
567
- │ │ ├── ai/ # 43 AI tools
567
+ │ │ ├── ai/ # 45 AI tools
568
568
  │ │ ├── lang/ # 8 languages
569
569
  │ │ ├── db/ # 5 databases
570
570
  │ │ ├── dev/ # 22 dev tools
@@ -27,18 +27,22 @@ karnel-termux/
27
27
  │ │ ├── dev.sh # Dev tools installer
28
28
  │ │ └── ...
29
29
  │ ├── tools/ # Individual tool installers
30
- │ │ ├── ai/ # 43 AI tools
30
+ │ │ ├── ai/ # 45 AI tools
31
31
  │ │ ├── lang/ # 8 languages
32
32
  │ │ ├── db/ # 5 databases
33
33
  │ │ ├── dev/ # 22 dev tools
34
- │ │ ├── editor/ # Code editor
35
- │ │ ├── npm/ # Global npm packages
36
- │ │ ├── shell/ # ZSH plugins
37
- │ │ ├── ui/ # Termux UI
38
- │ │ ├── auto/ # Automation
39
- │ │ ├── deploy/ # Deploy CLIs
34
+ │ │ ├── editor/ # code-server, Neovim, NvChad
35
+ │ │ ├── npm/ # 11 global npm packages
36
+ │ │ ├── shell/ # ZSH + 10 plugins
37
+ │ │ ├── ui/ # 4 UI components
38
+ │ │ ├── auto/ # n8n automation
39
+ │ │ ├── deploy/ # 4 deploy CLIs
40
+ │ │ ├── games/ # 6 games
40
41
  │ │ ├── network/ # 2 network tools (dark, dedsec-network)
41
42
  │ │ ├── utils/ # 12 utility tools (fconv, notes, zork, SuperFile, etc.)
43
+ │ │ ├── security/ # 30 security tools
44
+ │ │ ├── voice/ # Speech-to-agent via Termux:API
45
+ │ │ ├── plugins/ # Built-in plugin manager
42
46
  │ │ └── osint/ # Robin OSINT integration
43
47
  │ └── utils/ # Shared utilities
44
48
  │ ├── bootstrap.sh # Import mechanism, shell detection
@@ -105,7 +109,9 @@ on the caller's dynamic scope.
105
109
 
106
110
  ## Module System
107
111
 
108
- Each module (`lang`, `db`, `ai`, `dev`, etc.) has:
112
+ Each module (`ai`, `auto`, `db`, `deploy`, `dev`, `editor`, `games`, `lang`,
113
+ `network`, `npm`, `osint`, `security`, `shell`, `ui`, `utils`, `voice`,
114
+ `plugin`) has:
109
115
 
110
116
  1. A **module orchestrator** in `karnel/modules/<name>.sh` — handles installation logic
111
117
  2. Individual **tool installers** in `karnel/tools/<name>/<tool>/install.sh` — each installs one tool
@@ -133,4 +139,4 @@ _tool_postinstall() { ... } # Post-installation setup
133
139
 
134
140
  ## Doctor Subsystem Architecture
135
141
 
136
- See [Doctor System](./doctor/README.md) for the complete breakdown of the doctor code analysis engine.
142
+ See [Doctor System](../doctor/) for the complete breakdown of the doctor code analysis engine.
@@ -0,0 +1,13 @@
1
+ title: Karnel Termux
2
+ description: >-
3
+ Modular Dev Environment for Termux — install languages, databases, AI agents,
4
+ editors, and more with one command.
5
+ theme: jekyll-theme-cayman
6
+ markdown: kramdown
7
+ logo: /assets/images/karnel-logo.png
8
+ custom_css: /assets/css/style.css
9
+ baseurl: /karnel-termux
10
+ exclude:
11
+ - vendor
12
+ - Gemfile
13
+ - Gemfile.lock
@@ -0,0 +1,205 @@
1
+ /* Karnel Termux — custom styling layered on top of jekyll-theme-cayman */
2
+
3
+ :root {
4
+ --karnel-bg: #0d1117;
5
+ --karnel-panel: #161b22;
6
+ --karnel-border: #30363d;
7
+ --karnel-accent: #2f81f7;
8
+ --karnel-accent-2: #0078d4;
9
+ --karnel-text: #c9d1d9;
10
+ --karnel-muted: #8b949e;
11
+ --karnel-code-bg: #161b22;
12
+ }
13
+
14
+ html {
15
+ scroll-behavior: smooth;
16
+ }
17
+
18
+ body {
19
+ font-size: 16px;
20
+ line-height: 1.6;
21
+ color: #24292f;
22
+ }
23
+
24
+ @media (prefers-color-scheme: dark) {
25
+ body {
26
+ background: var(--karnel-bg);
27
+ color: var(--karnel-text);
28
+ }
29
+ .page-header {
30
+ background-image: linear-gradient(120deg, #0078d4, #2f81f7);
31
+ }
32
+ .main-content h1,
33
+ .main-content h2,
34
+ .main-content h3,
35
+ .main-content h4 {
36
+ color: #e6edf3;
37
+ border-bottom-color: var(--karnel-border);
38
+ }
39
+ .main-content a {
40
+ color: var(--karnel-accent);
41
+ }
42
+ .main-content code {
43
+ color: #e6edf3;
44
+ }
45
+ }
46
+
47
+ .page-header {
48
+ padding: 2.5rem 1rem;
49
+ }
50
+
51
+ .page-header .project-tagline {
52
+ opacity: 0.95;
53
+ font-size: 1.1rem;
54
+ }
55
+
56
+ /* Logo */
57
+ .karnel-logo {
58
+ display: block;
59
+ margin: 0 auto 1.25rem;
60
+ max-width: 220px;
61
+ height: auto;
62
+ filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
63
+ }
64
+
65
+ /* Landing navigation */
66
+ .karnel-nav {
67
+ display: flex;
68
+ flex-wrap: wrap;
69
+ gap: 0.6rem;
70
+ margin: 1.5rem 0 2rem;
71
+ padding: 0;
72
+ list-style: none;
73
+ }
74
+
75
+ .karnel-nav li {
76
+ margin: 0;
77
+ }
78
+
79
+ .karnel-nav a {
80
+ display: inline-block;
81
+ padding: 0.5rem 1rem;
82
+ border: 1px solid var(--karnel-accent-2, #0078d4);
83
+ border-radius: 999px;
84
+ text-decoration: none;
85
+ font-weight: 600;
86
+ font-size: 0.92rem;
87
+ color: #fff;
88
+ background: rgba(0, 120, 212, 0.12);
89
+ transition: background 0.15s ease, transform 0.15s ease;
90
+ }
91
+
92
+ .karnel-nav a:hover {
93
+ background: rgba(0, 120, 212, 0.28);
94
+ transform: translateY(-1px);
95
+ }
96
+
97
+ @media (prefers-color-scheme: dark) {
98
+ .karnel-nav a {
99
+ color: #c9d1d9;
100
+ border-color: var(--karnel-border);
101
+ }
102
+ }
103
+
104
+ /* Tables */
105
+ .main-content table {
106
+ display: table;
107
+ width: 100%;
108
+ border-collapse: collapse;
109
+ font-size: 0.95rem;
110
+ margin: 1.5rem 0;
111
+ }
112
+
113
+ .main-content th,
114
+ .main-content td {
115
+ border: 1px solid var(--karnel-border, #d0d7de);
116
+ padding: 0.55rem 0.75rem;
117
+ text-align: left;
118
+ }
119
+
120
+ .main-content thead th {
121
+ background: #f3f5f8;
122
+ font-weight: 700;
123
+ }
124
+
125
+ @media (prefers-color-scheme: dark) {
126
+ .main-content th,
127
+ .main-content td {
128
+ border-color: var(--karnel-border);
129
+ }
130
+ .main-content thead th {
131
+ background: var(--karnel-panel);
132
+ color: #e6edf3;
133
+ }
134
+ .main-content tbody tr:nth-child(2n) {
135
+ background: rgba(255, 255, 255, 0.03);
136
+ }
137
+ }
138
+
139
+ /* Code blocks */
140
+ .main-content pre {
141
+ border-radius: 8px;
142
+ padding: 1rem 1.1rem;
143
+ font-size: 0.9rem;
144
+ line-height: 1.5;
145
+ overflow: auto;
146
+ }
147
+
148
+ .main-content code {
149
+ font-size: 0.88em;
150
+ }
151
+
152
+ /* Blockquotes */
153
+ .main-content blockquote {
154
+ border-left: 4px solid var(--karnel-accent-2, #0078d4);
155
+ background: rgba(0, 120, 212, 0.06);
156
+ padding: 0.75rem 1rem;
157
+ color: inherit;
158
+ border-radius: 0 6px 6px 0;
159
+ }
160
+
161
+ /* Section spacing */
162
+ .main-content h2 {
163
+ margin-top: 2.5rem;
164
+ padding-bottom: 0.4rem;
165
+ border-bottom: 1px solid #e1e4e8;
166
+ }
167
+
168
+ .main-content h3 {
169
+ margin-top: 1.75rem;
170
+ }
171
+
172
+ /* Lists of links on the index page */
173
+ .karnel-links {
174
+ display: grid;
175
+ grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
176
+ gap: 0.75rem;
177
+ margin: 1.5rem 0;
178
+ padding: 0;
179
+ list-style: none;
180
+ }
181
+
182
+ .karnel-links a {
183
+ display: block;
184
+ padding: 0.9rem 1rem;
185
+ border: 1px solid #d0d7de;
186
+ border-radius: 10px;
187
+ text-decoration: none;
188
+ font-weight: 600;
189
+ color: #24292f;
190
+ background: #fff;
191
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
192
+ }
193
+
194
+ .karnel-links a:hover {
195
+ border-color: var(--karnel-accent-2, #0078d4);
196
+ box-shadow: 0 2px 10px rgba(0, 120, 212, 0.15);
197
+ }
198
+
199
+ @media (prefers-color-scheme: dark) {
200
+ .karnel-links a {
201
+ background: var(--karnel-panel);
202
+ border-color: var(--karnel-border);
203
+ color: #e6edf3;
204
+ }
205
+ }
@@ -23,7 +23,7 @@ karnel install <module> --tool1 --tool2 # Install specific tools only
23
23
  |-----------|-------------|
24
24
  | `lang` | Node.js, Python, Go, Rust, C/C++, PHP, Perl, Bun |
25
25
  | `db` | PostgreSQL, MariaDB, SQLite, MongoDB, Redis |
26
- | `ai` | 43 AI tools (OpenCode, Cactus, Hugging Face, Claude Code, KeelCode, Goose, Factory Droid, Ollama, etc.) |
26
+ | `ai` | 45 AI tools (OpenCode, Cactus, Hugging Face, Claude Code, KeelCode, Goose, Factory Droid, Ollama, etc.) |
27
27
  | `editor` | code-server (VS Code in browser), Neovim, NvChad |
28
28
  | `dev` | gh, curl, fzf, bat, lsd, jq, tmux, openssh, snyk (22 tools) |
29
29
  | `npm` | TypeScript, NestJS CLI, Prettier, Vercel CLI, etc. |
@@ -43,7 +43,7 @@ karnel install <module> --tool1 --tool2 # Install specific tools only
43
43
 
44
44
  | Module | Flags |
45
45
  |-----------|-------|
46
- | `ai` | `--qwen-code`, `--gemini-cli`, `--claude-code`, `--mistral-vibe`, `--openclaude`, `--openclaw`, `--ollama`, `--codex`, `--opencode`, `--mimocode`, `--engram`, `--codegraph`, `--pi`, `--antigravity-cli`, `--minimax-cli`, `--gentle-ai`, `--gga`, `--hermes-agent`, `--kimi-code`, `--command-code`, `--codebuff`, `--freebuff`, `--kilocode-cli`, `--kiro`, `--crush`, `--cline`, `--odysseus`, `--kimchi-code`, `--omni-route`, `--ctx7`, `--openspec`, `--supercode-cli`, `--puter`, `--keelcode`, `--copilot-termux`, `--qoder`, `--ampcode`, `--cursor-cli`, `--oh-my-pi`, `--goose`, `--droid`, `--cactus`, `--hugging-face` |
46
+ | `ai` | `--qwen-code`, `--gemini-cli`, `--claude-code`, `--mistral-vibe`, `--openclaude`, `--openclaw`, `--ollama`, `--codex`, `--opencode`, `--mimocode`, `--engram`, `--codegraph`, `--pi`, `--antigravity-cli`, `--minimax-cli`, `--gentle-ai`, `--gga`, `--hermes-agent`, `--kimi-code`, `--command-code`, `--codebuff`, `--freebuff`, `--kilocode-cli`, `--kiro`, `--crush`, `--cline`, `--odysseus`, `--kimchi-code`, `--omni-route`, `--ctx7`, `--openspec`, `--supercode-cli`, `--puter`, `--keelcode`, `--copilot-termux`, `--qoder`, `--ampcode`, `--cursor-cli`, `--oh-my-pi`, `--goose`, `--droid`, `--cactus`, `--cactus-needle`, `--walkie`, `--hugging-face` |
47
47
  | `db` | `--postgresql`, `--mariadb`, `--sqlite`, `--mongodb`, `--redis` |
48
48
  | `dev` | `--gh`, `--wget`, `--curl`, `--lsd`, `--bat`, `--proot`, `--ncurses`, `--tmate`, `--openssh`, `--tmux`, `--cloudflared`, `--translate`, `--html2text`, `--jq`, `--bc`, `--tree`, `--fzf`, `--imagemagick`, `--shfmt`, `--make`, `--udocker`, `--snyk` |
49
49
  | `lang` | `--bun`, `--nodejs`, `--python`, `--perl`, `--php`, `--rust`, `--clang`, `--golang` |
@@ -136,7 +136,7 @@ binary/command name, and current install status.
136
136
  |-----------|-------|
137
137
  | `lang` | 8 languages |
138
138
  | `db` | 5 databases |
139
- | `ai` | 43 AI tools |
139
+ | `ai` | 45 AI tools |
140
140
  | `editor` | 3 editor components |
141
141
  | `dev` | 22 development tools |
142
142
  | `npm` | 11 npm global modules |
@@ -340,7 +340,7 @@ karnel robin doctor --network
340
340
  karnel robin purge-data --yes
341
341
  ```
342
342
 
343
- See the [Robin reference](../../karnel/tools/osint/robin/README.md) for detailed
343
+ See the [Robin reference](https://github.com/israelmarques1024-dotcom/karnel-termux/blob/main/karnel/tools/osint/robin/README.md) for detailed
344
344
  lifecycle, data locations, and troubleshooting.
345
345
 
346
346
  ---
@@ -512,6 +512,45 @@ karnel ia routes
512
512
 
513
513
  ---
514
514
 
515
+ ## agent — Local AI assistant
516
+
517
+ ```bash
518
+ karnel agent <ask|run|config> [options]
519
+ ```
520
+
521
+ | Subcommand | Description |
522
+ |------------|-------------|
523
+ | `ask` | Streamed AI chat assistant (markdown TUI). With no prompt, opens an interactive chat. |
524
+ | `run` | Task agent: the LLM answers in a plan/build/execute loop and can run shell commands. |
525
+ | `config` | Show or set the assistant configuration. |
526
+
527
+ ### Options (ask / run)
528
+
529
+ | Flag | Description |
530
+ |------|-------------|
531
+ | `-p`, `--prompt <text>` | Task or question (omit for interactive mode) |
532
+ | `-m`, `--model <name>` | Model id (default from config) |
533
+ | `-u`, `--endpoint <url>` | OpenAI-compatible endpoint (default from config) |
534
+ | `-t`, `--temperature <n>` | Sampling temperature |
535
+ | `--max-tokens <n>` | Maximum output tokens |
536
+ | `-n`, `--max-iterations <n>` | Agent loop iteration limit (`run`) |
537
+ | `-y`, `--yes` | Auto-approve commands, skip the y/N prompt (`run`) |
538
+ | `-w`, `--workspace <dir>` | Working directory for the task agent (`run`) |
539
+
540
+ ```bash
541
+ karnel agent ask -p "Explain rsync"
542
+ karnel agent ask # interactive chat
543
+ karnel agent run -p "create a backup script"
544
+ karnel agent run -p "..." -m gemma-4-e2b-it-cq4 -u http://127.0.0.1:8000/v1
545
+ karnel agent config # show current settings
546
+ karnel agent config model gpt-4o # set the default model id
547
+ ```
548
+
549
+ `karnel agent ask` connects to the configured OpenAI-compatible endpoint; if it is
550
+ unreachable and Cactus is not installed, it offers to install Cactus on the spot.
551
+
552
+ ---
553
+
515
554
  ## init — Project configuration
516
555
 
517
556
  ```bash
package/docs/index.md ADDED
@@ -0,0 +1,43 @@
1
+ # Karnel Termux Documentation
2
+
3
+ > Modular Dev Environment for Termux — install languages, databases, AI agents, editors, and more with one command
4
+
5
+ Navigate the docs:
6
+
7
+ <ul class="karnel-nav">
8
+ <li><a href="./cli/">CLI Commands</a></li>
9
+ <li><a href="./doctor/">Doctor System</a></li>
10
+ <li><a href="./troubleshooting/">Troubleshooting</a></li>
11
+ <li><a href="./ARCHITECTURE/">Architecture</a></li>
12
+ <li><a href="./CHANGELOG.md">Changelog</a></li>
13
+ <li><a href="https://israelmarques1024-dotcom.github.io/karnel-termux/">Live Site</a></li>
14
+ </ul>
15
+
16
+ ## What is Karnel?
17
+
18
+ Karnel Termux transforms your Android device into a complete development workstation.
19
+ With a single CLI (`karnel`), you can install and manage 45 AI tools, 8 languages,
20
+ 5 databases, 22 dev tools, 11 npm packages, 10 shell plugins, 4 UI components,
21
+ 4 deploy CLIs, 6 games, 2 network tools, 12 utility tools, 30 security tools,
22
+ responsible OSINT, a second brain, voice commands, and reviewed plugins — all
23
+ from modules: `ai`, `auto`, `db`, `deploy`, `dev`, `editor`, `games`, `lang`,
24
+ `network`, `npm`, `osint`, `security`, `shell`, `ui`, `utils`, `voice`, `plugin`.
25
+
26
+ ## Sections
27
+
28
+ <div class="karnel-links">
29
+ <a href="./cli/">CLI Commands — full reference for every <code>karnel</code> subcommand</a>
30
+ <a href="./doctor/">Doctor System — environment checks and the code-analysis engine</a>
31
+ <a href="https://github.com/israelmarques1024-dotcom/karnel-termux/blob/main/karnel/tools/osint/robin/README.md">Robin OSINT — responsible use, lifecycle, data locations</a>
32
+ <a href="https://github.com/israelmarques1024-dotcom/karnel-termux/blob/main/karnel/tools/network/dark/README.md">Network Tools — dark, dedsec-network</a>
33
+ <a href="https://github.com/israelmarques1024-dotcom/karnel-termux/blob/main/karnel/tools/ai/keelcode/README.md">KeelCode — hosted coding-agent CLI</a>
34
+ <a href="https://github.com/israelmarques1024-dotcom/karnel-termux/blob/main/karnel/tools/utils/superfile/README.md">SuperFile — terminal file manager</a>
35
+ <a href="https://github.com/israelmarques1024-dotcom/karnel-termux/blob/main/karnel/tools/utils/fconv/README.md">Utility Scripts — fconv, notes, treex, and more</a>
36
+ <a href="./cli/#supabase--remote-project-helpers">Supabase CLI — remote-project helpers</a>
37
+ <a href="./ARCHITECTURE/">Architecture — project structure and module system</a>
38
+ <a href="./CHANGELOG.md">Changelog — version history and fixes</a>
39
+ </div>
40
+
41
+ ## Credits
42
+
43
+ Created by **Israel Marques**. Core agent contributions by **devcorex**.
@@ -1 +1 @@
1
- 2e76f74b21de6f9a01911b2c06b96ac09d12359d
1
+ d1343c03d2f32967e36b7f78c8ef8cbb6656410e
@@ -448,7 +448,7 @@ agent_repl_handle() {
448
448
  ;;
449
449
  /model*)
450
450
  local m="${line#/model }"
451
- m="${m#/model}"
451
+ [[ "$m" == "$line" ]] && m=""
452
452
  m=$(echo "$m" | xargs)
453
453
  if [[ -z "$m" ]]; then
454
454
  log_info "Available models:"
@@ -462,7 +462,7 @@ agent_repl_handle() {
462
462
  ;;
463
463
  /endpoint*)
464
464
  local e="${line#/endpoint }"
465
- e="${e#/endpoint}"
465
+ [[ "$e" == "$line" ]] && e=""
466
466
  e=$(echo "$e" | xargs)
467
467
  if [[ -z "$e" ]]; then agent_read_input "Endpoint URL (e.g. http://127.0.0.1:8000/v1)" e; fi
468
468
  if [[ -z "$e" ]]; then return 0; fi
@@ -472,7 +472,7 @@ agent_repl_handle() {
472
472
  ;;
473
473
  /temp*)
474
474
  local t="${line#/temp }"
475
- t="${t#/temp}"
475
+ [[ "$t" == "$line" ]] && t=""
476
476
  t=$(echo "$t" | xargs)
477
477
  if [[ -z "$t" ]]; then agent_read_input "Temperature (0-2)" t; fi
478
478
  if [[ -n "$t" ]]; then AGENT_TEMPERATURE="$t"; log_success "Temperature → ${D_CYAN}$AGENT_TEMPERATURE${D_NC}"; fi
@@ -480,7 +480,7 @@ agent_repl_handle() {
480
480
  ;;
481
481
  /max*)
482
482
  local mx="${line#/max }"
483
- mx="${mx#/max}"
483
+ [[ "$mx" == "$line" ]] && mx=""
484
484
  mx=$(echo "$mx" | xargs)
485
485
  if [[ -z "$mx" ]]; then agent_read_input "Max tokens" mx; fi
486
486
  if [[ -n "$mx" ]]; then AGENT_MAX_TOKENS="$mx"; log_success "Max tokens → ${D_CYAN}$AGENT_MAX_TOKENS${D_NC}"; fi
@@ -488,9 +488,8 @@ agent_repl_handle() {
488
488
  ;;
489
489
  /workspace*)
490
490
  local ws="${line#/workspace }"
491
- ws="${ws#/workspace}"
491
+ [[ "$ws" == "$line" ]] && ws=""
492
492
  ws=$(echo "$ws" | xargs)
493
- if [[ -z "$ws" ]]; then agent_read_input "Workspace directory (absolute path)" ws; fi
494
493
  if [[ -n "$ws" ]]; then
495
494
  mkdir -p "$ws"
496
495
  AGENT_WORKSPACE="$ws"
@@ -163,8 +163,9 @@ _brain_remove_related() {
163
163
  head -n $((frontmatter_end - 1)) "$file" >"$tmp"
164
164
  local escaped
165
165
  escaped=$(_brain_slug_escape "$slug")
166
- sed -i "s/related: \[\(.*\)$escaped\(.*\)\]/related: [\1\2]/" "$tmp"
167
- sed -i 's/related: \[, */related: [/; s/, *, */, /g; s/related: \[ *\]//' "$tmp"
166
+ # Only touch the `related:` line, and only strip the slug as a discrete
167
+ # comma-separated token (never as a substring inside another slug).
168
+ sed -i "/^related:/ s/, ${escaped}//g; s/${escaped}, //g; s/\[${escaped}\]/[]/g; s/\[, /[/g; s/, \]/]/g" "$tmp"
168
169
  tail -n +$((frontmatter_end)) "$file" >>"$tmp"
169
170
  mv "$tmp" "$file"
170
171
  }
@@ -443,7 +444,7 @@ brain_save() {
443
444
  done
444
445
  $already || related_slugs+=("$match_slug")
445
446
  fi
446
- done < <(_brain_rg -i "tags:.*$tag" || true)
447
+ done < <(_brain_rg -l -i "tags:.*$tag" || true)
447
448
  done
448
449
  IFS=$' \t\n'
449
450
 
@@ -1296,11 +1297,12 @@ brain_delete() {
1296
1297
  fi
1297
1298
 
1298
1299
  # Remove relations from related files
1299
- local file_slug
1300
+ local file_slug escaped_slug
1300
1301
  file_slug=$(basename "$file" .md)
1302
+ escaped_slug=$(_brain_slug_escape "$file_slug")
1301
1303
  while IFS= read -r rfile; do
1302
1304
  _brain_remove_related "$rfile" "$file_slug"
1303
- done < <(_brain_rg "$file_slug" || true)
1305
+ done < <(_brain_rg -l "related:.*${escaped_slug}" || true)
1304
1306
 
1305
1307
  if [[ "$file" != "$BRAIN_DIR"/* ]]; then
1306
1308
  log_error "Refusing to delete file outside brain directory"
@@ -3,13 +3,15 @@
3
3
  import "@/utils/log"
4
4
  import "@/utils/colors"
5
5
 
6
- # ── Detect rc file: zsh > bash ─────────────────────────────
6
+ # ── Detect rc file based on the ACTIVE shell (not just presence) ──
7
7
  _env_rc_file() {
8
- if [[ -f "$HOME/.zshrc" ]]; then
9
- echo "$HOME/.zshrc"
10
- else
11
- echo "$HOME/.bashrc"
12
- fi
8
+ local shell_name
9
+ shell_name=$(basename "${SHELL:-${0:-bash}}" 2>/dev/null)
10
+ shell_name="${shell_name#-}" # strip leading '-' from login-shell names (e.g. -bash)
11
+ case "$shell_name" in
12
+ zsh) echo "$HOME/.zshrc" ;;
13
+ *) echo "$HOME/.bashrc" ;;
14
+ esac
13
15
  }
14
16
 
15
17
  # ── Validate variable name ─────────────────────────────────