Rodin 700f186023 Initial implementation: AI code review bot for Gitea
- CLI binary with flag/env var configuration
- Gitea API client (PR metadata, diff, CI status, post review)
- OpenAI-compatible LLM client
- Structured review prompt with conventions support
- JSON response parser with validation
- Markdown review formatter for Gitea
- CI failure auto-detection (REQUEST_CHANGES)
- Dry-run mode for testing
2026-05-01 09:42:45 -07:00

review-bot

AI-powered code review bot for Gitea pull requests.

Overview

review-bot fetches a PR's diff, title, description, and CI status from Gitea, sends it to an LLM via an OpenAI-compatible API, and posts a structured code review back to Gitea.

Usage

review-bot \
  --gitea-url https://gitea.weiker.me \
  --repo owner/name \
  --pr 123 \
  --reviewer-name "sonnet-review-bot" \
  --reviewer-token "$(cat /path/to/token)" \
  --llm-base-url "https://proxy.example.com/v1" \
  --llm-api-key "key" \
  --llm-model "anthropic--claude-4.6-sonnet" \
  --conventions-file "CLAUDE.md"

All flags can also be set via environment variables:

Flag Env Var
--gitea-url GITEA_URL
--repo GITEA_REPO
--pr PR_NUMBER
--reviewer-name REVIEWER_NAME
--reviewer-token REVIEWER_TOKEN
--llm-base-url LLM_BASE_URL
--llm-api-key LLM_API_KEY
--llm-model LLM_MODEL
--conventions-file CONVENTIONS_FILE

Use --dry-run to print the review to stdout without posting.

Build

go build -o review-bot ./cmd/review-bot

Architecture

  • cmd/review-bot/main.go — CLI entry point
  • gitea/client.go — Gitea API interactions (fetch PR, diff, CI status, post review)
  • llm/client.go — OpenAI-compatible chat completion client
  • review/prompt.go — System/user prompt construction
  • review/parser.go — Parse LLM JSON response
  • review/formatter.go — Format markdown review body

Constraints

  • Pure Go stdlib, no external dependencies
  • No CGO
S
Description
AI-powered code review bot for Gitea pull requests
Readme 4.5 MiB
v0.4.0 Latest
2026-05-15 13:05:19 +00:00
Languages
Go 99.1%
Shell 0.8%