rjoydip/labelit.ai

WIP - Label a PR or Issue by reading and understand content

★ 0Forks 0TypeScriptGitHub ↗Compare

README

labelit.ai

code style CI Version License: MIT TypeScript

Overview

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.

Project Structure

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.

Getting Started

Prerequisites

  • Bun (version 1.3+)
  • Git
  • Cloudflare account (for deployment)

Installation

  1. Clone the repository:

    git clone https://github.com/rjoydip/labelit.ai.git
    cd labelit.ai
  2. Install dependencies:

    bun install

Development

Run the development server:

bun run dev

CLI Usage

# 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#123

See docs/CLI.md for full documentation.

Available Scripts

  • bun run dev - Start development server
  • bun run build - Build for production (Cloudflare Workers)
  • bun run deploy - Deploy to Cloudflare
  • bun run lint - Lint code (oxlint)
  • bun run format - Format code (oxfmt)
  • bun run test - Run tests
  • bun run typecheck - Type check
  • bun run knip - Check for unused dependencies

Deployment

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

Configuration

Environment Variables

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

Technology Stack

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

Documentation

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

Contributing

Please read CONTRIBUTING.md for details on our code of conduct and the process for submitting pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributors

rjoydip

Issues