Skip to content

Commit fe71b44

Browse files
committed
feat: auto-install uv and optional voice model download in install.sh
- install.sh now installs uv automatically if not found - Prompts user to download kokoro-onnx voice model (~85MB) - Updated README, setup guide, and voice output docs
1 parent 39d3687 commit fe71b44

4 files changed

Lines changed: 60 additions & 13 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ cd socratic-study-mentor
103103
./scripts/install.sh
104104
```
105105

106-
This installs both packages and sets up agent definitions for any detected AI tools.
106+
This installs both packages, sets up agent definitions for any detected AI tools, and optionally downloads the voice model for TTS support.
107107

108108
## Documentation Site
109109

‎docs/setup-guide.md‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@ cd socratic-study-mentor
3333
```
3434

3535
This will:
36-
1. Verify Python 3.10+ and `uv` are installed
37-
2. Run `uv sync` to install both packages
38-
3. Run `install-agents.sh` to set up AI agent definitions
39-
4. Create a default config at `~/.config/studyctl/config.yaml`
36+
1. Verify Python 3.10+ is installed
37+
2. Install `uv` if not already available
38+
3. Run `uv sync` to install both packages
39+
4. Run `install-agents.sh` to set up AI agent definitions
40+
5. Create a default config at `~/.config/studyctl/config.yaml`
41+
6. Optionally download the kokoro-onnx voice model (~85MB) for TTS support
4042

4143
### Manual
4244

‎docs/voice-output.md‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ uv tool install "./packages/agent-session-tools[tts]" --force
1414

1515
### Download Models
1616

17-
Models download automatically on first run. To pre-download:
17+
Models download automatically on first run. The install script also offers to pre-download them:
18+
19+
```bash
20+
./scripts/install.sh # prompts: "Download voice model now? [y/N]"
21+
```
22+
23+
To download manually:
1824

1925
```bash
2026
mkdir -p ~/.cache/kokoro-onnx && \
21-
wget -q https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/kokoro-v1.0.onnx \
22-
-O ~/.cache/kokoro-onnx/kokoro-v1.0.onnx && \
23-
wget -q https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/voices-v1.0.bin \
24-
-O ~/.cache/kokoro-onnx/voices-v1.0.bin
27+
curl -fsSL https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/kokoro-v1.0.onnx \
28+
-o ~/.cache/kokoro-onnx/kokoro-v1.0.onnx && \
29+
curl -fsSL https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0/voices-v1.0.bin \
30+
-o ~/.cache/kokoro-onnx/voices-v1.0.bin
2531
```
2632

2733
### Test

‎scripts/install.sh‎

Lines changed: 42 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,15 @@ fi
3737
if command -v uv &>/dev/null; then
3838
info "uv $(uv --version 2>/dev/null | head -1) found"
3939
else
40-
err "uv not found. Install with:"
41-
echo " curl -LsSf https://astral.sh/uv/install.sh | sh"
42-
exit 1
40+
warn "uv not found — installing..."
41+
curl -LsSf https://astral.sh/uv/install.sh | sh
42+
export PATH="$HOME/.local/bin:$PATH"
43+
if command -v uv &>/dev/null; then
44+
info "uv $(uv --version 2>/dev/null | head -1) installed"
45+
else
46+
err "uv installation failed"
47+
exit 1
48+
fi
4349
fi
4450

4551
# --- Install packages ---
@@ -110,6 +116,39 @@ EOF
110116
fi
111117
fi
112118

119+
# --- Optional: Voice model ---
120+
KOKORO_DIR="${HOME}/.cache/kokoro-onnx"
121+
KOKORO_MODEL="${KOKORO_DIR}/kokoro-v1.0.onnx"
122+
KOKORO_VOICES="${KOKORO_DIR}/voices-v1.0.bin"
123+
KOKORO_BASE="https://github.com/thewh1teagle/kokoro-onnx/releases/download/model-files-v1.0"
124+
125+
if [ -f "$KOKORO_MODEL" ] && [ -f "$KOKORO_VOICES" ]; then
126+
info "Voice model already downloaded"
127+
else
128+
echo ""
129+
printf "${BOLD}▸ Voice output (optional)${NC}\n"
130+
echo " The study mentor can speak questions aloud using kokoro-onnx TTS (~85MB download)."
131+
printf " Download voice model now? [y/N] "
132+
read -r REPLY
133+
if [[ "$REPLY" =~ ^[Yy]$ ]]; then
134+
mkdir -p "$KOKORO_DIR"
135+
for name in kokoro-v1.0.onnx voices-v1.0.bin; do
136+
if [ ! -f "${KOKORO_DIR}/${name}" ]; then
137+
echo " Downloading ${name}..."
138+
curl -fsSL "${KOKORO_BASE}/${name}" -o "${KOKORO_DIR}/${name}" || {
139+
err "Failed to download ${name}"
140+
rm -f "${KOKORO_DIR}/${name}"
141+
}
142+
fi
143+
done
144+
if [ -f "$KOKORO_MODEL" ] && [ -f "$KOKORO_VOICES" ]; then
145+
info "Voice model downloaded to ${KOKORO_DIR}"
146+
fi
147+
else
148+
info "Skipped — models will download on first use of study-speak"
149+
fi
150+
fi
151+
113152
# --- Summary ---
114153
echo ""
115154
printf "${BOLD}${GREEN}Installation complete!${NC}\n"

0 commit comments

Comments
 (0)