karnel-termux 4.13.9 → 4.13.10
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 +1 -1
- package/docs/ARCHITECTURE.md +131 -0
- package/docs/CHANGELOG.md +183 -0
- package/docs/README.md +31 -0
- package/docs/cli/README.md +784 -0
- package/docs/doctor/README.md +243 -0
- package/docs/troubleshooting.md +69 -0
- package/karnel/cli/commands/doctor.sh +1 -1
- package/karnel/cli/karnel.sh +6 -4
- package/karnel/tools/ai/gga/README.md +0 -1
- package/karnel/tools/ai/omni-route/README.md +1 -2
- package/karnel/tools/ai/qoder/README.md +0 -1
- package/karnel/tools/npm/markserv/README.md +1 -2
- package/karnel/tools/npm/psqlformat/README.md +1 -2
- package/package.json +2 -1
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.13.
|
|
11
|
+
<img src="https://img.shields.io/badge/version-4.13.10-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">
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# Karnel Architecture
|
|
2
|
+
|
|
3
|
+
## Project Structure
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
karnel-termux/
|
|
7
|
+
├── karnel/
|
|
8
|
+
│ ├── bin/karnel # Entry point (bash script, in PATH)
|
|
9
|
+
│ ├── cli/
|
|
10
|
+
│ │ ├── karnel.sh # Main CLI dispatcher (TUI + command routing)
|
|
11
|
+
│ │ └── commands/ # Each subcommand is a separate file
|
|
12
|
+
│ │ ├── help.sh
|
|
13
|
+
│ │ ├── install.sh
|
|
14
|
+
│ │ ├── doctor.sh # Doctor command + inline checks
|
|
15
|
+
│ │ ├── doctor/ # Doctor code subsystem (4 modules)
|
|
16
|
+
│ │ ├── brain.sh
|
|
17
|
+
│ │ ├── env.sh
|
|
18
|
+
│ │ ├── pg.sh
|
|
19
|
+
│ │ ├── voice.sh
|
|
20
|
+
│ │ ├── init.sh
|
|
21
|
+
│ │ ├── deploy.sh
|
|
22
|
+
│ │ ├── ... (27 .sh files + doctor/ subdir)
|
|
23
|
+
│ ├── modules/ # Module orchestrators
|
|
24
|
+
│ │ ├── ai.sh # AI agent installer
|
|
25
|
+
│ │ ├── lang.sh # Language installer
|
|
26
|
+
│ │ ├── db.sh # Database installer
|
|
27
|
+
│ │ ├── dev.sh # Dev tools installer
|
|
28
|
+
│ │ └── ...
|
|
29
|
+
│ ├── tools/ # Individual tool installers
|
|
30
|
+
│ │ ├── ai/ # 41 AI agents
|
|
31
|
+
│ │ ├── lang/ # 8 languages
|
|
32
|
+
│ │ ├── db/ # 5 databases
|
|
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
|
|
40
|
+
│ │ ├── network/ # 2 network tools (dark, dedsec-network)
|
|
41
|
+
│ │ ├── utils/ # 12 utility tools (fconv, notes, zork, SuperFile, etc.)
|
|
42
|
+
│ │ └── osint/ # Robin OSINT integration
|
|
43
|
+
│ └── utils/ # Shared utilities
|
|
44
|
+
│ ├── bootstrap.sh # Import mechanism, shell detection
|
|
45
|
+
│ ├── banner.sh # ASCII banners
|
|
46
|
+
│ ├── colors.sh # ANSI color definitions
|
|
47
|
+
│ ├── log.sh # Logging (info, warn, error, success, box)
|
|
48
|
+
│ ├── env.sh # Environment configuration (XDG paths, UI opts)
|
|
49
|
+
│ └── version.sh # Version comparison utilities
|
|
50
|
+
├── install.sh # Bootstrap installer
|
|
51
|
+
├── package.json # npm publishing
|
|
52
|
+
├── scripts/npm-install.js # postinstall hook
|
|
53
|
+
├── assets/ # Images, logos
|
|
54
|
+
├── tests/ # Test scripts
|
|
55
|
+
└── docs/ # Documentation
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Import Mechanism
|
|
59
|
+
|
|
60
|
+
Karnel uses a custom `import()` function instead of `source`:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
import() {
|
|
64
|
+
local base="${KARNEL_PATH}"
|
|
65
|
+
local resolved="${1/@/$base}.sh"
|
|
66
|
+
local canonical
|
|
67
|
+
canonical="$(realpath "$resolved" 2>/dev/null || readlink -f "$resolved" 2>/dev/null || echo "$resolved")"
|
|
68
|
+
if [[ "$canonical" != "$base"/* ]] || [[ "$canonical" == *".."* ]]; then
|
|
69
|
+
echo "karnel: import error: path traversal denied: $1" >&2
|
|
70
|
+
return 1
|
|
71
|
+
fi
|
|
72
|
+
if [[ ! -f "$canonical" ]]; then
|
|
73
|
+
echo "karnel: import error: $canonical not found" >&2
|
|
74
|
+
return 1
|
|
75
|
+
fi
|
|
76
|
+
source "$canonical"
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
# Usage:
|
|
80
|
+
import "@/utils/log"
|
|
81
|
+
import "@/cli/commands/doctor/code"
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
The `@` symbol is replaced with `$KARNEL_PATH`. This avoids hardcoded paths.
|
|
85
|
+
|
|
86
|
+
### Critical Scope Implication
|
|
87
|
+
|
|
88
|
+
Because `import()` calls `source` from within a function, any `declare` statement
|
|
89
|
+
at the top level of a sourced file creates a **local** variable scoped to `import()`,
|
|
90
|
+
not a global. This is a common source of bugs.
|
|
91
|
+
|
|
92
|
+
**Rules:**
|
|
93
|
+
- `declare -A` at top level → **local** to `import()` ❌
|
|
94
|
+
- `declare -gA` inside a function → **global** ✅
|
|
95
|
+
- `VAR=value` updates the nearest dynamically scoped variable
|
|
96
|
+
- `local var` inside a function → **local** ✅
|
|
97
|
+
|
|
98
|
+
Persistent imported state should use `declare -g` explicitly rather than relying
|
|
99
|
+
on the caller's dynamic scope.
|
|
100
|
+
|
|
101
|
+
## Module System
|
|
102
|
+
|
|
103
|
+
Each module (`lang`, `db`, `ai`, `dev`, etc.) has:
|
|
104
|
+
|
|
105
|
+
1. A **module orchestrator** in `karnel/modules/<name>.sh` — handles installation logic
|
|
106
|
+
2. Individual **tool installers** in `karnel/tools/<name>/<tool>/install.sh` — each installs one tool
|
|
107
|
+
|
|
108
|
+
Robin uses a managed layout because its configuration and investigations are
|
|
109
|
+
persistent user data:
|
|
110
|
+
|
|
111
|
+
- Source checkout: `$KARNEL_TOOLS/osint/robin/app`
|
|
112
|
+
- Virtual environment: `$KARNEL_TOOLS/osint/robin/.venv`
|
|
113
|
+
- Provider configuration: `$KARNEL_CONFIG/robin/.env`
|
|
114
|
+
- Investigations: `$KARNEL_DATA/robin/investigations`
|
|
115
|
+
- PID and logs: `$KARNEL_RUN` and `$KARNEL_LOGS`
|
|
116
|
+
|
|
117
|
+
The upstream release and commit are pinned in `tools/osint/robin/common.sh`.
|
|
118
|
+
Candidate source and virtualenv trees are verified before replacing the active
|
|
119
|
+
installation. Uninstall does not delete persistent data.
|
|
120
|
+
|
|
121
|
+
### Tool Installer Pattern
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
_tool_dependencies() { ... } # Declare dependencies
|
|
125
|
+
_tool_install() { ... } # Install the tool
|
|
126
|
+
_tool_postinstall() { ... } # Post-installation setup
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## Doctor Subsystem Architecture
|
|
130
|
+
|
|
131
|
+
See [Doctor System](./doctor/README.md) for the complete breakdown of the doctor code analysis engine.
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# Documentation Changelog
|
|
2
|
+
|
|
3
|
+
## 4.13.10 - 2026-08-06
|
|
4
|
+
|
|
5
|
+
- Included root documentation in the npm package and synchronized help, TUI, and release assets.
|
|
6
|
+
|
|
7
|
+
## 4.13.9 - 2026-08-06
|
|
8
|
+
|
|
9
|
+
- Completed tool documentation coverage and corrected CLI references, commands, flags, links, and catalog counts.
|
|
10
|
+
|
|
11
|
+
## 4.13.8 - 2026-08-06
|
|
12
|
+
|
|
13
|
+
- Added KeelCode through the official `@keelcode-ai/keelcode` npm package.
|
|
14
|
+
- Added SuperFile built from pinned upstream source `v1.5.0`.
|
|
15
|
+
|
|
16
|
+
## 4.13.7 - 2026-08-04
|
|
17
|
+
|
|
18
|
+
### Plugin System
|
|
19
|
+
|
|
20
|
+
- Registry entries may now share a repository when each uses a distinct plugin
|
|
21
|
+
path, enabling multiple reviewed plugins from the official registry source.
|
|
22
|
+
- Plugin removal acquires the lifecycle lock before recovery and deletion,
|
|
23
|
+
preventing a concurrent update from restoring a removed plugin.
|
|
24
|
+
- Registry downloads refuse HTTPS-to-HTTP redirect downgrades.
|
|
25
|
+
|
|
26
|
+
## 4.13.6 - 2026-08-03
|
|
27
|
+
|
|
28
|
+
### Fixes
|
|
29
|
+
|
|
30
|
+
- Reject missing values for `karnel voice --lang` before argument parsing can
|
|
31
|
+
consume another option.
|
|
32
|
+
- Harden plugin command validation by rejecting hidden, non-shell, symlinked,
|
|
33
|
+
and undeclared command entries.
|
|
34
|
+
- Permit the documented root plugin path (`"path": "."`) in reviewed registry
|
|
35
|
+
entries while retaining traversal protection.
|
|
36
|
+
- Clarified CLI help, deployment requirements, and site documentation so they
|
|
37
|
+
match current behavior.
|
|
38
|
+
|
|
39
|
+
## 4.13.5 - 2026-08-01
|
|
40
|
+
|
|
41
|
+
### Release hardening
|
|
42
|
+
|
|
43
|
+
- `karnel update karnel` now resolves the latest GitHub release tag, downloads the
|
|
44
|
+
tag-pinned `karnel-termux-install.sh` and `.sha256` assets, verifies the SHA-256
|
|
45
|
+
checksum before running, and only then falls back to git/npm/pnpm. The Release
|
|
46
|
+
workflow attaches both immutable installer assets to each tag.
|
|
47
|
+
- GitHub Releases are created before npm publishing, so a failing npm publish no
|
|
48
|
+
longer blocks the release.
|
|
49
|
+
- The site catalog CI now verifies that the generated catalog has not drifted from
|
|
50
|
+
a pinned CLI checkout (`generate-catalog.mjs --check`).
|
|
51
|
+
|
|
52
|
+
### Fixes
|
|
53
|
+
|
|
54
|
+
- Repaired the Freebuff installer (release tag, asset name, download URL, binary
|
|
55
|
+
rename) and verified install/update on Termux aarch64.
|
|
56
|
+
- `karnel list` detects Kiro, KiloCode, and Cursor via any of their binaries.
|
|
57
|
+
- Added troubleshooting documentation covering npm tokens, releases, Vercel, and
|
|
58
|
+
update failures.
|
|
59
|
+
- Synchronized documentation with the 39-entry AI registry and the 4 deploy CLIs.
|
|
60
|
+
|
|
61
|
+
## 4.9.0 - 2026-07-20
|
|
62
|
+
|
|
63
|
+
### New modules
|
|
64
|
+
|
|
65
|
+
- Added `network` module with 2 tools: dark (Dark Web OSINT Tor crawler) and
|
|
66
|
+
dedsec-network (multi-purpose network scanner/OSINT/pentest).
|
|
67
|
+
- Added `utils` module with 11 utility scripts: fconv, filecheck, websites,
|
|
68
|
+
notes, treex, passman, applaunch, splash, httptmux, zork, and qrcode.
|
|
69
|
+
|
|
70
|
+
### Documentation
|
|
71
|
+
|
|
72
|
+
- Created READMEs for all 13 new tools under `karnel/tools/network/` and
|
|
73
|
+
`karnel/tools/utils/`.
|
|
74
|
+
- Updated `open.sh` with `network` and `utils` targets for browser docs.
|
|
75
|
+
- Updated root README, docs index, CLI reference, and architecture docs with
|
|
76
|
+
the new module counts and tool descriptions.
|
|
77
|
+
- Bumped version to 4.9.0.
|
|
78
|
+
|
|
79
|
+
## 4.8.0 - 2026-07-18
|
|
80
|
+
|
|
81
|
+
### Robin OSINT
|
|
82
|
+
|
|
83
|
+
- Added the `osint` module and `karnel robin` lifecycle command.
|
|
84
|
+
- Pinned Robin `v2.8` and validated its source commit before activation.
|
|
85
|
+
- Added a transactional source/venv installation path for Termux aarch64.
|
|
86
|
+
- Separated application code, provider configuration, and investigations.
|
|
87
|
+
- Added safe migration from the original single-directory layout.
|
|
88
|
+
- Added process identity validation, Streamlit readiness checks, Tor probes,
|
|
89
|
+
versioned responsible-use acknowledgement, and explicit data purge.
|
|
90
|
+
- Added `karnel start robin`, global status integration, and
|
|
91
|
+
`karnel doctor robin [--network]`.
|
|
92
|
+
|
|
93
|
+
### Quality and release
|
|
94
|
+
|
|
95
|
+
- Expanded catalog documentation from 24 to 32 development tools.
|
|
96
|
+
- Added complete Bash/Zsh syntax validation, Robin contract tests, ShellCheck
|
|
97
|
+
error gating, npm package inspection, CI, and release automation.
|
|
98
|
+
- Corrected competing stderr redirections in three installers.
|
|
99
|
+
|
|
100
|
+
## Unreleased - 2026-07-16
|
|
101
|
+
|
|
102
|
+
### Doctor command surface
|
|
103
|
+
|
|
104
|
+
- Added `karnel doctor code` alongside the existing Termux diagnostics.
|
|
105
|
+
- Kept exactly two operational Doctor subcommands: `termux` and `code`.
|
|
106
|
+
- Removed the stale `karnel doctor fix` entry from the main help. Termux fixes remain
|
|
107
|
+
available through `karnel doctor termux --fix`.
|
|
108
|
+
- Synchronized the Doctor AI probe and documentation with the 39-entry registry,
|
|
109
|
+
including Copilot-Termux.
|
|
110
|
+
|
|
111
|
+
### Code analysis engine
|
|
112
|
+
|
|
113
|
+
- Added project detection for 25 language and ecosystem labels.
|
|
114
|
+
- Added a registry with 76 check definitions and 68 distinct tool labels.
|
|
115
|
+
- Added quick, standard, and deep modes with 64, 74, and 76 definitions,
|
|
116
|
+
respectively.
|
|
117
|
+
- Added text reports and clean JSON output.
|
|
118
|
+
- Added safe and unclassified auto-fix modes.
|
|
119
|
+
- Added bounded subproject discovery through four directory levels.
|
|
120
|
+
|
|
121
|
+
### Correctness fixes
|
|
122
|
+
|
|
123
|
+
- Declared persistent arrays with `declare -g`/`declare -gA` so they survive the
|
|
124
|
+
function-scoped `import()` mechanism.
|
|
125
|
+
- Replaced space-delimited tool output with one registry record per line.
|
|
126
|
+
- Added a parser that preserves shell pipelines inside registry commands.
|
|
127
|
+
- Fixed file discovery that incorrectly expected NUL-delimited `find` output.
|
|
128
|
+
- Run language checks and fixes inside the matching manifest directory while
|
|
129
|
+
keeping cross-language checks at the requested project root.
|
|
130
|
+
- Preserve command exit statuses, including silent failures and timeouts.
|
|
131
|
+
- Quote sample file paths with Bash `%q` before shell execution.
|
|
132
|
+
- Prevent `npx` checks from downloading packages by using `--no-install`.
|
|
133
|
+
- Resolve compound tool labels such as `npm audit`, `go test`, `cargo test`, and
|
|
134
|
+
`docker compose` to their real executables.
|
|
135
|
+
- Run gofmt over discovered Go files instead of passing a directory, and send
|
|
136
|
+
javac output to the temporary directory instead of `/dev/null`.
|
|
137
|
+
- Parse Python files through `ast` instead of `compileall`, preventing diagnostics
|
|
138
|
+
from creating `__pycache__` artifacts in the analyzed project.
|
|
139
|
+
- Run cross-language checks once per project instead of once per detected language.
|
|
140
|
+
- Skip placeholder-based checks when no compatible sample file exists.
|
|
141
|
+
- Apply fixes only to findings, preserve the target directory, and report failed
|
|
142
|
+
fix commands accurately.
|
|
143
|
+
- Match fixes by both tool and category so tools with multiple checks do not apply
|
|
144
|
+
unrelated corrections.
|
|
145
|
+
- Emit standalone JSON with the analyzed directory, result count, category,
|
|
146
|
+
severity, and details.
|
|
147
|
+
- Record the requested target directory in text reports instead of `$PWD`.
|
|
148
|
+
|
|
149
|
+
### Detection fixes
|
|
150
|
+
|
|
151
|
+
- Preserve the root directory through recursive scans so subprojects are registered.
|
|
152
|
+
- Scan `.github/workflows` and detect GitHub Actions YAML files.
|
|
153
|
+
- Merge YAML detection so GitHub Actions is no longer shadowed by Ansible rules.
|
|
154
|
+
- Recognize scoped Angular and NestJS packages.
|
|
155
|
+
- Associate framework names with their language for terminal display.
|
|
156
|
+
- Detect Python for all supported Python manifest variants.
|
|
157
|
+
- Normalize manifest records for JavaScript, Django, CMake, Maven, Gradle, and .NET.
|
|
158
|
+
|
|
159
|
+
### Termux diagnostics
|
|
160
|
+
|
|
161
|
+
- Made `--quick` stop after essential system and package checks instead of running
|
|
162
|
+
the extended network and I/O probes.
|
|
163
|
+
- Added explicit timeouts to Termux information and battery probes so a missing or
|
|
164
|
+
unresponsive Termux:API service cannot block the full diagnostic run.
|
|
165
|
+
- Generate the Markdown report after auto-fixes so the `Fixed` count is accurate.
|
|
166
|
+
- Use explicit `skipped` values for quick-mode sections in the report.
|
|
167
|
+
- Fixed Python cache cleanup so version-directory globs expand correctly.
|
|
168
|
+
- Quote packages returned by `pip check` before reinstalling them.
|
|
169
|
+
|
|
170
|
+
### Verification
|
|
171
|
+
|
|
172
|
+
- Expanded `tests/smoke.sh` from 10 to 14 checks.
|
|
173
|
+
- Added syntax coverage for nested Doctor modules.
|
|
174
|
+
- Added registry count and pipeline-parsing regression tests.
|
|
175
|
+
- Added GitHub Actions, Python manifest, TypeScript, and NestJS detection tests.
|
|
176
|
+
- Verified clean JSON with Python's standard JSON parser.
|
|
177
|
+
- Verified modified shell files with ShellCheck at style severity.
|
|
178
|
+
|
|
179
|
+
## Security note
|
|
180
|
+
|
|
181
|
+
Doctor executes third-party analysis tools in the selected project. Review tool
|
|
182
|
+
configuration and use version control before enabling fixes. `npx` checks do not
|
|
183
|
+
install missing packages automatically.
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Karnel Termux Documentation
|
|
2
|
+
|
|
3
|
+
> Modular Dev Environment for Termux — install languages, databases, AI agents, editors, and more with one command
|
|
4
|
+
|
|
5
|
+
## Quick Links
|
|
6
|
+
|
|
7
|
+
- [CLI Commands](./cli/README.md) — All `karnel` subcommands
|
|
8
|
+
- [Doctor System](./doctor/README.md) — Environment diagnosis and code analysis
|
|
9
|
+
- [Troubleshooting](./troubleshooting.md) — Common issues and fixes
|
|
10
|
+
- [Architecture Overview](./ARCHITECTURE.md)
|
|
11
|
+
- [Bug Fixes & Changelog](./CHANGELOG.md)
|
|
12
|
+
- [Official Documentation Site](https://karneltermux.vercel.app/karnel/doctor)
|
|
13
|
+
|
|
14
|
+
## What is Karnel?
|
|
15
|
+
|
|
16
|
+
Karnel Termux transforms your Android device into a complete development workstation.
|
|
17
|
+
With a single CLI (`karnel`), you can install and manage 41 AI agents, 8 languages,
|
|
18
|
+
5 databases, 22 dev tools, 12 utility tools, 2 network tools, 6 games, responsible OSINT, and more.
|
|
19
|
+
|
|
20
|
+
## Sections
|
|
21
|
+
|
|
22
|
+
- **[CLI Commands](./cli/README.md)** — Full reference for every `karnel` subcommand
|
|
23
|
+
- **[Doctor System](./doctor/README.md)** — How `karnel doctor` works, code analysis engine, environment checks
|
|
24
|
+
- **[Robin OSINT](../karnel/tools/osint/robin/README.md)** — Responsible use, lifecycle, data locations, and troubleshooting
|
|
25
|
+
- **[Network Tools](../karnel/tools/network/dark/README.md)** — dark, dedsec-network
|
|
26
|
+
- **[KeelCode](../karnel/tools/ai/keelcode/README.md)** — Hosted coding-agent CLI: `karnel install ai --keelcode`
|
|
27
|
+
- **[SuperFile](../karnel/tools/utils/superfile/README.md)** — Terminal file manager: `karnel install utils --superfile`
|
|
28
|
+
- **[Utility Scripts](../karnel/tools/utils/fconv/README.md)** — fconv, notes, treex, SuperFile, passman, applaunch, splash, httptmux, zork, qrcode and more
|
|
29
|
+
- **[Supabase CLI](./cli/README.md#supabase--remote-project-helpers)** — `karnel supabase` remote-project helpers
|
|
30
|
+
- **[Architecture](./ARCHITECTURE.md)** — Project structure, module system, import mechanism
|
|
31
|
+
- **[Changelog](./CHANGELOG.md)** — Version history, bug fixes, known issues
|