This guide will help you set up the GitHub Buddy backend server for the Chrome extension.
- Node.js installed (any recent version)
- macOS (for daemon/launchd features)
- Git repositories to review
Copy the example environment file and customize it:
cp .env.example .envEdit .env and update these values:
# Find your Node.js path
which node
# Update .env with your actual values
NODE_PATH=/path/to/your/node # e.g., /opt/homebrew/bin/node
HTTP_PORT=13030 # HTTP server port
WS_PORT=13031 # WebSocket port
PROJECTS_DIR=/path/to/your/projects # Where your git repos live
PR_REVIEWS_DIR=/path/to/questions and actions # Where review files are storedCommon Node.js locations:
- Homebrew (Intel):
/usr/local/bin/node - Homebrew (Apple Silicon):
/opt/homebrew/bin/node - nvm:
~/.nvm/versions/node/vX.X.X/bin/node
Example configuration:
NODE_PATH=/opt/homebrew/bin/node
HTTP_PORT=13030
WS_PORT=13031
PROJECTS_DIR=/Users/yourusername/Projects
PR_REVIEWS_DIR=/Users/yourusername/claude-github-buddy/questions and actionscd server
npm install
cd ..Start the server manually first to ensure everything works:
./launchers/start_server_daemon.commandYou should see:
🤖 Starting GitHub Buddy Server (daemon mode)...
📍 Using Node.js: /path/to/node
🔌 HTTP Port: 13030, WebSocket Port: 13031
✅ Server started successfully (PID: xxxxx)
Visit http://localhost:13030 to confirm it's running.
- Open Chrome and go to
chrome://extensions/ - Enable "Developer mode" (top right)
- Click "Load unpacked"
- Select the
extensiondirectory from this project - The extension should now appear in your toolbar
- Click the extension icon
- Go to Settings
- Verify the server URL:
http://localhost:13030 - Update Projects Directory if needed (should match
.env)
To have the server start automatically when you log in:
- Create the launch agent plist:
mkdir -p ~/Library/LaunchAgents- Create
~/Library/LaunchAgents/com.yourusername.github-buddy-server.plist:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.yourusername.github-buddy-server</string>
<key>ProgramArguments</key>
<array>
<string>/full/path/to/claude-github-buddy/launchers/start_server_daemon.command</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardOutPath</key>
<string>/full/path/to/claude-github-buddy/server/launchd.log</string>
<key>StandardErrorPath</key>
<string>/full/path/to/claude-github-buddy/server/launchd.error.log</string>
<key>WorkingDirectory</key>
<string>/full/path/to/claude-github-buddy</string>
</dict>
</plist>- Load the agent:
launchctl load ~/Library/LaunchAgents/com.yourusername.github-buddy-server.plistNote: Replace /full/path/to/claude-github-buddy with the actual absolute path.
The server uses this priority for configuration (highest to lowest):
- Environment variables (from
.envfile) - config.json (set via extension UI)
- Defaults (in code)
This means .env takes precedence over UI settings, allowing you to lock certain values.
# Start server
./launchers/start_server_daemon.command
# Stop server
./launchers/stop_server.command
# Check status
./launchers/server_status.command
# View logs
./launchers/server_logs.command # Last 50 lines
./launchers/server_logs.command -f # Follow in real-time
./launchers/server_logs.command 100 # Last 100 lines# Start
launchctl load ~/Library/LaunchAgents/com.yourusername.github-buddy-server.plist
# Stop
launchctl unload ~/Library/LaunchAgents/com.yourusername.github-buddy-server.plist
# Check status
launchctl list | grep github-buddy| Variable | Description | Default |
|---|---|---|
NODE_PATH |
Full path to Node.js binary | $(which node) |
HTTP_PORT |
HTTP server port | 13030 |
WS_PORT |
WebSocket server port | 13031 |
PROJECTS_DIR |
Root directory for git repositories | ~/Projects |
PR_REVIEWS_DIR |
Directory for review files | ./questions and actions |
GIT_GITHUB_PROTOCOL |
Git protocol for github.com | ssh |
GIT_GITHUB_SSH_KEY |
SSH key path for github.com | ~/.ssh/id_ed25519 |
The extension can create/update server/config.json via the Settings UI:
{
"prReviewsDir": "/path/to/reviews",
"projectsDir": "/path/to/projects"
}Note: .env variables take priority over config.json.
Never commit these files to git:
.env- Your environment configurationserver/config.json- UI-generated settings (may contain paths)questions and actions/- PR review files (user data)server/server.pid- Process ID fileserver/server.log- Server logsserver/launchd.log- launchd stdoutserver/launchd.error.log- launchd stderr
These are already in .gitignore.
-
Check Node.js path is correct:
cat .env | grep NODE_PATH # Then verify: /path/from/env --version
-
Check if ports are already in use:
lsof -i :13030 lsof -i :13031
-
Check logs for errors:
./server_logs.command
-
Verify server is running:
./server_status.command
-
Check extension settings:
- Server URL should be
http://localhost:13030 - Port should match
HTTP_PORTin.env
- Server URL should be
-
Check browser console for errors (F12)
The extension uses this priority for finding projects:
.env→PROJECTS_DIRconfig.json→projectsDir- Default:
~/Projects
Update .env to lock the directory, or use extension Settings UI.
-
Verify git is available:
git --version
-
Check SSH keys are configured (if using SSH):
ssh -T git@github.com
-
Update git config in
.env:GIT_GITHUB_PROTOCOL=https # Use HTTPS instead of SSH
-
Check launchd logs:
cat server/launchd.error.log
-
Ensure paths in plist are absolute (not relative)
-
Test manual start first to isolate the issue
When you close your MacBook:
- Server processes are suspended (not terminated)
- On wake, processes resume automatically
- If server crashes during wake, launchd will restart it
This means the server should survive sleep/wake cycles in most cases.
If ports 13030/13031 are in use by another service:
- Choose new ports (e.g., 13032/13033)
- Update
.env:HTTP_PORT=13032 WS_PORT=13033
- Restart server
- Update extension settings with new HTTP port
- Server runs locally only - not accessible from network
- Review files may contain code from your repositories
- Git credentials are used from your system git config
- WebSocket connections are not encrypted (local only)
To make this work for your team:
- Each user copies
.env.exampleto.env - Each user customizes their paths
- Never commit
.envorconfig.json - Share
.env.exampleas template - Document any team-specific defaults in README
When working on this project:
- Use
.envfor local overrides - Update
.env.examplewhen adding new config options - Test on a fresh clone to ensure setup works
- Keep sensitive paths out of code - use config
Option 1 - Via .env (recommended):
# Edit .env
PROJECTS_DIR=/new/path/to/projects
# Restart server
./launchers/stop_server.command && ./start_server_daemon.commandOption 2 - Via extension UI:
- Click extension icon
- Settings → Projects Directory
- Save (creates/updates config.json)
# Edit .env
HTTP_PORT=14030
WS_PORT=14031
# Restart server
./launchers/stop_server.command && ./start_server_daemon.command
# Update extension settings
# Settings → Server URL → http://localhost:14030When sharing this project or contributing:
- Never commit
.env,config.json, or review files - Always use
.env.exampleas a template - Document any new configuration options
- Test on a fresh clone to ensure setup works
- Update this SETUP.md with any new steps
For issues or questions:
- Check logs:
./server_logs.command - Try manual start to see detailed errors
- Verify Node.js version:
node --version - Check browser console for extension errors
- Verify git credentials:
git config --list