1.8 KiB
1.8 KiB
Pierre Bot
Pierre Bot is an AI-powered code review companion designed for Bitbucket Server/Data Center. It fetches pull request diffs, analyzes them using Google's Gemini 2.0 Flash model, and identifies potential bugs, style issues, or logic errors.
Installation
Ensure you have Go installed, then clone the repository and build the binary:
git clone https://git.schreifuchs.ch/schreifuchs/pierre-bot.git
cd pierre-bot
go build -o pierre ./cmd/pierre/main.go
Configuration
Pierre Bot can be configured via Command Line Flags, Environment Variables, or a YAML Config File.
Configuration Hierarchy
- Command line flags
- Environment variables
config.yamlin the current directory~/.pierre.yaml
Required Environment Variables
To avoid passing sensitive tokens in plain text, it you cann export these:
export BITBUCKET_URL="https://your-bitbucket-instance.com"
export BITBUCKET_TOKEN="your-personal-access-token"
export LLM_API_KEY="your-gemini-api-key"
Usage Examples
The tool uses positional arguments for the specific Pull Request you want to target:
pierre <project> <repo> <pr-id>
1. Basic Command Line Usage
If you have your environment variables set, simply run:
./pierre-bot PROJ-KEY my-app-repo 125
2. Using a Configuration File
You can create a config.yaml file to store persistent settings:
# config.yaml
bitbucket-url: "https://bitbucket.example.com"
bitbucket-token: "np-mY-S3cr3t-T0k3n"
Then run the bot:
./pierre-bot --config config.yaml PROJ-KEY my-app-repo 125
3. Overriding Everything via Flags
./pierre \
--bitbucket-url="https://bitbucket.example.com" \
--bitbucket-token="token" \
MYPROJECT my-repo 42