Centralized Code Search: Deploying the Probe Web Interface
This guide explains how to set up and deploy Probe's web interface as a centralized code search and intelligence platform for your entire organization.
Overview
Probe's web interface provides a user-friendly chat experience that allows all team members to interact with your codebase using AI. By hosting this interface, you create a source of truth for how your product works that's accessible to both technical and non-technical team members. This enables quick issue resolution, documentation generation, architecture understanding, and helps product managers, QA teams, and other stakeholders make informed decisions without needing to understand implementation details.
Quick Setup with npx
The easiest way to deploy Probe's web interface for a team is using npx:
# Set your API key first (either Anthropic or OpenAI)
export ANTHROPIC_API_KEY=your_anthropic_api_key
# OR
export OPENAI_API_KEY=your_openai_api_key
# Configure allowed folders (required)
export ALLOWED_FOLDERS=/path/to/repo1,/path/to/repo2
# Enable authentication for team use
export AUTH_ENABLED=true
export AUTH_USERNAME=team
export AUTH_PASSWORD=secure_password
# Run the web interface
npx -y @buger/probe-chat@latest --web
2
3
4
5
6
7
8
9
10
11
12
13
14
15
Access the Web Interface
Once the server is running, team members can access the web interface at:
http://your-server-ip:8080
You can customize the port using the --port
option:
npx -y @buger/probe-chat@latest --web --port 3000
Setting Allowed Folders (Security & Privacy)
Controlling which code repositories are accessible is crucial for security:
Configuring Allowed Folders
# Specify which folders can be searched
export ALLOWED_FOLDERS=/path/to/repo1,/path/to/repo2,/path/to/repo3
2
This environment variable:
- Restricts search to only the specified directories
- Prevents access to sensitive files outside these directories
- Can include multiple repositories separated by commas
Best Practices for Folder Access
- Use Absolute Paths: Always use full paths to avoid ambiguity
- Limit Scope: Only include repositories that should be accessible
- Exclude Sensitive Directories: Don't include directories with secrets or sensitive data
- Consider Read-Only Access: For additional security, consider setting up read-only filesystem permissions for the user running the service
Managing API Keys for the Chat
The web interface requires an API key for either Anthropic Claude or OpenAI:
API Key Management
# For Anthropic Claude (recommended)
export ANTHROPIC_API_KEY=your_anthropic_api_key
# OR for OpenAI
export OPENAI_API_KEY=your_openai_api_key
2
3
4
5
Best Practices for API Keys
- Use Environment Variables: Never hardcode API keys in files
- Rotate Keys Regularly: Change keys periodically for security
- Monitor Usage: Keep track of API usage to control costs
- Use a Secrets Manager: For production deployments, consider using a secrets manager
Model Selection
You can specify which AI model to use:
# For Anthropic Claude
export MODEL_NAME=claude-3-opus-20240229
# For OpenAI
export MODEL_NAME=gpt-4o
2
3
4
5
Authentication & Environment Variables
Secure your deployment with authentication:
Enabling Authentication
# Enable basic authentication
export AUTH_ENABLED=true
export AUTH_USERNAME=your_username
export AUTH_PASSWORD=your_secure_password
2
3
4
Complete Environment Variable Reference
Variable | Description | Default |
---|---|---|
ANTHROPIC_API_KEY | Your Anthropic API key | (Required if not using OpenAI) |
OPENAI_API_KEY | Your OpenAI API key | (Required if not using Anthropic) |
ALLOWED_FOLDERS | Comma-separated list of folders to search | (Required) |
PORT | The port to run the server on | 8080 |
MODEL_NAME | Override the default model | claude-3-7-sonnet-latest or gpt-4o |
AUTH_ENABLED | Enable basic authentication | false |
AUTH_USERNAME | Username for authentication | admin |
AUTH_PASSWORD | Password for authentication | password |
DEBUG | Enable debug mode | false |
Command-Line Options
The web interface supports the following command-line options:
# Show help
npx -y @buger/probe-chat@latest --help
# Run in web mode on a specific port
npx -y @buger/probe-chat@latest --web --port 3000
# Specify a model
npx -y @buger/probe-chat@latest --web --model claude-3-7-sonnet-latest
# Enable debug mode
npx -y @buger/probe-chat@latest --web --debug
# Specify a directory to search
npx -y @buger/probe-chat@latest --web /path/to/your/project
2
3
4
5
6
7
8
9
10
11
12
13
14
Using the npm package (Alternative)
If you prefer, you can install the package globally:
# Install globally
npm install -g @buger/probe-chat@latest
# Start the web interface
probe-chat --web --port 3000
2
3
4
5
Best Practices for Organization-Wide Usage
Cross-Functional Team Onboarding
- Create Role-Specific Documentation: Tailor guides for different roles (developers, product managers, QA)
- Provide Example Queries: Share effective prompts and questions for common use cases
- Set Usage Guidelines: Establish best practices for different types of searches
- Training Sessions: Conduct role-specific training for technical and non-technical users
- Highlight Business Benefits: Demonstrate how code search improves collaboration and knowledge sharing
Performance Optimization
- Limit Repository Size: Include only necessary repositories
- Use a Powerful Server: Ensure adequate CPU and memory
- Consider SSD Storage: Faster disk access improves search performance
- Regular Maintenance: Keep the package and Node.js updated
Security Considerations
- Network Security: Use a reverse proxy with HTTPS
- IP Restrictions: Limit access to your company network
- Regular Updates: Keep the software updated
- Audit Logs: Monitor access and usage
Example Nginx Configuration
server {
listen 443 ssl;
server_name code-chat.yourcompany.com;
ssl_certificate /path/to/cert.pem;
ssl_certificate_key /path/to/key.pem;
location / {
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
# Rate limiting
limit_req zone=one burst=10 nodelay;
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Cloud Deployment Options
For teams working remotely:
Virtual Private Server (VPS)
- Provision a VPS with adequate resources
- Install Node.js (v18 or later)
- Set up environment variables for API keys and allowed folders
- Run the web interface using npx
- Set up a domain name and SSL certificate
- Configure a reverse proxy for HTTPS
Process Management
For production deployments, use a process manager like PM2:
# Install PM2
npm install -g pm2
# Start the web interface with PM2
pm2 start "npx -y @buger/probe-chat@latest --web" --name "probe-web" --env "ANTHROPIC_API_KEY=your_key" "ALLOWED_FOLDERS=/path/to/repos"
# Ensure it starts on system boot
pm2 startup
pm2 save
2
3
4
5
6
7
8
9
Monitoring and Maintenance
Usage Monitoring
- API Usage: Monitor API costs and usage
- Server Resources: Track CPU, memory, and disk usage
- User Activity: Monitor access logs and usage patterns
Regular Updates
- Update Package: Regularly update to the latest version with
npm update -g @buger/probe-chat
- Update Node.js: Keep Node.js updated to the latest LTS version
- Rotate Credentials: Change API keys and passwords periodically
Next Steps
- For individual developer workflows, see Integrating Probe into AI Code Editors
- For advanced CLI usage, check out CLI AI Workflows
- For programmatic access, explore Building AI Tools on Probe