karnel-termux 4.11.3 → 4.11.5
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/karnel/cli/commands/install.sh +14 -2
- package/karnel/cli/commands/list.sh +5 -2
- package/karnel/cli/commands/reinstall.sh +5 -1
- package/karnel/cli/commands/supabase.sh +209 -0
- package/karnel/cli/commands/uninstall.sh +5 -1
- package/karnel/cli/commands/update.sh +7 -3
- package/karnel/cli/karnel.sh +15 -4
- package/karnel/tools/deploy/all.sh +1 -1
- package/karnel/tools/deploy/supabase/install.sh +109 -0
- package/karnel/utils/env.sh +1 -1
- package/package.json +2 -5
|
@@ -28,10 +28,9 @@ install_main() {
|
|
|
28
28
|
list_item "shell - ZSH + Oh My Zsh + plugins"
|
|
29
29
|
list_item "ui - Termux UI (font, cursor, extra-keys, banner)"
|
|
30
30
|
list_item "auto - Automation Tools (n8n)"
|
|
31
|
-
list_item "deploy - Deploy CLIs (Vercel, Railway, Netlify)"
|
|
31
|
+
list_item "deploy - Deploy CLIs (Vercel, Railway, Netlify, Supabase)"
|
|
32
32
|
list_item "games - Games (Buzz, CTF God, Detective, etc.)"
|
|
33
33
|
list_item "voice - Voice command (speech-to-agent)"
|
|
34
|
-
|
|
35
34
|
echo
|
|
36
35
|
log_info "Install specific tools with flags:"
|
|
37
36
|
echo
|
|
@@ -161,6 +160,10 @@ _install_full_module() {
|
|
|
161
160
|
import "@/modules/security"
|
|
162
161
|
install_security
|
|
163
162
|
;;
|
|
163
|
+
supabase)
|
|
164
|
+
import "@/tools/deploy/supabase/install"
|
|
165
|
+
install_supabase
|
|
166
|
+
;;
|
|
164
167
|
*)
|
|
165
168
|
log_warn "Unknown install target: $target"
|
|
166
169
|
echo "Run 'karnel install' to see available targets"
|
|
@@ -786,6 +789,10 @@ _install_specific_tools() {
|
|
|
786
789
|
install_netlify
|
|
787
790
|
case $? in 0) ((installed_count++));; 2) ((skipped_count++));; 1) ((failed_count++));; esac
|
|
788
791
|
;;
|
|
792
|
+
supabase)
|
|
793
|
+
install_supabase
|
|
794
|
+
case $? in 0) ((installed_count++));; 2) ((skipped_count++));; 1) ((failed_count++));; esac
|
|
795
|
+
;;
|
|
789
796
|
*)
|
|
790
797
|
log_warn "Unknown deploy tool: --$tool"
|
|
791
798
|
;;
|
|
@@ -818,6 +825,11 @@ _install_specific_tools() {
|
|
|
818
825
|
security)
|
|
819
826
|
_batch_tool_action "security" "install" "${tools[@]}"
|
|
820
827
|
;;
|
|
828
|
+
supabase)
|
|
829
|
+
import "@/tools/supabase/all"
|
|
830
|
+
install_supabase
|
|
831
|
+
case $? in 0) log_success "Supabase CLI installed";; 2) log_info "Supabase CLI already installed";; 1) log_error "Failed to install Supabase CLI";; esac
|
|
832
|
+
;;
|
|
821
833
|
*)
|
|
822
834
|
log_warn "Unknown install target: $module"
|
|
823
835
|
echo "Run 'karnel install' to see available targets"
|
|
@@ -22,7 +22,7 @@ list_main() {
|
|
|
22
22
|
list_item "shell - List ZSH plugins"
|
|
23
23
|
list_item "ui - List Termux UI components"
|
|
24
24
|
list_item "auto - List automation tools"
|
|
25
|
-
list_item "deploy - List deploy CLIs"
|
|
25
|
+
list_item "deploy - List deploy CLIs (Vercel, Railway, Netlify, Supabase)"
|
|
26
26
|
list_item "games - List games"
|
|
27
27
|
list_item "network - List network tools"
|
|
28
28
|
list_item "utils - List utility scripts"
|
|
@@ -103,10 +103,11 @@ _list_deploy() {
|
|
|
103
103
|
printf " ${D_GREEN}%-18s${NC} %s\n" "vercel" "Frontend & serverless deployment"
|
|
104
104
|
printf " ${D_GREEN}%-18s${NC} %s\n" "railway" "Full-stack with databases"
|
|
105
105
|
printf " ${D_GREEN}%-18s${NC} %s\n" "netlify" "Static sites & edge functions"
|
|
106
|
+
printf " ${D_GREEN}%-18s${NC} %s\n" "supabase" "PostgreSQL, Edge Functions, types, migrations"
|
|
106
107
|
echo
|
|
107
108
|
list_item "Usage: ${D_CYAN}karnel install deploy${NC} to install all"
|
|
108
109
|
list_item "Usage: ${D_CYAN}karnel install deploy --vercel${NC} for specific"
|
|
109
|
-
list_item "
|
|
110
|
+
list_item "Usage: ${D_CYAN}karnel supabase${NC} for Supabase CLI subcommands"
|
|
110
111
|
echo
|
|
111
112
|
}
|
|
112
113
|
|
|
@@ -565,3 +566,5 @@ _list_voice() {
|
|
|
565
566
|
list_item "Usage: ${D_CYAN}karnel install voice${NC}"
|
|
566
567
|
echo
|
|
567
568
|
}
|
|
569
|
+
|
|
570
|
+
|
|
@@ -27,7 +27,7 @@ reinstall_main() {
|
|
|
27
27
|
list_item "games - Reinstall games"
|
|
28
28
|
list_item "network - Reinstall network tools"
|
|
29
29
|
list_item "utils - Reinstall utility scripts"
|
|
30
|
-
list_item "deploy - Reinstall deploy CLIs"
|
|
30
|
+
list_item "deploy - Reinstall deploy CLIs (Vercel, Railway, Netlify, Supabase)"
|
|
31
31
|
list_item "voice - Reinstall voice command"
|
|
32
32
|
list_item "osint - Reinstall OSINT tools"
|
|
33
33
|
echo
|
|
@@ -151,6 +151,10 @@ _reinstall_full_module() {
|
|
|
151
151
|
import "@/modules/security"
|
|
152
152
|
reinstall_security
|
|
153
153
|
;;
|
|
154
|
+
supabase)
|
|
155
|
+
import "@/tools/deploy/supabase/install"
|
|
156
|
+
reinstall_supabase
|
|
157
|
+
;;
|
|
154
158
|
*)
|
|
155
159
|
log_warn "Unknown reinstall target: $target"
|
|
156
160
|
echo "Run 'karnel reinstall' to see available targets"
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
import "@/utils/log"
|
|
4
|
+
import "@/utils/colors"
|
|
5
|
+
|
|
6
|
+
supabase_main() {
|
|
7
|
+
local subcommand="${1:-help}"
|
|
8
|
+
shift 2>/dev/null || true
|
|
9
|
+
|
|
10
|
+
case "$subcommand" in
|
|
11
|
+
help|--help|-h)
|
|
12
|
+
supabase_help
|
|
13
|
+
;;
|
|
14
|
+
doctor)
|
|
15
|
+
supabase_doctor
|
|
16
|
+
;;
|
|
17
|
+
types)
|
|
18
|
+
supabase_types "$@"
|
|
19
|
+
;;
|
|
20
|
+
migrate)
|
|
21
|
+
supabase_migrate "$@"
|
|
22
|
+
;;
|
|
23
|
+
remote-start|remote)
|
|
24
|
+
supabase_remote "$@"
|
|
25
|
+
;;
|
|
26
|
+
remote-status|status)
|
|
27
|
+
supabase_remote_status
|
|
28
|
+
;;
|
|
29
|
+
link)
|
|
30
|
+
supabase_link "$@"
|
|
31
|
+
;;
|
|
32
|
+
install)
|
|
33
|
+
import "@/tools/supabase/all"
|
|
34
|
+
install_supabase
|
|
35
|
+
;;
|
|
36
|
+
uninstall)
|
|
37
|
+
import "@/tools/supabase/all"
|
|
38
|
+
uninstall_supabase
|
|
39
|
+
;;
|
|
40
|
+
*)
|
|
41
|
+
log_error "Unknown supabase subcommand: $subcommand"
|
|
42
|
+
echo
|
|
43
|
+
supabase_help
|
|
44
|
+
return 1
|
|
45
|
+
;;
|
|
46
|
+
esac
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
supabase_help() {
|
|
50
|
+
echo
|
|
51
|
+
box "◈ SUPABASE CLI ◈"
|
|
52
|
+
echo
|
|
53
|
+
log_info "Usage: karnel supabase <subcommand> [options]"
|
|
54
|
+
echo
|
|
55
|
+
separator_section "Subcommands"
|
|
56
|
+
echo
|
|
57
|
+
printf " ${D_CYAN}%-20s${NC} %s\n" "doctor" "Check Supabase environment compatibility"
|
|
58
|
+
printf " ${D_CYAN}%-20s${NC} %s\n" "types" "Generate TypeScript types from remote DB"
|
|
59
|
+
printf " ${D_CYAN}%-20s${NC} %s\n" "migrate" "Run database migrations (remote)"
|
|
60
|
+
printf " ${D_CYAN}%-20s${NC} %s\n" "link" "Link project to Supabase remote"
|
|
61
|
+
printf " ${D_CYAN}%-20s${NC} %s\n" "remote-start" "Start remote services guide"
|
|
62
|
+
printf " ${D_CYAN}%-20s${NC} %s\n" "remote-status" "Check remote connection status"
|
|
63
|
+
printf " ${D_CYAN}%-20s${NC} %s\n" "install" "Install/update Supabase CLI"
|
|
64
|
+
printf " ${D_CYAN}%-20s${NC} %s\n" "uninstall" "Remove Supabase CLI"
|
|
65
|
+
echo
|
|
66
|
+
separator_section "Architecture"
|
|
67
|
+
echo
|
|
68
|
+
log_info "Termux: edit files, run remote commands"
|
|
69
|
+
log_info "Linux host (VPS/Codespaces): Docker + local stack"
|
|
70
|
+
echo
|
|
71
|
+
list_item "Remote commands work via ${D_CYAN}supabase link${NC} + API token"
|
|
72
|
+
list_item "Local stack (${D_CYAN}supabase start${NC}) needs Docker — not supported on Termux"
|
|
73
|
+
echo
|
|
74
|
+
log_info "Examples:"
|
|
75
|
+
list_item "${D_CYAN}karnel supabase doctor${NC} — check environment"
|
|
76
|
+
list_item "${D_CYAN}karnel supabase link --project-ref abcdef${NC}"
|
|
77
|
+
list_item "${D_CYAN}karnel supabase types generate --linked > types/supabase.ts${NC}"
|
|
78
|
+
list_item "${D_CYAN}karnel supabase migrate up${NC}"
|
|
79
|
+
echo
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
supabase_doctor() {
|
|
83
|
+
echo
|
|
84
|
+
box "◈ SUPABASE DOCTOR ◈"
|
|
85
|
+
echo
|
|
86
|
+
log_info "Checking Supabase environment..."
|
|
87
|
+
echo
|
|
88
|
+
|
|
89
|
+
local warnings=0
|
|
90
|
+
|
|
91
|
+
# Check if supabase CLI is installed
|
|
92
|
+
if ! command -v supabase &>/dev/null; then
|
|
93
|
+
log_error "Supabase CLI is not installed"
|
|
94
|
+
log_info "Install with: ${D_CYAN}karnel supabase install${NC}"
|
|
95
|
+
echo
|
|
96
|
+
return 1
|
|
97
|
+
fi
|
|
98
|
+
|
|
99
|
+
local ver
|
|
100
|
+
ver=$(supabase --version 2>/dev/null | head -1)
|
|
101
|
+
log_success "Supabase CLI: $ver"
|
|
102
|
+
|
|
103
|
+
# Check for project linkage
|
|
104
|
+
if [[ -f "supabase/config.toml" ]]; then
|
|
105
|
+
log_success "supabase/config.toml found (project configured)"
|
|
106
|
+
if grep -q "project_id" supabase/config.toml 2>/dev/null; then
|
|
107
|
+
local pid
|
|
108
|
+
pid=$(grep "project_id" supabase/config.toml | head -1 | cut -d'"' -f2)
|
|
109
|
+
log_success "Project ID: ${pid:-configured}"
|
|
110
|
+
fi
|
|
111
|
+
else
|
|
112
|
+
log_warn "No supabase/config.toml in current directory"
|
|
113
|
+
log_info "Run ${D_CYAN}supabase link${NC} in a project with Supabase"
|
|
114
|
+
((warnings++))
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
# Check for Docker (local stack not available)
|
|
118
|
+
if command -v docker &>/dev/null; then
|
|
119
|
+
log_info "Docker available (for Linux host, not Termux)"
|
|
120
|
+
else
|
|
121
|
+
log_info "Docker not available (expected on Termux)"
|
|
122
|
+
fi
|
|
123
|
+
log_info "Local stack (supabase start) requires Docker on a Linux host"
|
|
124
|
+
|
|
125
|
+
# Check network (can reach supabase.com)
|
|
126
|
+
if curl -fsSL --max-time 5 https://api.supabase.com &>/dev/null; then
|
|
127
|
+
log_success "Network: Supabase API reachable"
|
|
128
|
+
else
|
|
129
|
+
log_warn "Cannot reach Supabase API (api.supabase.com)"
|
|
130
|
+
((warnings++))
|
|
131
|
+
fi
|
|
132
|
+
|
|
133
|
+
# Check for linked project
|
|
134
|
+
if supabase status 2>/dev/null | grep -qi "linked\|link"; then
|
|
135
|
+
log_success "Project is linked to Supabase"
|
|
136
|
+
else
|
|
137
|
+
log_info "No linked project in current directory"
|
|
138
|
+
fi
|
|
139
|
+
|
|
140
|
+
echo
|
|
141
|
+
if [[ $warnings -eq 0 ]]; then
|
|
142
|
+
log_success "Supabase environment looks good"
|
|
143
|
+
else
|
|
144
|
+
log_warn "$warnings warning(s) found"
|
|
145
|
+
fi
|
|
146
|
+
echo
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
supabase_types() {
|
|
150
|
+
if ! command -v supabase &>/dev/null; then
|
|
151
|
+
log_error "Supabase CLI not installed — run ${D_CYAN}karnel supabase install${NC}"
|
|
152
|
+
return 1
|
|
153
|
+
fi
|
|
154
|
+
log_info "Generating TypeScript types from Supabase..."
|
|
155
|
+
log_info "Usage: supabase gen types typescript --linked > types/supabase.ts"
|
|
156
|
+
echo
|
|
157
|
+
if [[ -f "supabase/config.toml" ]]; then
|
|
158
|
+
supabase gen types typescript --linked 2>/dev/null
|
|
159
|
+
else
|
|
160
|
+
log_warn "No linked project found"
|
|
161
|
+
log_info "Run ${D_CYAN}supabase link${NC} first or check directory"
|
|
162
|
+
fi
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
supabase_migrate() {
|
|
166
|
+
if ! command -v supabase &>/dev/null; then
|
|
167
|
+
log_error "Supabase CLI not installed — run ${D_CYAN}karnel supabase install${NC}"
|
|
168
|
+
return 1
|
|
169
|
+
fi
|
|
170
|
+
supabase db "$@"
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
supabase_remote() {
|
|
174
|
+
echo
|
|
175
|
+
box "◈ SUPABASE REMOTE ENVIRONMENT ◈"
|
|
176
|
+
echo
|
|
177
|
+
log_info "For full local development, use a Linux host:"
|
|
178
|
+
echo
|
|
179
|
+
list_item "1. SSH into a Linux VPS, Codespaces, or local Linux machine"
|
|
180
|
+
list_item "2. Install Docker: ${D_CYAN}curl -fsSL https://get.docker.com | sh${NC}"
|
|
181
|
+
list_item "3. Install Supabase CLI on that machine"
|
|
182
|
+
list_item "4. Clone your project there"
|
|
183
|
+
list_item "5. Run ${D_CYAN}supabase start${NC} for local stack"
|
|
184
|
+
echo
|
|
185
|
+
log_info "From Termux, you can still:"
|
|
186
|
+
list_item "${D_CYAN}supabase link --project-ref <ref>${NC}"
|
|
187
|
+
list_item "${D_CYAN}supabase db push${NC}"
|
|
188
|
+
list_item "${D_CYAN}supabase db pull${NC}"
|
|
189
|
+
list_item "${D_CYAN}supabase gen types typescript --linked${NC}"
|
|
190
|
+
list_item "${D_CYAN}supabase functions deploy <name>${NC}"
|
|
191
|
+
list_item "${D_CYAN}supabase secrets set NAME=VALUE${NC}"
|
|
192
|
+
echo
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
supabase_remote_status() {
|
|
196
|
+
if ! command -v supabase &>/dev/null; then
|
|
197
|
+
log_error "Supabase CLI not installed"
|
|
198
|
+
return 1
|
|
199
|
+
fi
|
|
200
|
+
supabase status 2>/dev/null || log_warn "Unable to check Supabase status"
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
supabase_link() {
|
|
204
|
+
if ! command -v supabase &>/dev/null; then
|
|
205
|
+
log_error "Supabase CLI not installed — run ${D_CYAN}karnel supabase install${NC}"
|
|
206
|
+
return 1
|
|
207
|
+
fi
|
|
208
|
+
supabase link "$@"
|
|
209
|
+
}
|
|
@@ -27,7 +27,7 @@ uninstall_main() {
|
|
|
27
27
|
list_item "network - Remove network tools"
|
|
28
28
|
list_item "utils - Remove utility scripts"
|
|
29
29
|
list_item "games - Remove games"
|
|
30
|
-
list_item "deploy - Remove deploy CLIs"
|
|
30
|
+
list_item "deploy - Remove deploy CLIs (Vercel, Railway, Netlify, Supabase)"
|
|
31
31
|
list_item "voice - Remove voice command"
|
|
32
32
|
list_item "osint - Remove OSINT tools"
|
|
33
33
|
echo
|
|
@@ -149,6 +149,10 @@ _uninstall_full_module() {
|
|
|
149
149
|
import "@/tools/games/all"
|
|
150
150
|
uninstall_all_games
|
|
151
151
|
;;
|
|
152
|
+
supabase)
|
|
153
|
+
import "@/tools/deploy/supabase/install"
|
|
154
|
+
uninstall_supabase
|
|
155
|
+
;;
|
|
152
156
|
deploy)
|
|
153
157
|
import "@/modules/deploy"
|
|
154
158
|
uninstall_deploy
|
|
@@ -28,7 +28,7 @@ update_main() {
|
|
|
28
28
|
list_item "network - Update network tools"
|
|
29
29
|
list_item "utils - Update utility scripts"
|
|
30
30
|
list_item "games - Update games"
|
|
31
|
-
list_item "deploy - Update deploy CLIs"
|
|
31
|
+
list_item "deploy - Update deploy CLIs (Vercel, Railway, Netlify, Supabase)"
|
|
32
32
|
list_item "voice - Update voice command"
|
|
33
33
|
list_item "osint - Update OSINT tools"
|
|
34
34
|
list_item "security - Update security tools"
|
|
@@ -153,6 +153,10 @@ _update_full_module() {
|
|
|
153
153
|
import "@/modules/security"
|
|
154
154
|
update_security
|
|
155
155
|
;;
|
|
156
|
+
supabase)
|
|
157
|
+
import "@/tools/deploy/supabase/install"
|
|
158
|
+
update_supabase
|
|
159
|
+
;;
|
|
156
160
|
deploy)
|
|
157
161
|
import "@/modules/deploy"
|
|
158
162
|
update_deploy
|
|
@@ -225,7 +229,7 @@ _update_try_git() {
|
|
|
225
229
|
_update_try_npm() {
|
|
226
230
|
command -v npm &>/dev/null || return 1
|
|
227
231
|
log_info "Trying npm update..."
|
|
228
|
-
if npm update -g karnel-termux 2>/dev/null; then
|
|
232
|
+
if npm update -g karnel-termux --ignore-scripts 2>/dev/null; then
|
|
229
233
|
local new_ver
|
|
230
234
|
new_ver=$(npm list -g karnel-termux 2>/dev/null | grep karnel-termux | grep -oP '@\K[0-9.]+' || echo "latest")
|
|
231
235
|
log_success "Updated to v$new_ver via npm"
|
|
@@ -238,7 +242,7 @@ _update_try_npm() {
|
|
|
238
242
|
_update_try_npm_install() {
|
|
239
243
|
command -v npm &>/dev/null || return 1
|
|
240
244
|
log_info "Trying npm install..."
|
|
241
|
-
if npm install -g karnel-termux@latest 2>/dev/null; then
|
|
245
|
+
if npm install -g karnel-termux@latest --ignore-scripts 2>/dev/null; then
|
|
242
246
|
local new_ver
|
|
243
247
|
new_ver=$(npm list -g karnel-termux 2>/dev/null | grep karnel-termux | grep -oP '@\K[0-9.]+' || echo "latest")
|
|
244
248
|
log_success "Updated to v$new_ver via npm install"
|
package/karnel/cli/karnel.sh
CHANGED
|
@@ -85,6 +85,7 @@ karnel_help() {
|
|
|
85
85
|
printf " ${D_CYAN}%-12s${NC} %s\n" "show" "Show README/docs for a tool"
|
|
86
86
|
printf " ${D_CYAN}%-12s${NC} %s\n" "start" "Start services (code-server, etc.)"
|
|
87
87
|
printf " ${D_CYAN}%-12s${NC} %s\n" "status" "Quick system overview"
|
|
88
|
+
printf " ${D_CYAN}%-12s${NC} %s\n" "supabase" "Supabase CLI (types, migrate, functions, secrets)"
|
|
88
89
|
printf " ${D_CYAN}%-12s${NC} %s\n" "uninstall" "Remove installed modules"
|
|
89
90
|
printf " ${D_CYAN}%-12s${NC} %s\n" "update" "Update modules or framework"
|
|
90
91
|
printf " ${D_CYAN}%-12s${NC} %s\n" "upgrade" "Upgrade Karnel framework itself"
|
|
@@ -106,7 +107,7 @@ karnel_help() {
|
|
|
106
107
|
printf " ${D_GREEN}%-10s${NC} %s\n" "ai" "OpenCode, Gentle AI, Claude Code, etc."
|
|
107
108
|
printf " ${D_GREEN}%-10s${NC} %s\n" "auto" "Automation Tools (n8n)"
|
|
108
109
|
printf " ${D_GREEN}%-10s${NC} %s\n" "db" "PostgreSQL, MariaDB, SQLite, MongoDB"
|
|
109
|
-
printf " ${D_GREEN}%-10s${NC} %s\n" "deploy" "Vercel, Railway, Netlify CLIs"
|
|
110
|
+
printf " ${D_GREEN}%-10s${NC} %s\n" "deploy" "Vercel, Railway, Netlify, Supabase CLIs"
|
|
110
111
|
printf " ${D_GREEN}%-10s${NC} %s\n" "dev" "GitHub CLI, wget, curl, fzf, jq, etc."
|
|
111
112
|
printf " ${D_GREEN}%-10s${NC} %s\n" "utils" "File Converter, Notes, QR Code, etc."
|
|
112
113
|
printf " ${D_GREEN}%-10s${NC} %s\n" "editor" "code-server (VS Code in browser)"
|
|
@@ -232,6 +233,7 @@ _tui_main_menu() {
|
|
|
232
233
|
"voice" "Speech-to-Agent" \
|
|
233
234
|
"ia" "AI Agent Manager" \
|
|
234
235
|
"robin" "Dark Web OSINT" \
|
|
236
|
+
"supabase" "Supabase CLI Manager" \
|
|
235
237
|
"doctor" "Run Diagnostics (termux/code)" \
|
|
236
238
|
"search" "Search Tools & Memories" \
|
|
237
239
|
"show" "Show Tool Documentation" \
|
|
@@ -280,6 +282,12 @@ _tui_main_menu() {
|
|
|
280
282
|
echo
|
|
281
283
|
read -r -p "Press Enter to return to menu..." temp
|
|
282
284
|
;;
|
|
285
|
+
supabase)
|
|
286
|
+
clear
|
|
287
|
+
karnel_main "supabase"
|
|
288
|
+
echo
|
|
289
|
+
read -r -p "Press Enter to return to menu..." temp
|
|
290
|
+
;;
|
|
283
291
|
doctor)
|
|
284
292
|
clear
|
|
285
293
|
karnel_main "doctor"
|
|
@@ -362,9 +370,10 @@ _tui_list_menu() {
|
|
|
362
370
|
"network" "Network Tools" \
|
|
363
371
|
"utils" "Utilities" \
|
|
364
372
|
"osint" "OSINT Tools" \
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
373
|
+
"voice" "Voice Commands" \
|
|
374
|
+
"plugin" "Plugin System" \
|
|
375
|
+
"security" "Security Tools" \
|
|
376
|
+
"supabase" "Supabase CLI" \
|
|
368
377
|
"back" "Back to Main Menu")
|
|
369
378
|
local es=$?
|
|
370
379
|
if [[ $es -ne 0 || "$choice" == "back" || -z "$choice" ]]; then
|
|
@@ -517,6 +526,7 @@ _tui_deploy_menu() {
|
|
|
517
526
|
"vercel" "Deploy to Vercel" \
|
|
518
527
|
"railway" "Deploy to Railway" \
|
|
519
528
|
"netlify" "Deploy to Netlify" \
|
|
529
|
+
"supabase" "Supabase CLI (remote commands)" \
|
|
520
530
|
"back" "Back to Main Menu")
|
|
521
531
|
local es=$?
|
|
522
532
|
if [[ $es -ne 0 || "$choice" == "back" || -z "$choice" ]]; then
|
|
@@ -667,6 +677,7 @@ _tui_install_menu() {
|
|
|
667
677
|
"utils" "Utility Scripts (Fconv, Notes, QR Code)" \
|
|
668
678
|
"shell" "ZSH + Oh My Zsh + Plugins" \
|
|
669
679
|
"ui" "Termux UI (font, cursor, extra-keys, banner)" \
|
|
680
|
+
"supabase" "Supabase CLI" \
|
|
670
681
|
"voice" "Speech-to-Agent via microphone" \
|
|
671
682
|
"back" "Back to Main Menu")
|
|
672
683
|
|
|
@@ -4,7 +4,7 @@ import "@/utils/log"
|
|
|
4
4
|
|
|
5
5
|
LOG_FILE="$KARNEL_CACHE/install_deploy.log"
|
|
6
6
|
|
|
7
|
-
DEPLOY_TOOLS=("railway" "netlify" "vercel")
|
|
7
|
+
DEPLOY_TOOLS=("railway" "netlify" "vercel" "supabase")
|
|
8
8
|
|
|
9
9
|
for _tool in "${DEPLOY_TOOLS[@]}"; do
|
|
10
10
|
source "$(dirname "$BASH_SOURCE")/$_tool/install.sh"
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
_SUPABASE_VERSION="2.20.8"
|
|
4
|
+
_SUPABASE_RELEASE_URL="https://github.com/supabase/cli/releases/download/v${_SUPABASE_VERSION}"
|
|
5
|
+
_SUPABASE_BIN="$PREFIX/bin/supabase"
|
|
6
|
+
|
|
7
|
+
install_supabase() {
|
|
8
|
+
if command -v supabase &>/dev/null; then
|
|
9
|
+
local current
|
|
10
|
+
current=$(supabase --version 2>/dev/null | grep -oP '\d+\.\d+\.\d+' || echo "unknown")
|
|
11
|
+
if [[ "$current" == "$_SUPABASE_VERSION" ]]; then
|
|
12
|
+
log_info "supabase v$_SUPABASE_VERSION already installed"
|
|
13
|
+
return 2
|
|
14
|
+
fi
|
|
15
|
+
log_info "Updating supabase $current → v$_SUPABASE_VERSION..."
|
|
16
|
+
else
|
|
17
|
+
log_info "Installing supabase v$_SUPABASE_VERSION..."
|
|
18
|
+
fi
|
|
19
|
+
|
|
20
|
+
local arch
|
|
21
|
+
arch=$(uname -m)
|
|
22
|
+
local go_arch
|
|
23
|
+
case "$arch" in
|
|
24
|
+
aarch64|arm64) go_arch="arm64" ;;
|
|
25
|
+
x86_64|amd64) go_arch="amd64" ;;
|
|
26
|
+
*) log_error "Unsupported architecture: $arch"; return 1 ;;
|
|
27
|
+
esac
|
|
28
|
+
|
|
29
|
+
local filename="supabase_${_SUPABASE_VERSION}_linux_${go_arch}.tar.gz"
|
|
30
|
+
local url="${_SUPABASE_RELEASE_URL}/${filename}"
|
|
31
|
+
local checksum_url="${_SUPABASE_RELEASE_URL}/checksums.txt"
|
|
32
|
+
local tmp_dir
|
|
33
|
+
tmp_dir=$(mktemp -d)
|
|
34
|
+
|
|
35
|
+
# Download binary
|
|
36
|
+
loading "Downloading supabase" curl -fsSL "$url" -o "$tmp_dir/$filename"
|
|
37
|
+
if [[ $? -ne 0 || ! -f "$tmp_dir/$filename" ]]; then
|
|
38
|
+
rm -rf "$tmp_dir"
|
|
39
|
+
log_error "Failed to download supabase"
|
|
40
|
+
return 1
|
|
41
|
+
fi
|
|
42
|
+
|
|
43
|
+
# Download checksums (optional — warn if unavailable rather than fail)
|
|
44
|
+
local checksum_ok=false
|
|
45
|
+
if curl -fsSL "$checksum_url" -o "$tmp_dir/checksums.txt" 2>/dev/null; then
|
|
46
|
+
local expected
|
|
47
|
+
expected=$(grep "$filename" "$tmp_dir/checksums.txt" | awk '{print $1}')
|
|
48
|
+
if [[ -n "$expected" ]]; then
|
|
49
|
+
local actual
|
|
50
|
+
actual=$(sha256sum "$tmp_dir/$filename" | awk '{print $1}')
|
|
51
|
+
if [[ "$expected" == "$actual" ]]; then
|
|
52
|
+
checksum_ok=true
|
|
53
|
+
log_success "Checksum verified"
|
|
54
|
+
else
|
|
55
|
+
log_warn "Checksum mismatch! Expected $expected, got $actual"
|
|
56
|
+
read_confirm "Continue with unverified binary?" confirm
|
|
57
|
+
[[ "$confirm" != "y" ]] && { rm -rf "$tmp_dir"; log_info "Cancelled"; return 1; }
|
|
58
|
+
fi
|
|
59
|
+
fi
|
|
60
|
+
fi
|
|
61
|
+
if ! $checksum_ok; then
|
|
62
|
+
log_warn "Checksum verification skipped (no checksums available)"
|
|
63
|
+
fi
|
|
64
|
+
|
|
65
|
+
# Extract
|
|
66
|
+
tar -xzf "$tmp_dir/$filename" -C "$tmp_dir" supabase 2>/dev/null
|
|
67
|
+
if [[ ! -f "$tmp_dir/supabase" ]]; then
|
|
68
|
+
rm -rf "$tmp_dir"
|
|
69
|
+
log_error "Extraction failed"
|
|
70
|
+
return 1
|
|
71
|
+
fi
|
|
72
|
+
|
|
73
|
+
# Install
|
|
74
|
+
cp "$tmp_dir/supabase" "$_SUPABASE_BIN"
|
|
75
|
+
chmod +x "$_SUPABASE_BIN"
|
|
76
|
+
rm -rf "$tmp_dir"
|
|
77
|
+
|
|
78
|
+
log_success "supabase v$_SUPABASE_VERSION installed ($(du -h "$_SUPABASE_BIN" | awk '{print $1}'))"
|
|
79
|
+
|
|
80
|
+
# Doctor check
|
|
81
|
+
if command -v supabase &>/dev/null; then
|
|
82
|
+
local ver
|
|
83
|
+
ver=$(supabase --version 2>/dev/null | head -1)
|
|
84
|
+
log_info "supabase ready: $ver"
|
|
85
|
+
echo
|
|
86
|
+
log_info "Run 'karnel supabase doctor' for environment check"
|
|
87
|
+
fi
|
|
88
|
+
|
|
89
|
+
return 0
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
uninstall_supabase() {
|
|
93
|
+
if [[ ! -f "$_SUPABASE_BIN" ]]; then
|
|
94
|
+
log_info "supabase is not installed"
|
|
95
|
+
return 2
|
|
96
|
+
fi
|
|
97
|
+
log_info "Removing supabase..."
|
|
98
|
+
rm -f "$_SUPABASE_BIN" "$HOME/.supabase"
|
|
99
|
+
log_success "supabase removed"
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
update_supabase() {
|
|
103
|
+
install_supabase
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
reinstall_supabase() {
|
|
107
|
+
uninstall_supabase
|
|
108
|
+
install_supabase
|
|
109
|
+
}
|
package/karnel/utils/env.sh
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "karnel-termux",
|
|
3
|
-
"version": "4.11.
|
|
3
|
+
"version": "4.11.5",
|
|
4
4
|
"description": "Modular Dev Environment for Termux — install languages, databases, AI agents, editors, and more with one command",
|
|
5
5
|
"bin": {
|
|
6
6
|
"karnel": "karnel/bin/karnel"
|
|
@@ -40,8 +40,5 @@
|
|
|
40
40
|
"bugs": {
|
|
41
41
|
"url": "https://github.com/israelmarques1024-dotcom/karnel-termux/issues"
|
|
42
42
|
},
|
|
43
|
-
"homepage": "https://karneltermux.vercel.app"
|
|
44
|
-
"os": [
|
|
45
|
-
"android"
|
|
46
|
-
]
|
|
43
|
+
"homepage": "https://karneltermux.vercel.app"
|
|
47
44
|
}
|