forked from AMD-AIM/opencode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
50 lines (38 loc) · 1.1 KB
/
install.sh
File metadata and controls
50 lines (38 loc) · 1.1 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
#!/bin/bash
set -e
# OpenCode with AMD LLM Gateway support installer
# Usage: curl -fsSL https://raw.githubusercontent.com/vivienfanghuagood/opencode/dev/install.sh | bash
REPO="vivienfanghuagood/opencode"
BRANCH="dev"
INSTALL_DIR="/usr/local/bin"
echo "Installing OpenCode with AMD Gateway support..."
# Check dependencies
command -v bun >/dev/null 2>&1 || {
echo "Installing bun..."
curl -fsSL https://bun.sh/install | bash
export PATH="$HOME/.bun/bin:$PATH"
}
# Create temp directory
TMPDIR=$(mktemp -d)
cd "$TMPDIR"
echo "Downloading source..."
curl -fsSL "https://github.com/$REPO/archive/refs/heads/$BRANCH.tar.gz" | tar xz
cd opencode-*
echo "Installing dependencies..."
bun install
echo "Building..."
cd packages/opencode
bun run build --single
echo "Installing to $INSTALL_DIR..."
sudo cp dist/opencode-linux-x64/bin/opencode "$INSTALL_DIR/"
sudo chmod +x "$INSTALL_DIR/opencode"
# Cleanup
cd /
rm -rf "$TMPDIR"
echo ""
echo "✓ OpenCode installed successfully!"
echo ""
echo "Usage:"
echo " export LLM_GATEWAY_KEY=your-key"
echo " opencode kernel-optimize --src source.py --goal 2.0"
echo ""