karajan-code 1.42.0 → 1.43.0
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 +8 -0
- package/package.json +1 -1
- package/scripts/install-kj.sh +193 -0
package/README.md
CHANGED
|
@@ -52,6 +52,14 @@ If Claude Code is a smart pair programmer, Karajan is the CI/CD pipeline for AI-
|
|
|
52
52
|
|
|
53
53
|
## Install
|
|
54
54
|
|
|
55
|
+
**One-liner** (detects your OS, installs via npm):
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
curl -fsSL https://raw.githubusercontent.com/manufosela/karajan-code/main/scripts/install-kj.sh | sh
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Or directly with npm:**
|
|
62
|
+
|
|
55
63
|
```bash
|
|
56
64
|
npm install -g karajan-code
|
|
57
65
|
```
|
package/package.json
CHANGED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
# Karajan Code - Universal Installer
|
|
3
|
+
# Usage: curl -fsSL https://raw.githubusercontent.com/manufosela/karajan-code/main/scripts/install-kj.sh | sh
|
|
4
|
+
#
|
|
5
|
+
# Installs karajan-code globally via npm if Node.js >= 18 is available.
|
|
6
|
+
# If Node.js is not installed, prints platform-specific instructions.
|
|
7
|
+
|
|
8
|
+
# --- Color support ---
|
|
9
|
+
setup_colors() {
|
|
10
|
+
if [ -t 1 ] && command -v tput >/dev/null 2>&1 && [ "$(tput colors 2>/dev/null || echo 0)" -ge 8 ]; then
|
|
11
|
+
BOLD="$(tput bold)"
|
|
12
|
+
GREEN="$(tput setaf 2)"
|
|
13
|
+
YELLOW="$(tput setaf 3)"
|
|
14
|
+
RED="$(tput setaf 1)"
|
|
15
|
+
CYAN="$(tput setaf 6)"
|
|
16
|
+
RESET="$(tput sgr0)"
|
|
17
|
+
else
|
|
18
|
+
BOLD="" GREEN="" YELLOW="" RED="" CYAN="" RESET=""
|
|
19
|
+
fi
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
info() { printf '%s[info]%s %s\n' "$CYAN" "$RESET" "$1"; }
|
|
23
|
+
success() { printf '%s[ok]%s %s\n' "$GREEN" "$RESET" "$1"; }
|
|
24
|
+
warn() { printf '%s[warn]%s %s\n' "$YELLOW" "$RESET" "$1"; }
|
|
25
|
+
error() { printf '%s[error]%s %s\n' "$RED" "$RESET" "$1"; }
|
|
26
|
+
|
|
27
|
+
# --- Platform detection ---
|
|
28
|
+
detect_platform() {
|
|
29
|
+
OS="$(uname -s)"
|
|
30
|
+
ARCH="$(uname -m)"
|
|
31
|
+
|
|
32
|
+
case "$OS" in
|
|
33
|
+
Linux*) PLATFORM="linux" ;;
|
|
34
|
+
Darwin*) PLATFORM="macos" ;;
|
|
35
|
+
MINGW*|MSYS*|CYGWIN*) PLATFORM="windows" ;;
|
|
36
|
+
*) PLATFORM="unknown" ;;
|
|
37
|
+
esac
|
|
38
|
+
|
|
39
|
+
case "$ARCH" in
|
|
40
|
+
x86_64|amd64) ARCH="x64" ;;
|
|
41
|
+
aarch64|arm64) ARCH="arm64" ;;
|
|
42
|
+
*) ARCH="$ARCH" ;;
|
|
43
|
+
esac
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
# --- Check Node.js ---
|
|
47
|
+
check_node() {
|
|
48
|
+
if ! command -v node >/dev/null 2>&1; then
|
|
49
|
+
return 1
|
|
50
|
+
fi
|
|
51
|
+
|
|
52
|
+
NODE_VERSION="$(node --version 2>/dev/null | sed 's/^v//')"
|
|
53
|
+
NODE_MAJOR="$(echo "$NODE_VERSION" | cut -d. -f1)"
|
|
54
|
+
|
|
55
|
+
if [ "$NODE_MAJOR" -lt 18 ] 2>/dev/null; then
|
|
56
|
+
warn "Node.js v${NODE_VERSION} found, but v18+ is required."
|
|
57
|
+
return 1
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
return 0
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
# --- Print Node.js install instructions ---
|
|
64
|
+
print_node_instructions() {
|
|
65
|
+
echo ""
|
|
66
|
+
error "Node.js >= 18 is required but not found."
|
|
67
|
+
echo ""
|
|
68
|
+
printf '%sInstall Node.js for your platform:%s\n' "$BOLD" "$RESET"
|
|
69
|
+
echo ""
|
|
70
|
+
|
|
71
|
+
case "$PLATFORM" in
|
|
72
|
+
linux)
|
|
73
|
+
echo " Option 1 - nvm (recommended):"
|
|
74
|
+
echo " curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash"
|
|
75
|
+
echo " nvm install 22"
|
|
76
|
+
echo ""
|
|
77
|
+
echo " Option 2 - NodeSource:"
|
|
78
|
+
echo " curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -"
|
|
79
|
+
echo " sudo apt-get install -y nodejs"
|
|
80
|
+
;;
|
|
81
|
+
macos)
|
|
82
|
+
echo " Option 1 - nvm (recommended):"
|
|
83
|
+
echo " curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash"
|
|
84
|
+
echo " nvm install 22"
|
|
85
|
+
echo ""
|
|
86
|
+
echo " Option 2 - Homebrew:"
|
|
87
|
+
echo " brew install node@22"
|
|
88
|
+
;;
|
|
89
|
+
windows)
|
|
90
|
+
echo " Option 1 - nvm-windows:"
|
|
91
|
+
echo " https://github.com/coreybutler/nvm-windows/releases"
|
|
92
|
+
echo ""
|
|
93
|
+
echo " Option 2 - Download installer:"
|
|
94
|
+
echo " https://nodejs.org/en/download/"
|
|
95
|
+
;;
|
|
96
|
+
*)
|
|
97
|
+
echo " Download from: https://nodejs.org/en/download/"
|
|
98
|
+
;;
|
|
99
|
+
esac
|
|
100
|
+
|
|
101
|
+
echo ""
|
|
102
|
+
echo " After installing Node.js, re-run this script:"
|
|
103
|
+
echo " curl -fsSL https://raw.githubusercontent.com/manufosela/karajan-code/main/scripts/install-kj.sh | sh"
|
|
104
|
+
echo ""
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
# --- Install via npm ---
|
|
108
|
+
install_karajan() {
|
|
109
|
+
info "Installing karajan-code via npm..."
|
|
110
|
+
echo ""
|
|
111
|
+
|
|
112
|
+
if npm install -g karajan-code; then
|
|
113
|
+
success "karajan-code installed successfully."
|
|
114
|
+
else
|
|
115
|
+
echo ""
|
|
116
|
+
error "npm install failed."
|
|
117
|
+
echo ""
|
|
118
|
+
echo " Common fixes:"
|
|
119
|
+
echo " - Permission error? Use: sudo npm install -g karajan-code"
|
|
120
|
+
echo " - Or configure npm prefix: https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally"
|
|
121
|
+
echo ""
|
|
122
|
+
exit 1
|
|
123
|
+
fi
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
# --- Verify installation ---
|
|
127
|
+
verify_install() {
|
|
128
|
+
echo ""
|
|
129
|
+
if command -v kj >/dev/null 2>&1; then
|
|
130
|
+
KJ_VERSION="$(kj --version 2>/dev/null || echo "unknown")"
|
|
131
|
+
success "kj ${KJ_VERSION} is ready."
|
|
132
|
+
else
|
|
133
|
+
warn "kj command not found in PATH. You may need to restart your shell."
|
|
134
|
+
return 1
|
|
135
|
+
fi
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
# --- Run kj init ---
|
|
139
|
+
run_init() {
|
|
140
|
+
if command -v kj >/dev/null 2>&1; then
|
|
141
|
+
info "Running kj init to detect installed agents..."
|
|
142
|
+
echo ""
|
|
143
|
+
kj init --no-interactive 2>/dev/null || true
|
|
144
|
+
echo ""
|
|
145
|
+
fi
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
# --- Print next steps ---
|
|
149
|
+
print_next_steps() {
|
|
150
|
+
echo ""
|
|
151
|
+
printf '%s%s--- Karajan Code installed ---%s\n' "$BOLD" "$GREEN" "$RESET"
|
|
152
|
+
echo ""
|
|
153
|
+
echo " Next steps:"
|
|
154
|
+
echo ""
|
|
155
|
+
echo " 1. Go to a project directory:"
|
|
156
|
+
echo " cd your-project/"
|
|
157
|
+
echo ""
|
|
158
|
+
echo " 2. Run from CLI:"
|
|
159
|
+
echo " kj run \"Add input validation with tests\""
|
|
160
|
+
echo ""
|
|
161
|
+
echo " 3. Or use as MCP server inside Claude Code / Codex:"
|
|
162
|
+
echo " The MCP server auto-registers during install."
|
|
163
|
+
echo " Open kj-tail in a separate terminal to see pipeline output."
|
|
164
|
+
echo ""
|
|
165
|
+
echo " Docs: https://karajancode.com"
|
|
166
|
+
echo ""
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
# --- Main ---
|
|
170
|
+
main() {
|
|
171
|
+
setup_colors
|
|
172
|
+
|
|
173
|
+
echo ""
|
|
174
|
+
printf '%s%sKarajan Code Installer%s\n' "$BOLD" "$CYAN" "$RESET"
|
|
175
|
+
echo ""
|
|
176
|
+
|
|
177
|
+
detect_platform
|
|
178
|
+
info "Detected: ${PLATFORM} (${ARCH})"
|
|
179
|
+
|
|
180
|
+
if ! check_node; then
|
|
181
|
+
print_node_instructions
|
|
182
|
+
exit 1
|
|
183
|
+
fi
|
|
184
|
+
|
|
185
|
+
success "Node.js v${NODE_VERSION} detected."
|
|
186
|
+
|
|
187
|
+
install_karajan
|
|
188
|
+
verify_install
|
|
189
|
+
run_init
|
|
190
|
+
print_next_steps
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
main
|