A comprehensive GitHub integration plugin for elizaos that provides repository management, issue tracking, pull request workflows, and activity monitoring.
| Variable | Required | Description |
|---|---|---|
GITHUB_TOKEN |
No | GitHub Personal Access Token or Fine-grained Token (supports unauthenticated mode for public API access with 60 requests/hour rate limit; required for higher rate limits, private repos, and write operations) |
GITHUB_OWNER |
No | Default GitHub username or organization |
GITHUB_WEBHOOK_URL |
No | Full webhook URL (highest priority override) |
PUBLIC_URL |
No | Public base URL for webhook generation |
SERVER_HOST |
No | Public hostname/IP for webhook URL construction |
SERVER_PORT |
No | Server port (used with SERVER_HOST) |
SERVER_PROTOCOL |
No | Protocol for webhooks (http/https, defaults to https) |
GITHUB_WEBHOOK_SECRET |
No | Secret for webhook signature verification |
# GitHub Personal Access Token (required)
# Use ghp_ for classic PAT or github_pat_ for fine-grained token
GITHUB_TOKEN=ghp_your_personal_access_token_here
# Optional: Default GitHub username/organization
GITHUB_OWNER=your-username-or-org
# Webhook Configuration (choose ONE approach):
# Option 1: Explicit webhook URL (highest priority)
GITHUB_WEBHOOK_URL=https://your-domain.com/api/github/webhook
# Option 2: Public URL (auto-appends /api/github/webhook)
PUBLIC_URL=https://your-domain.com
# Option 3: Server host/port (auto-constructs URL)
SERVER_HOST=api.your-domain.com
SERVER_PORT=443
SERVER_PROTOCOL=https
# Option 4: Use ngrok tunnel (automatic, for local development only)
# No configuration needed - plugin will auto-detect ngrok if available
# Optional: Webhook secret for secure webhook handling
GITHUB_WEBHOOK_SECRET=your_webhook_secret_here{
"name": "GitHubAgent",
"plugins": ["@elizaos/plugin-github"],
"settings": {
"GITHUB_TOKEN": "ghp_your_personal_access_token_here",
"GITHUB_OWNER": "your-username-or-org",
"GITHUB_WEBHOOK_SECRET": "your_webhook_secret_here"
}
}| Token Type | Prefix | Description |
|---|---|---|
| Personal Access Token (classic) | ghp_ |
Traditional PAT with broad permissions |
| Fine-grained PAT | github_pat_ |
Modern PAT with granular permissions |
| GitHub App | ghs_ |
App installation token |
| OAuth App | gho_ |
OAuth access token |
For full functionality, your token needs:
repo- Full repository accessread:user- Read user profile informationread:org- Read organization membership (for org repos)
# Add to your elizaos project
elizaos install @elizaos/plugin-github
# Or manually
npm install @elizaos/plugin-github- Get Repository Info: Retrieve detailed information about any repository
- List Repositories: View your repos with filtering and sorting
- Create Repositories: Create new repos with customizable settings
- Search Repositories: Find repos across GitHub using advanced queries
- Get Issue Details: Fetch comprehensive information about issues
- List Issues: View issues with state, label, and milestone filtering
- Create Issues: Submit new issues with labels, assignees, and milestones
- Search Issues: Find issues across repositories
- Get PR Details: Retrieve detailed pull request information
- List Pull Requests: View PRs with state and branch filtering
- Create Pull Requests: Open new PRs from feature branches
- Merge Pull Requests: Merge approved PRs with different strategies
- Activity Dashboard: Real-time tracking of all GitHub operations
- Rate Limit Monitoring: Track GitHub API usage and remaining quota
- Error Handling: Comprehensive error tracking and reporting
- Flexible URL Configuration: Works with public hosts, cloud deployments, or ngrok
- Production Ready: Use your own domain/IP without requiring tunnels
- Ngrok Support: Optional automatic tunnel for local development convenience
- Webhook Management: Create, list, delete, and test webhooks
- Event Processing: Real-time handling of GitHub events
- Signature Verification: Secure webhook payload validation
- Issue Analysis: AI-powered analysis for automation potential
- Automated PRs: Create PRs to fix simple issues automatically
- Smart Mentions: Respond when @mentioned in issues or comments
The plugin supports multiple webhook URL configuration strategies with automatic fallback:
-
GITHUB_WEBHOOK_URL- Explicit full URL overrideGITHUB_WEBHOOK_URL=https://your-domain.com/api/github/webhook
-
PUBLIC_URL- Base URL (auto-appends/api/github/webhook)PUBLIC_URL=https://your-domain.com
-
SERVER_HOST- Hostname/IP-based constructionSERVER_HOST=api.your-domain.com SERVER_PORT=443 # Optional, defaults to 443 for https SERVER_PROTOCOL=https # Optional, defaults to https
-
Ngrok Tunnel - Automatic fallback for local development
- Requires
@elizaos/plugin-ngrokinstalled - No configuration needed - auto-detected
- Requires
Production (Cloud/VPS):
PUBLIC_URL=https://your-production-domain.com
GITHUB_WEBHOOK_SECRET=your_secure_secretDocker/Kubernetes:
SERVER_HOST=api.myservice.com
SERVER_PORT=443
GITHUB_WEBHOOK_SECRET=your_secure_secretRailway/Render/Vercel:
PUBLIC_URL=${{ RAILWAY_PUBLIC_DOMAIN }} # or equivalent
GITHUB_WEBHOOK_SECRET=your_secure_secretLocal Development:
# No configuration needed - ngrok auto-detected
# Or explicitly set if needed:
GITHUB_WEBHOOK_URL=https://abc123.ngrok.io/api/github/webhook"Get information about the elizaOS/eliza repository"
"Create a new repository called my-awesome-project"
"List my open issues"
"Create an issue about authentication bugs"
"Show me recent GitHub activity"
"What's my current GitHub rate limit?"
// Get repository information
await runtime.executeAction('GET_GITHUB_REPOSITORY', {
owner: 'elizaOS',
repo: 'eliza',
});
// Create an issue
await runtime.executeAction('CREATE_GITHUB_ISSUE', {
owner: 'elizaOS',
repo: 'eliza',
title: 'Bug: Authentication not working',
body: 'Detailed description...',
labels: ['bug'],
});
// Create a pull request
await runtime.executeAction('CREATE_GITHUB_PULL_REQUEST', {
owner: 'elizaOS',
repo: 'eliza',
title: 'Add new feature',
head: 'feature/my-feature',
base: 'main',
body: 'This PR adds...',
});
// Check rate limit
await runtime.executeAction('GET_GITHUB_RATE_LIMIT');| Action | Description | Parameters |
|---|---|---|
GET_GITHUB_REPOSITORY |
Get repository information | owner, repo |
LIST_GITHUB_REPOSITORIES |
List user repositories | type, sort, limit |
CREATE_GITHUB_REPOSITORY |
Create new repository | name, description, private |
SEARCH_GITHUB_REPOSITORIES |
Search repositories | query, sort, limit |
| Action | Description | Parameters |
|---|---|---|
GET_GITHUB_ISSUE |
Get issue details | owner, repo, issue_number |
LIST_GITHUB_ISSUES |
List repository issues | owner, repo, state, labels |
CREATE_GITHUB_ISSUE |
Create new issue | owner, repo, title, body, labels |
SEARCH_GITHUB_ISSUES |
Search issues | query, sort, limit |
| Action | Description | Parameters |
|---|---|---|
GET_GITHUB_PULL_REQUEST |
Get PR details | owner, repo, pull_number |
LIST_GITHUB_PULL_REQUESTS |
List repository PRs | owner, repo, state |
CREATE_GITHUB_PULL_REQUEST |
Create new PR | owner, repo, title, head, base |
MERGE_GITHUB_PULL_REQUEST |
Merge PR | owner, repo, pull_number, merge_method |
| Action | Description | Parameters |
|---|---|---|
GET_GITHUB_ACTIVITY |
Get activity log | limit, filter |
CLEAR_GITHUB_ACTIVITY |
Clear activity log | None |
GET_GITHUB_RATE_LIMIT |
Get rate limit status | None |
When loaded, the plugin exposes:
GET /api/github/status- Plugin status and authentication infoGET /api/github/activity- Recent activity with statisticsGET /api/github/rate-limit- Current API rate limit statusPOST /api/github/webhook- Webhook endpoint for GitHub events
The plugin provides context through these providers:
GITHUB_REPOSITORY_CONTEXT- Current repository informationGITHUB_ISSUES_CONTEXT- Recent issues and current issue detailsGITHUB_PULL_REQUESTS_CONTEXT- PR information and merge statusGITHUB_ACTIVITY_CONTEXT- Activity statistics and recent operationsGITHUB_USER_CONTEXT- Authenticated user information
# Run unit tests
npm test
# Run with elizaos
elizaos test component
# E2E tests (requires GITHUB_TOKEN)
export GITHUB_TOKEN=ghp_your_token_here
npm test e2e.test.ts- Verify your GitHub token is valid and not expired
- Check that your token has the required permissions
- Ensure the token format is correct (
ghp_...orgithub_pat_...)
- Check your rate limit:
GET_GITHUB_RATE_LIMIT - Wait for the rate limit to reset
- Consider using a GitHub App token for higher limits
- Verify your token has access to the repository
- Check if the repo is private and your token has
reposcope - Ensure organization permissions if working with org repos
This project is licensed under the same license as elizaos.
Built with β€οΈ for the elizaos ecosystem