This guide will help you install and set up Codebot on your system.
Before installing Codebot, ensure you have the following:
- Python 3.11+ - Codebot requires Python 3.11 or higher
- uv package manager - For dependency management
- Claude Code CLI - The AI agent that performs code changes
- Git - Configured with authentication for cloning repositories
- GitHub App - Registered GitHub App with private key and installation ID
- macOS or Linux
- At least 2GB of free disk space
- Internet connection for API calls and repository access
If you don't have uv installed:
curl -LsSf https://astral.sh/uv/install.sh | shVerify installation:
uv --versionFollow the official instructions at Anthropic's Claude Code Documentation to install Claude Code CLI.
Verify installation:
claude --version# Clone the repository
git clone https://github.com/yourusername/codebot.git
cd codebot
# Install dependencies
uv sync
# For corporate environments with restricted PyPI access:
# uv sync --index-url https://pypi.company.com/simple
# Activate the virtual environment
source .venv/bin/activate
# Verify installation
codebot --helpNote: You need to activate the virtual environment each time you open a new terminal, or use uv run codebot as a shortcut without activation.
Codebot uses a GitHub App for authentication, allowing it to act with its own identity instead of a user's identity.
- Go to your organization or user settings → Developer settings → GitHub Apps
- Click "New GitHub App"
- Fill in app details:
- Name: codebot-007 (or your preferred name)
- Homepage URL: Your app homepage
- Webhook URL: Your webhook endpoint (if using webhook server)
- Set required permissions:
- Contents: Read and Write
- Pull requests: Read and Write
- Metadata: Read-only (automatic)
- Click "Create GitHub App"
- After creating the app, click "Install App"
- Select the organization or repositories where you want to install it
- Note the Installation ID from the URL (e.g.,
https://github.com/settings/installations/123456)
- In your GitHub App settings, scroll to "Private keys"
- Click "Generate a private key"
- Download the
.pemfile and store it securely (never commit to version control)
Option 1: Environment Variables
export GITHUB_APP_ID="123456"
export GITHUB_APP_PRIVATE_KEY_PATH="/path/to/private-key.pem"
export GITHUB_APP_INSTALLATION_ID="789012"Option 2: .env File
Create a .env file in your project directory:
GITHUB_APP_ID=123456
GITHUB_APP_PRIVATE_KEY_PATH=./codebot-private-key.pem
GITHUB_APP_INSTALLATION_ID=789012See Configuration Guide for detailed GitHub App setup instructions.
Test that everything is working:
# Check codebot command
uv run codebot --help
# Verify GitHub token
uv run codebot run --helpYou should see the help output for the codebot CLI.
If you plan to use the webhook server for PR review automation:
export GITHUB_WEBHOOK_SECRET="your_webhook_secret_here"export CODEBOT_API_KEYS="secret-key-1,secret-key-2"See the Webhooks Guide for detailed webhook configuration.
If you're in a corporate environment where PyPI access is restricted, you may need to use an internal PyPI mirror.
# Install with custom index URL
uv sync --index-url https://pypi.company.com/simple
# Or set it permanently in .uv.toml
echo '[index]' > .uv.toml
echo 'url = "https://pypi.company.com/simple"' >> .uv.tomlThe uv.lock file may be updated when using different index URLs. This is normal and ensures reproducible builds in your environment. You have two options:
Option 1: Commit the updated lock file (recommended for teams using the same corporate environment)
git add uv.lock
git commit -m "Update uv.lock for corporate PyPI mirror"Option 2: Keep local changes only (if working in mixed environments)
# Reset the lock file to avoid committing corporate-specific changes
git checkout HEAD -- uv.lockCreate a .uv.toml file that can be customized per environment without affecting the repository:
# .uv.toml (add to .gitignore if needed)
[index]
url = "https://pypi.company.com/simple"For installation issues and common problems, see the Troubleshooting Guide.
- CLI Usage Guide - Learn how to run tasks
- Configuration Guide - Customize codebot settings
- Examples - See practical use cases