-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev.sh
More file actions
executable file
·65 lines (59 loc) · 2.26 KB
/
dev.sh
File metadata and controls
executable file
·65 lines (59 loc) · 2.26 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
#!/bin/bash
# Quick development runner for kuuzuki
# Usage: ./dev.sh [tui|server|watch]
set -e
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
case "$1" in
"server")
echo "Starting server on port ${2:-8080}..."
bun run packages/kuuzuki/src/index.ts serve --port ${2:-8080}
;;
"watch")
echo "Starting TUI development mode..."
echo "This will run TUI once without auto-restart to avoid the reset issues."
echo "When you make changes, manually restart with: bun dev"
echo "----------------------------------------"
# Just run once - much more stable for development
bun packages/kuuzuki/src/index.ts tui
;;
"autowatch")
echo "Starting TUI with auto-restart (may be unstable)..."
echo "File changes will restart the TUI. Use Ctrl+C to stop."
echo "If this keeps resetting, use 'bun dev' instead."
echo "----------------------------------------"
# The original auto-watch for when you really need it
bun --watch --watch-path="packages/kuuzuki/src" packages/kuuzuki/src/index.ts tui
;;
"link")
echo "Setting up global commands..."
cd "$SCRIPT_DIR/packages/kuuzuki"
bun link
echo "✓ Linked! You can now use 'kuuzuki' globally"
;;
"unlink")
echo "Removing global commands..."
cd "$SCRIPT_DIR/packages/kuuzuki"
bun unlink
echo "✓ Unlinked!"
;;
"tui"|"")
echo "Starting TUI..."
bun run packages/kuuzuki/src/index.ts
;;
*)
echo "Usage: ./dev.sh [command]"
echo ""
echo "Commands:"
echo " tui Run TUI mode (default)"
echo " server [port] Run server mode"
echo " watch Run TUI once (stable, manual restart)"
echo " autowatch Run TUI with auto-restart (may be unstable)"
echo " link Set up global 'kuuzuki' command"
echo " unlink Remove global command"
echo ""
echo "Development tips:"
echo " - Use 'watch' for stable development (recommended)"
echo " - Use 'autowatch' only if you need auto-restart"
echo " - Use 'tui' for production-like testing"
;;
esac