labelit.ai is a monolithic platform for processing webhook events from GitHub and applying AI-powered labeling to issues and pull requests. The system uses Cloudflare Workers for event ingestion and includes PI tools for AI orchestration.
src/
├── harness/ # PI tools integration (AgentCore, streamSimple)
├── providers/ # GitHub providers (Actions, App)
├── webhook/ # Webhook handling (validation, retry, rate limiting)
├── services/ # Core business logic (analyzer, feedback)
├── ai/ # AI processing (processor, prompts)
├── types/ # TypeScript types
├── utils/ # Utility functions
└── config/ # Configuration
For detailed architecture, see docs/ARCHITECTURE.md.
- Bun (version 1.3+)
- Git
- Cloudflare account (for deployment)
-
Clone the repository:
git clone https://github.com/rjoydip/labelit.ai.git cd labelit.ai -
Install dependencies:
bun install
Run the development server:
bun run dev# Local
bun run labelit start
bun run labelit add-labels owner/repo#123 bug priority:high
# GitHub Actions
- uses: rjoydip/labelit.ai/labelit@main
with:
action: analyze
target: owner/repo#123
# GitHub CLI (after extension setup)
gh labelit analyze owner/repo#123See docs/CLI.md for full documentation.
bun run dev- Start development serverbun run build- Build for production (Cloudflare Workers)bun run deploy- Deploy to Cloudflarebun run lint- Lint code (oxlint)bun run format- Format code (oxfmt)bun run test- Run testsbun run typecheck- Type checkbun run knip- Check for unused dependencies
Secrets cannot be set directly in wrangler.toml for security. Use wrangler secret put:
wrangler secret put WEBHOOK_SECRET
wrangler secret put PI_API_KEY
wrangler secret put GITHUB_APP_PRIVATE_KEY| Variable | Description | Required |
|---|---|---|
PI_PROVIDER |
LLM provider (openai, anthropic, google) | Yes |
PI_API_KEY |
API key for LLM provider | Yes |
PI_MODEL_NAME |
Model name (e.g., gpt-4o-mini) | No |
WEBHOOK_SECRET |
GitHub webhook secret | Yes |
GITHUB_TOKEN |
GitHub personal access token | For Actions |
GITHUB_APP_ID |
GitHub App ID | For App |
GITHUB_APP_PRIVATE_KEY |
GitHub App private key | For App |
GITHUB_APP_INSTALLATION_ID |
GitHub App installation ID | For App |
| Component | Technology |
|---|---|
| Runtime | Cloudflare Workers |
| Framework | Hono |
| Package Manager | Bun |
| AI | @earendil-works/pi-ai, @earendil-works/pi-agent-core |
| Testing | Vitest |
| Linting | oxlint |
| Formatting | oxfmt |
| Topic | Description |
|---|---|
| Architecture | System design and components |
| CLI | Command-line interface |
| Providers | GitHub provider implementations |
| Harness | PI tools integration |
| Webhook | Webhook handling |
| Contributing | How to contribute and write tests |
Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.
This project is licensed under the MIT License - see the LICENSE file for details.