-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
111 lines (95 loc) · 4.38 KB
/
Copy pathjustfile
File metadata and controls
111 lines (95 loc) · 4.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Minsky Build Justfile
# Cross-platform binary builds using Bun
# Default recipe lists available commands
default:
@just --list
# Build for current platform
build:
bun build --compile --outfile=minsky ./src/cli.ts
# Build for specific platforms
build-linux:
bun build --compile --target=bun-linux-x64 --outfile=minsky-linux-x64 ./src/cli.ts
build-linux-arm64:
bun build --compile --target=bun-linux-arm64 --outfile=minsky-linux-arm64 ./src/cli.ts
build-macos:
bun build --compile --target=bun-darwin-x64 --outfile=minsky-macos-x64 ./src/cli.ts
build-macos-arm64:
bun build --compile --target=bun-darwin-arm64 --outfile=minsky-macos-arm64 ./src/cli.ts
build-windows:
bun build --compile --target=bun-windows-x64 --outfile=minsky-windows-x64.exe ./src/cli.ts
# Build all platforms
build-all: build-linux build-linux-arm64 build-macos build-macos-arm64 build-windows
# Clean build artifacts
clean:
rm -f minsky minsky-linux-x64 minsky-linux-arm64 minsky-macos-x64 minsky-macos-arm64 minsky-windows-x64.exe
# Test the built binary
test-binary: build
./minsky --version
./minsky --help
# ---------------------------------------------------------------------------
# Supabase operations
# ---------------------------------------------------------------------------
# `supabase-usage` resolves a Supabase Management API token in this precedence:
# 1. $SUPABASE_ACCESS_TOKEN env var (highest)
# 2. minsky config: supabase.accessToken (e.g. via ~/.config/minsky/config.yaml)
# 3. ERROR (none set)
# `supabase-health` only needs the local Supabase CLI to be linked — no PAT.
#
# Token sources (any of these, set whichever is most convenient):
# - macOS: SUPABASE_ACCESS_TOKEN="$(cat "$HOME/Library/Application Support/supabase/access-token")"
# - Linux: SUPABASE_ACCESS_TOKEN="$(cat "$HOME/.config/supabase/access-token")"
# - Windows: see Supabase CLI docs (path varies)
# - Generate a scoped PAT at https://supabase.com/dashboard/account/tokens
# - Persist it in ~/.config/minsky/config.yaml under `supabase.accessToken`
# (or set MINSKY_SUPABASE_ACCESS_TOKEN env var)
#
# `:= "..."` is just's string-literal syntax; the value substituted via
# {{PROJECT_REF}} is the unquoted string `yvkkrpyjhoiilmizlnac`.
# See docs/supabase-alerts.md for the full alert-rule runbook.
PROJECT_REF := "yvkkrpyjhoiilmizlnac" # minsky (dev 2)
# List the project's daily/usage stats — useful for setting threshold values
supabase-usage:
#!/bin/sh
set -eu
token="${SUPABASE_ACCESS_TOKEN:-}"
if [ -z "$token" ]; then
token="$(minsky config get supabase.accessToken 2>/dev/null || true)"
fi
if [ -z "$token" ]; then
echo "Supabase access token not found; see justfile header for sources" >&2
exit 1
fi
# Capture curl output separately so a non-zero curl exit (e.g., 401, 5xx)
# is not masked by jq's exit code under POSIX `sh` (no `pipefail`).
response="$(curl -fsS -H "Authorization: Bearer $token" \
"https://api.supabase.com/v1/projects/{{PROJECT_REF}}/usage")"
printf '%s\n' "$response" | jq
# Probe DB health via the local supabase CLI's auth (no PAT required if linked)
supabase-health:
@command -v supabase >/dev/null || { echo "supabase CLI not installed; install from https://supabase.com/docs/guides/cli"; exit 1; }
supabase projects list
@echo "---"
@echo "DB ping via execute_sql is in the Minsky MCP supabase tool; no CLI equivalent."
# Restart the Supabase project (full restart — resets Supavisor circuit breaker).
# DESTRUCTIVE. Default: dry-run (preview only). Add EXECUTE=1 to actually restart.
# See scripts/supabase/restart-project.ts and docs/incidents/2026-06-28-supabase-connectivity-breaker.md
supabase-restart:
#!/bin/sh
set -eu
if [ "${EXECUTE:-}" = "1" ]; then
bun scripts/supabase/restart-project.ts --execute
else
bun scripts/supabase/restart-project.ts
fi
# Test macOS binaries specifically (runs on macOS)
test-macos-binaries: build-macos build-macos-arm64
@echo "Testing macOS x64 binary:"
./minsky-macos-x64 --version
./minsky-macos-x64 tasks --help > /dev/null
@echo "✅ macOS x64 binary working"
@echo "Testing macOS ARM64 binary:"
./minsky-macos-arm64 --version
./minsky-macos-arm64 tasks --help > /dev/null
@echo "✅ macOS ARM64 binary working"
@echo "Binary sizes:"
@ls -lah minsky-macos-* | awk '{print $9 ": " $5}'