-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·48 lines (40 loc) · 1.19 KB
/
install.sh
File metadata and controls
executable file
·48 lines (40 loc) · 1.19 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
#!/bin/bash
###
# Installation script for opencode-braintrust plugin
###
set -e
echo "Installing opencode-braintrust plugin..."
# Check if bun is available
if ! command -v bun &> /dev/null; then
echo "Error: bun is required but not found. Install it from https://bun.sh"
exit 1
fi
# Install dependencies
echo "Installing dependencies..."
bun install
# Build the plugin
echo "Building plugin..."
bun run build
# Create OpenCode plugin directory if it doesn't exist
PLUGIN_DIR="$HOME/.config/opencode/plugin"
mkdir -p "$PLUGIN_DIR"
# Copy plugin to OpenCode
echo "Installing plugin to $PLUGIN_DIR/trace-opencode.js"
cp dist/index.js "$PLUGIN_DIR/trace-opencode.js"
echo ""
echo "✓ Plugin installed successfully!"
echo ""
echo "Next steps:"
echo "1. Set your Braintrust API key:"
echo " export BRAINTRUST_API_KEY='your-api-key'"
echo ""
echo "2. (Optional) Configure project name:"
echo " export BRAINTRUST_PROJECT='my-project'"
echo ""
echo "3. Run OpenCode:"
echo " opencode"
echo ""
echo "4. Your sessions will be traced to Braintrust automatically!"
# TODO: add org to url to fix the link
# echo " View at: https://www.braintrust.dev/app/projects/${BRAINTRUST_PROJECT:-opencode}/logs"
echo ""