Complete guide to installing, configuring, and operating Codebuff locally with Google Gemini models.
Start here if you're setting up Codebuff for the first time:
-
QUICK_START.md (10 minutes)
- Fastest path to getting Codebuff running
- For users who want to get going immediately
- Assumes you have prerequisites installed
- Time: ~10 minutes
-
LOCAL_INSTALLATION_GUIDE.md (30-45 minutes)
- Comprehensive step-by-step installation
- Covers all prerequisites in detail
- Detailed architecture overview
- Complete troubleshooting
- Time: 30-45 minutes first setup
Use these once you have Codebuff running:
- DAILY_OPERATIONS.md
- Daily startup/shutdown procedures
- Common workflow examples
- Performance tips
- Monitoring and debugging
- Read this before each development session
For architecture and design knowledge:
-
WARP.md
- System architecture overview
- Multi-agent system explanation
- Development patterns
- Key command reference
- Read this for understanding how Codebuff works
-
MODEL_CONFIGURATION_STATUS.md
- Detailed model configuration analysis
- Which models are actually used
- Infrastructure setup details
-
GEMINI_MODEL_CONFIRMATION.md
- Confirmation that only Google Gemini is used
- Principal model identification
- Configuration status
Get Codebuff running right now β QUICK_START.md (10 min)
Install Codebuff step by step β LOCAL_INSTALLATION_GUIDE.md (30 min setup)
Know how to start/stop it daily β DAILY_OPERATIONS.md β "Daily Startup Routine"
Understand the architecture β WARP.md β "Architecture" section
Know which models are being used β GEMINI_MODEL_CONFIRMATION.md β "Executive Answer"
Run my first coding task β DAILY_OPERATIONS.md β "Using Codebuff" section
Fix a problem β LOCAL_INSTALLATION_GUIDE.md β "Troubleshooting" OR DAILY_OPERATIONS.md β "Troubleshooting Quick Reference"
Before starting, verify you have:
β‘ Bun β₯1.3.0 installed (bun --version)
β‘ Docker installed and running (docker --version)
β‘ Git installed (git --version)
β‘ OpenRouter API key (from openrouter.ai)
β‘ GitHub account for OAuth
β‘ Internet connection for model API calls
β‘ 4GB+ available disk space
β‘ 2GB+ available RAM
Missing something? β See LOCAL_INSTALLATION_GUIDE.md Phase 1
1. Read: QUICK_START.md (first 10 min)
2. Follow: All steps in QUICK_START.md
3. Test: Run a simple task in CLI
4. Success! β Move to Daily Operations
1. Read: LOCAL_INSTALLATION_GUIDE.md Phase 1-6
2. Follow: All prerequisites installation
3. Follow: Clone, configure, setup
4. Test: Verification checklist
5. Success! β Move to Daily Operations
1. Each morning: Follow DAILY_OPERATIONS.md "Daily Startup Routine"
2. Run tasks: Use CLI or web dashboard
3. Review changes: git diff
4. Commit: git commit
5. Repeat: Next task
6. End of day: Graceful shutdown
1. Problem occurs
2. Check: DAILY_OPERATIONS.md "Troubleshooting Quick Reference"
3. If not found: LOCAL_INSTALLATION_GUIDE.md "Troubleshooting"
4. If still unclear: Check specific service docs (backend, web, CLI)
ββββββββββββββββββββββββββββββββββββ
β Your Local Machine β
ββββββββββββββββββββββββββββββββββββ€
β β
β CLI/TUI Web Dashboard β
β β β β
β ββββββββββββββββββββββββββββ β
β β Backend Server:4242 β β
β β - WebSocket β β
β β - Agent Orchestration β β
β β - Tool Execution β β
β βββββββββ¬βββββββββββββββββββ β
β β β
β βββββββββΌβββββββββββββββββββ β
β β PostgreSQL:5432 β β
β β - User Data β β
β β - Credit Ledger β β
β β - Agent Registry β β
β ββββββββββββββββββββββββββ β
β β
ββββββββββββββββββββββββββββββββββββ
β
β (HTTPS)
β
ββββββΌβββββββββββββββ
β OpenRouter API β
β Google Gemini β
β Models β
βββββββββββββββββββββ
| Service | Port | Purpose |
|---|---|---|
| Backend | 4242 | WebSocket, Agent orchestration, LLM routing |
| Web Dashboard | 3000 | Next.js UI, authentication |
| PostgreSQL | 5432 | User data, credits, agent registry |
| CLI | stdout | Terminal UI, direct prompts |
| Mode | Model | Use Case |
|---|---|---|
| lite | google/gemini-2.5-flash |
Fast, simple tasks |
| normal (default) | google/gemini-2.5-pro |
General coding |
| max (best) | google/gemini-3-pro-preview |
Complex reasoning |
| experimental | google/gemini-3-pro-preview |
Research |
- You give Codebuff a task
- Backend selects appropriate Gemini model based on mode
- Request sent to OpenRouter API (online)
- Google Gemini processes your request
- Response streamed back to your CLI/dashboard
- Changes applied to your code locally
All processing is online - models run in Google's cloud via OpenRouter
- Where to get: https://openrouter.ai (free account)
- Purpose: Access to Google Gemini models
- Format:
sk-or-...(starts withsk-or-) - Setup:
infisical secrets set OPEN_ROUTER_API_KEY=sk-or-YOUR_KEY
- Where to create: https://github.com/settings/developers
- Purpose: Local authentication
- Setup: See LOCAL_INSTALLATION_GUIDE.md Phase 2.2
- Format:
postgresql://user:password@host:port/database - Default:
postgresql://manicode_user_local:secretpassword_local@localhost:5432/manicode_db_local - Setup:
infisical secrets set DATABASE_URL=postgresql://...
| File | Purpose |
|---|---|
.env.example |
Template for all environment variables |
.envrc |
direnv configuration |
.agents/ |
Agent definitions (all use Gemini) |
common/src/old-constants.ts |
Model configuration & tier selection |
backend/src/llm-apis/ |
LLM API routing |
docker-compose.yml |
Database container config |
# Check current config
infisical secrets list
# Update a setting
infisical secrets set VARIABLE_NAME=new_value
# Restart affected service to apply
# (e.g., restart backend for API key changes)β‘ Terminal 1: bun run start-db
ββ Wait: "PostgreSQL is running..."
β‘ Terminal 2: bun run start-server
ββ Wait: "Server running on 4242"
β‘ Terminal 3: bun run start-web
ββ Wait: "Ready on http://localhost:3000"
β‘ Terminal 4: bun run start-bin
ββ Wait: "Welcome to Codebuff!"
β‘ Verify: All services runningβ‘ Use CLI or web dashboard
β‘ Run coding tasks
β‘ Review changes: git diff
β‘ Commit changes: git commitβ‘ Finish current task
β‘ Commit all changes: git add . && git commit -m "..."
β‘ Terminal 1-4: Ctrl+C (graceful shutdown)
β‘ Verify: All services stoppedCheck: Are ports in use?
lsof -i :4242 # Backend
lsof -i :3000 # Web
lsof -i :5432 # DatabaseFix: Kill other processes or use different ports β See: LOCAL_INSTALLATION_GUIDE.md "Ports already in use"
Check: Do you have credits in database?
Fix: bun run start-studio β edit credit_ledger table
β See: DAILY_OPERATIONS.md "No Credits"
Check: Is backend running?
curl http://localhost:4242Fix: Restart backend (Terminal 2: Ctrl+C, then bun run start-server)
β See: DAILY_OPERATIONS.md "Backend disconnected"
Check: Is OPEN_ROUTER_API_KEY set correctly?
infisical secrets list | grep OPEN_ROUTERFix: Update key and restart backend
infisical secrets set OPEN_ROUTER_API_KEY=sk-or-YOUR_KEY
# Terminal 2: Ctrl+C && bun run start-serverβ See: DAILY_OPERATIONS.md "API key error"
Check: Is PostgreSQL running?
docker ps | grep postgresFix: Start database (Terminal 1: bun run start-db)
β See: DAILY_OPERATIONS.md "Database error"
# β
Use --lite for simple tasks
bun run start-bin --lite
# "Add JSDoc comment"
# "Add console.log statement"
# β
Use default for normal tasks
bun run start-bin
# "Refactor this component"
# "Add error handling"
# β
Use --max for complex tasks
bun run start-bin --max
# "Design new architecture"
# "Implement complex algorithm"# β
Good: Specific directory
cd my-project/src/components
bun run start-bin
# Fast analysis of specific area
# β Bad: Entire massive repo
cd /huge/monorepo
bun run start-bin
# Slow, unnecessary files analyzed# β
Specific
"Add error handling to fetchUser function in api/users.ts"
# β Vague
"Improve code"- QUICK_START.md - 10-minute setup
- LOCAL_INSTALLATION_GUIDE.md - Detailed installation
- DAILY_OPERATIONS.md - Daily workflows
- WARP.md - Architecture & development
- CONTRIBUTING.md - Development guidelines
- OpenRouter: https://openrouter.ai
- Codebuff Docs: https://codebuff.com/docs
- Discord: https://codebuff.com/discord
- GitHub: https://github.com/CodebuffAI/codebuff
-
Check troubleshooting
- DAILY_OPERATIONS.md - Quick fixes
- LOCAL_INSTALLATION_GUIDE.md - Detailed solutions
-
Check service logs
- Terminal 1 (db): Database logs
- Terminal 2 (backend): Server logs
- Terminal 3 (web): Application logs
- Terminal 4 (CLI): Execution logs
-
Verify configuration
# Check all secrets are set infisical secrets list # Check services are running docker ps lsof -i :4242 lsof -i :3000
-
Ask for help
- Discord: https://codebuff.com/discord
- GitHub Issues: https://github.com/CodebuffAI/codebuff/issues
| Component | Version | Notes |
|---|---|---|
| Codebuff | Latest main | Always latest from GitHub |
| Bun | β₯1.3.0 | Package manager & runtime |
| Node.js | N/A | Not required (Bun instead) |
| PostgreSQL | 14+ | Docker container |
| Docker | Latest | For database container |
| Gemini Models | Latest | google/gemini-3-pro-preview, etc. |
# 1. All services running?
curl http://localhost:4242 # Should respond
curl http://localhost:3000 # Should respond
docker ps | grep postgres # Should show container
# 2. Database working?
infisical run -- bun --cwd packages/internal run db:migrate
# Should show "Migrations completed"
# 3. CLI working?
# Terminal 4: Type "agents"
# Should show list of available agents
# 4. Model working?
# Terminal 4: Type "Tell me about Gemini"
# Should get response from Gemini model# 1. Models configured for Gemini?
grep ALLOWED_MODEL_PREFIXES common/src/old-constants.ts
# Should show: ['google']
# 2. OpenRouter API key set?
infisical secrets list | grep OPEN_ROUTER
# Should show your key (sk-or-...)
# 3. GitHub OAuth configured?
infisical secrets list | grep GITHUB
# Should show Client ID and Secret- QUICK_START.md
- DAILY_OPERATIONS.md sections: "Using Codebuff"
- Start running tasks
- LOCAL_INSTALLATION_GUIDE.md "Architecture"
- WARP.md sections: "Architecture", "Communication Flow"
- Try different agents and modes
- WARP.md full document
- CONTRIBUTING.md
- Explore
.agents/directory - Read backend code in
backend/src/
| Channel | Use For |
|---|---|
| This Doc | Quick answers, common issues |
| Discord | Community help, feature requests |
| GitHub Issues | Bug reports, technical issues |
| Documentation | In-depth learning |
Last Updated: November 28, 2025
Status: β
Production Ready
Platform: Linux, macOS, Windows (WSL)
Model Provider: Google Gemini (via OpenRouter, online)