AI-powered Discord bot for codebase analysis and bug detection
413
Bobby is a Discord chatbot that helps answer questions about your codebase, file bugs, and translate business requirements into technical requirements. Bobby leverages Claude Code to understand your codebase and provide intelligent responses.
Get Bobby running in under 1 minute:
# Run Bobby with your credentials (pre-built image from Docker Hub)
docker run -d \
--name bobby \
-e DISCORD_TOKEN=your_discord_bot_token \
-e ANTHROPIC_API_KEY=your_anthropic_api_key \
-e GH_TOKEN=your_github_personal_access_token \
-e GITHUB_REPO=owner/repo-name \
-v bobby-data:/app/data \
stewart86/bobby:latest
That's it! Bobby will automatically:
Privacy & Security: You create your own Discord bot and run Bobby in your own isolated Docker container. Your code, conversations, and API keys never leave your environment.
Bobby uses Discord threads for session management:
Bobby can:
Why Self-Host Bobby?
owner/repo-nameDISCORD_TOKEN)botapplications.commandsTo get your Discord server ID (needed for the server whitelist):
Enable Developer Mode:
Get the Server ID:
To keep your bot private and prevent unauthorized access:
Disable Public Bot Setting: In the Discord Developer Portal under the "Bot" tab, make sure "Public Bot" is disabled. This prevents anyone with your client ID from adding the bot to their server.
Server Whitelist: Bobby automatically implements server whitelisting when you provide the ALLOWED_DISCORD_SERVERS environment variable with comma-separated server IDs.
Use Environment Variables: Bobby automatically handles server whitelisting via the ALLOWED_DISCORD_SERVERS environment variable.
Use Minimal Permissions: Only request the permissions your bot actually needs to function.
Regularly Audit Servers: Periodically check which servers your bot has joined and remove it from any unauthorized ones.
Create an Anthropic account:
Access the API Console:
Generate an API Key:
ANTHROPIC_API_KEY)Note: When using Docker (recommended), the Claude Code CLI is automatically installed and configured. Manual installation is only needed for local development.
repo (Full control of private repositories)read:org (if your repositories are within an organization)GH_TOKEN)
Create a .env file with the following variables:
DISCORD_TOKEN=your_discord_bot_token
ANTHROPIC_API_KEY=your_anthropic_api_key
GH_TOKEN=your_github_personal_access_token
GITHUB_REPO=owner/repo-name
Note: Docker deployment is recommended. Local development requires additional setup:
bun installbun install -g @anthropic-ai/claude-codebun run devFor detailed local setup, see the Docker option above which handles all dependencies automatically.
Option 1: Pre-built Image (Recommended)
Use the official pre-built image from Docker Hub:
docker run -d \
--name bobby \
-e DISCORD_TOKEN=your_discord_bot_token \
-e ANTHROPIC_API_KEY=your_anthropic_api_key \
-e GH_TOKEN=your_github_personal_access_token \
-e GITHUB_REPO=owner/repo-name \
-e ALLOWED_DISCORD_SERVERS=123456789012345678,987654321098765432 \
-v bobby-data:/app/data \
stewart86/bobby:latest
Option 2: Build from Source
If you want to build from source or make modifications:
# 1. Clone the repository
git clone https://github.com/Stewart86/bobby.git
cd bobby
# 2. Build the Docker image
docker build -t bobby-bot .
# 3. Run the container
docker run -d \
--name bobby \
-e DISCORD_TOKEN=your_discord_bot_token \
-e ANTHROPIC_API_KEY=your_anthropic_api_key \
-e GH_TOKEN=your_github_personal_access_token \
-e GITHUB_REPO=owner/repo-name \
-e ALLOWED_DISCORD_SERVERS=123456789012345678,987654321098765432 \
-v bobby-data:/app/data \
bobby-bot
The container will automatically authenticate with GitHub using your GH_TOKEN before starting the bot.
Security Note: The ALLOWED_DISCORD_SERVERS environment variable controls which Discord servers can use your bot. If not specified, all servers will be allowed (not recommended for production).
@Bobby what's the authentication flow in our app?
To run Bobby for multiple repositories or organizations, use separate containers:
# Deploy for different repositories
docker run -d --name bobby-repo1 \
-e GITHUB_REPO=org/repo1 \
[other env vars] \
-v bobby-repo1-data:/app/data \
stewart86/bobby:latest
docker run -d --name bobby-repo2 \
-e GITHUB_REPO=org/repo2 \
[other env vars] \
-v bobby-repo2-data:/app/data \
stewart86/bobby:latest
Each instance maintains separate data storage and session management.
Bobby is automatically published to Docker Hub with every release:
stewart86/bobbystewart86/bobby:lateststewart86/bobby:v1.0.0GitHub Actions automatically builds and publishes Docker images:
latest tagv1.0.0)linux/amd64bobby/
├── index.js # Main application file
├── CLAUDE.md # Claude Code instructions and memory index
├── package.json # Dependencies and scripts
├── entrypoint.sh # Docker container initialization script
├── Dockerfile # Docker configuration
├── CONTRIBUTING.md # Contribution guidelines
├── LICENSE # MIT license
├── .env.example # Environment variables template
├── .github/ # GitHub Actions workflows
│ └── workflows/
│ └── docker-publish.yml
└── README.md # Documentation
Bobby is built with modern JavaScript and Bun runtime. Key components:
See CONTRIBUTING.md for detailed development guidelines, code architecture, and how to contribute to the project.
Bobby uses the CLAUDE.md file for storing project instructions and context that helps Claude understand the codebase and provide better responses during conversations.
If you encounter authentication errors with Claude, this is a known issue tracked in the Claude Code repository.
Error symptoms:
Workaround:
Access the running Docker container:
docker exec -it bobby /bin/sh
Manually authenticate Claude Code CLI:
claude
# Follow the interactive prompts to authenticate
Exit the container - Bobby should now work properly:
exit
This issue typically resolves itself once Claude Code CLI is manually authenticated within the container environment.
MIT License - see LICENSE file for details.
Content type
Image
Digest
sha256:1ede7cd49…
Size
205.6 MB
Last updated
about 1 year ago
docker pull stewart86/bobby