-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·73 lines (64 loc) · 2.2 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·73 lines (64 loc) · 2.2 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
#!/usr/bin/env bash
# wolai-mcp-macos installer
set -euo pipefail
REPO_DIR="$(cd "$(dirname "$0")" && pwd)"
WOLAI_HOME="$HOME/.wolai"
TOKENS_FILE="$WOLAI_HOME/tokens.env"
ZSHRC="$HOME/.zshrc"
CLAUDE_SKILLS="$HOME/.claude/skills"
bold() { printf "\033[1m%s\033[0m\n" "$*"; }
green() { printf "\033[32m%s\033[0m\n" "$*"; }
yellow(){ printf "\033[33m%s\033[0m\n" "$*"; }
red() { printf "\033[31m%s\033[0m\n" "$*"; }
bold "wolai-mcp-macos installer"
echo "--------------------------------"
# --- 1. install shell functions ---
mkdir -p "$WOLAI_HOME"
cp "$REPO_DIR/shell/wolai.sh" "$WOLAI_HOME/wolai.sh"
green "[1/4] copied shell/wolai.sh -> $WOLAI_HOME/wolai.sh"
WOLAI_DIR_LINE="export WOLAI_DIR=\"$REPO_DIR\""
SOURCE_LINE='[ -f ~/.wolai/wolai.sh ] && source ~/.wolai/wolai.sh'
if ! grep -qF "$SOURCE_LINE" "$ZSHRC" 2>/dev/null; then
{
echo ""
echo "# wolai-mcp-macos"
echo "$WOLAI_DIR_LINE"
echo "$SOURCE_LINE"
} >> "$ZSHRC"
green "[2/4] added source line to $ZSHRC"
else
yellow "[2/4] $ZSHRC already sources wolai.sh, skipping"
fi
# --- 3. tokens.env ---
if [ ! -f "$TOKENS_FILE" ]; then
cat > "$TOKENS_FILE" <<'EOF'
# wolai MCP tokens — define one or more profiles
# Each profile: WOLAI_TOKEN_<UPPERNAME>="sk-..."
# Switch profiles in shell with: wolai_use <name>
export WOLAI_TOKEN_DEFAULT="sk-PASTE-YOUR-DEFAULT-TOKEN-HERE"
# export WOLAI_TOKEN_PERSONAL="sk-..."
# export WOLAI_TOKEN_WORK="sk-..."
EOF
chmod 600 "$TOKENS_FILE"
green "[3/4] created $TOKENS_FILE (template, mode 600)"
yellow " Edit it to add your actual tokens."
else
yellow "[3/4] $TOKENS_FILE already exists, skipping"
fi
# --- 4. claude code skill ---
if [ -d "$CLAUDE_SKILLS" ]; then
mkdir -p "$CLAUDE_SKILLS/wolai-mcp"
cp "$REPO_DIR/skills/wolai-mcp/SKILL.md" "$CLAUDE_SKILLS/wolai-mcp/SKILL.md"
green "[4/4] installed Claude Code skill -> $CLAUDE_SKILLS/wolai-mcp/"
else
yellow "[4/4] $CLAUDE_SKILLS not found, skipped Claude Code skill install"
fi
echo ""
bold "Done."
echo ""
echo "Next steps:"
echo " 1. Edit your tokens: open $TOKENS_FILE"
echo " 2. Reload shell: source ~/.zshrc"
echo " 3. List profiles: wolai_profiles"
echo " 4. Test connection: wolai_call list_docs '{\"limit\":5}'"
echo ""