-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
ยท111 lines (93 loc) ยท 2.93 KB
/
setup.sh
File metadata and controls
executable file
ยท111 lines (93 loc) ยท 2.93 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
#!/bin/bash
echo "๐ Setting up Copilot Ollama Bridge Extension"
echo "============================================="
# Check if Node.js and npm are installed
if ! command -v npm &> /dev/null; then
echo "โ Error: npm is not installed. Please install Node.js and npm first."
echo " Visit: https://nodejs.org/"
exit 1
fi
# Check if VS Code is installed
if ! command -v code &> /dev/null; then
echo "โ Error: VS Code is not installed or not in PATH."
echo " Please install VS Code first: https://code.visualstudio.com/"
exit 1
fi
echo "โ
Prerequisites check passed"
# Install dependencies
echo "๐ฆ Installing dependencies..."
npm install
if [ $? -ne 0 ]; then
echo "โ Failed to install dependencies"
exit 1
fi
# Compile TypeScript
echo "๐จ Compiling TypeScript..."
npm run compile
if [ $? -ne 0 ]; then
echo "โ Failed to compile TypeScript"
exit 1
fi
echo "โ
Extension compiled successfully"
# Check if vsce is available
if ! command -v vsce &> /dev/null; then
echo "๐ฅ Installing vsce (VS Code Extension Manager)..."
npm install -g @vscode/vsce
fi
# Package the extension
echo "๐ฆ Packaging extension..."
npx vsce package
if [ $? -ne 0 ]; then
echo "โ Failed to package extension"
exit 1
fi
# Find the generated .vsix file
VSIX_FILE=$(find . -name "*.vsix" | head -1)
if [ -z "$VSIX_FILE" ]; then
echo "โ No .vsix file found"
exit 1
fi
echo "โ
Extension packaged: $VSIX_FILE"
# Install the extension
echo "๐ง Installing extension in VS Code..."
code --install-extension "$VSIX_FILE"
if [ $? -eq 0 ]; then
echo ""
echo "๐ Setup Complete!"
echo "=================="
echo ""
echo "The Copilot Ollama Bridge extension has been installed!"
echo ""
echo "Next steps:"
echo "1. Restart VS Code"
echo "2. Ensure GitHub Copilot extension is installed and authenticated"
echo "3. The bridge will auto-start (check status bar for ๐ค icon)"
echo ""
echo "๐ Configure Cline:"
echo " โข Ollama URL: http://localhost:11434"
echo " โข Model: copilot:latest"
echo ""
echo "๐ฎ Available commands in VS Code:"
echo " โข Start Copilot Bridge Server"
echo " โข Stop Copilot Bridge Server"
echo " โข Restart Copilot Bridge Server"
echo ""
echo "๐งช Test the API:"
echo " curl http://localhost:11434/api/tags"
echo ""
echo "๐ View documentation:"
echo " Open http://localhost:11434 in your browser"
echo ""
echo "๐ Monitor activity:"
echo " Check 'Copilot Bridge' output channel in VS Code"
else
echo "โ Failed to install extension automatically."
echo ""
echo "๐ Manual installation:"
echo " 1. Open VS Code"
echo " 2. Press Ctrl+Shift+P"
echo " 3. Run 'Extensions: Install from VSIX...'"
echo " 4. Select: $VSIX_FILE"
fi
echo ""
echo "๐ก Tip: If you encounter issues, check the 'Copilot Bridge' output channel in VS Code"