Automated GitLab merge-request reviewer powered by an LLM.
- Create a Discord application at https://discord.com/developers/applications
- Add a bot user; copy the bot token to
DISCORD_TOKEN. - Copy the application ID to
DISCORD_APP_ID. - Invite the bot to your server with the
applications.commandsandbotscopes. - Fill in
config.yaml(seeconfig.example.yaml) and the env vars above plusGITLAB_TOKENand your LLM API key. - Run:
go build ./cmd/bot && ./bot --config config.yaml - In any channel the bot can see, run
/review url:<gitlab-mr-url>.
The bot supports four providers via llm.provider in config.yaml:
anthropic(default): setANTHROPIC_API_KEY. Uses prompt caching.openai: setOPENAI_API_KEY. Uses Chat Completions with JSON-object response format.ollama: no API key needed; defaults tohttp://localhost:11434. Override withllm.base_url.openrouter: setOPENROUTER_API_KEYasllm.api_key. Defaults tohttps://openrouter.ai/api. Use OpenRouter slugs likeopenai/gpt-4ooranthropic/claude-3.5-sonnetforllm.model. Optionally setllm.refererandllm.titlefor app ranking. JSON mode is not sent (works across all OR models);ParseFindingstolerates prose-wrapped JSON.
cp config.example.yaml config.yaml
# fill GITLAB_TOKEN, ANTHROPIC_API_KEY in env
./review-cli --config config.yaml https://gl.your-corp.com/team/proj/-/merge_requests/N