From 480f729116789f98973817ff9ec511f6644405f5 Mon Sep 17 00:00:00 2001 From: Aditya Singh Date: Tue, 2 Dec 2025 00:38:57 +0530 Subject: [PATCH] New changes --- pr_agent.toml | 11 ++++++++ setup-pr-agent.sh | 70 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 pr_agent.toml create mode 100755 setup-pr-agent.sh diff --git a/pr_agent.toml b/pr_agent.toml new file mode 100644 index 00000000..3ee6fc7a --- /dev/null +++ b/pr_agent.toml @@ -0,0 +1,11 @@ +[general] +log_level = "info" + +[llm] +provider = "openai" +model = "gpt-4o" +# Add your API key here or via environment variable +api_key = "" + +[review] +enable_auto_review = true diff --git a/setup-pr-agent.sh b/setup-pr-agent.sh new file mode 100755 index 00000000..f19836db --- /dev/null +++ b/setup-pr-agent.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +echo "๐Ÿš€ Setting up PR-Agent locally..." + +# ------------------------- +# 1. Clone the repository +# ------------------------- +if [ ! -d "pr-agent" ]; then + echo "๐Ÿ“ฅ Cloning repo..." + git clone https://github.com/Blackbox-ai/pr-agent.git +else + echo "๐Ÿ“‚ Repo already exists. Pulling latest changes..." + cd pr-agent + git pull + cd .. +fi + +cd pr-agent + +# ------------------------- +# 2. Create virtual environment +# ------------------------- +echo "๐Ÿ Creating Python virtual environment..." +python3 -m venv .venv + +echo "๐Ÿ”Œ Activating environment..." +source .venv/bin/activate + +# ------------------------- +# 3. Install dependencies +# ------------------------- +echo "๐Ÿ“ฆ Installing Python dependencies..." +pip install --upgrade pip +pip install -e . + +# ------------------------- +# 4. Setup PR-Agent config +# ------------------------- +echo "โš™๏ธ Creating local config file (pr_agent.toml)..." + +cat < pr_agent.toml +[general] +log_level = "info" + +[llm] +provider = "openai" +model = "gpt-4o" +# Add your API key here or via environment variable +api_key = "" + +[review] +enable_auto_review = true +EOF + +echo "โœ… Created pr_agent.toml" + +# ------------------------- +# 5. Test PR-Agent command +# ------------------------- +echo "๐Ÿงช Testing if pr-agent CLI is installed..." +if command -v pr-agent &> /dev/null +then + echo "๐ŸŽ‰ PR-Agent installed successfully!" +else + echo "โš ๏ธ pr-agent executable not found." + echo "Try: source .venv/bin/activate" +fi + +echo "โœจ Setup complete!" +echo "๐Ÿ‘‰ To activate environment later, run: source pr-agent/.venv/bin/activate"