Last active
December 22, 2025 08:27
-
-
Save rjmurillo/5bd87b4f2ab80ca17e038e8ebceec20c to your computer and use it in GitHub Desktop.
Setup script for ai-agents development workstation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Setup script for ai-agents development workstation | |
| # Run with: bash ~/setup-ai-agents-workstation.sh | |
| # | |
| # This script installs all required tools for developing and maintaining | |
| # https://github.com/rjmurillo/ai-agents including MCP server dependencies. | |
| set -e | |
| echo "==============================================" | |
| echo " AI-Agents Development Workstation Setup" | |
| echo "==============================================" | |
| echo "" | |
| # Update package lists | |
| echo ">>> Updating package lists..." | |
| sudo apt-get update | |
| # Install essential tools | |
| echo ">>> Installing essential tools..." | |
| sudo apt-get install -y git curl wget gpg apt-transport-https software-properties-common jq unzip | |
| # Install PowerShell Core | |
| echo ">>> Installing PowerShell Core..." | |
| source /etc/os-release | |
| wget -q "https://packages.microsoft.com/config/ubuntu/$VERSION_ID/packages-microsoft-prod.deb" | |
| sudo dpkg -i packages-microsoft-prod.deb | |
| rm packages-microsoft-prod.deb | |
| sudo apt-get update | |
| sudo apt-get install -y powershell | |
| # Install Node.js (LTS version via NodeSource) - Required for Claude Code CLI and Serena language servers | |
| echo ">>> Installing Node.js LTS..." | |
| curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - | |
| sudo apt-get install -y nodejs | |
| # Install GitHub CLI | |
| echo ">>> Installing GitHub CLI..." | |
| sudo mkdir -p -m 755 /etc/apt/keyrings | |
| out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ | |
| && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ | |
| && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ | |
| && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ | |
| && sudo apt update \ | |
| && sudo apt install gh -y | |
| # Install Python tools | |
| echo ">>> Installing Python tools..." | |
| sudo apt-get install -y python3-pip python3-venv python3-dev | |
| # Install uv (Python package manager) - Required for Serena MCP server | |
| echo ">>> Installing uv (Python package manager)..." | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| export PATH="$HOME/.local/bin:$PATH" | |
| # Add uv to PATH permanently | |
| if ! grep -q 'export PATH="$HOME/.local/bin:$PATH"' ~/.bashrc; then | |
| echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc | |
| fi | |
| # Install Visual Studio Code | |
| echo ">>> Installing Visual Studio Code..." | |
| wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg | |
| sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg | |
| echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list > /dev/null | |
| rm -f packages.microsoft.gpg | |
| sudo apt-get update | |
| sudo apt-get install -y code | |
| # Install VS Code Extensions | |
| echo ">>> Installing VS Code extensions..." | |
| code --install-extension ms-vscode.powershell # PowerShell language support | |
| code --install-extension GitHub.copilot # GitHub Copilot | |
| code --install-extension GitHub.copilot-chat # GitHub Copilot Chat | |
| code --install-extension GitHub.vscode-pull-request-github # GitHub Pull Requests | |
| code --install-extension DavidAnson.vscode-markdownlint # Markdown linting | |
| code --install-extension ms-python.python # Python support | |
| code --install-extension eamodio.gitlens # Git supercharged | |
| code --install-extension EditorConfig.EditorConfig # EditorConfig support | |
| # Install Claude Code CLI | |
| echo ">>> Installing Claude Code CLI..." | |
| sudo npm install -g @anthropic-ai/claude-code | |
| # Install markdownlint-cli2 globally | |
| echo ">>> Installing markdownlint-cli2..." | |
| sudo npm install -g markdownlint-cli2 | |
| # Install Pester (PowerShell testing framework) | |
| echo ">>> Installing Pester module..." | |
| pwsh -Command "Install-Module -Name Pester -Force -SkipPublisherCheck -Scope CurrentUser" | |
| # Clone the repository | |
| echo ">>> Cloning ai-agents repository..." | |
| if [ ! -d "~/ai-agents" ]; then | |
| git clone https://github.com/rjmurillo/ai-agents.git ~/ai-agents | |
| # Fix ownership immediately after cloning | |
| sudo chown -R claude:claude ~/ai-agents | |
| else | |
| echo "Repository already exists at ~/ai-agents" | |
| # Ensure correct ownership | |
| sudo chown -R claude:claude ~/ai-agents | |
| cd ~/ai-agents && git pull | |
| fi | |
| # Set up git hooks | |
| echo ">>> Configuring git hooks..." | |
| cd ~/ai-agents | |
| git config core.hooksPath .githooks | |
| # Pre-cache Serena MCP server and its dependencies | |
| echo ">>> Pre-caching Serena MCP server..." | |
| $HOME/.local/bin/uvx --from "git+https://github.com/oraios/serena" serena --help > /dev/null 2>&1 || true | |
| # Install GitHub CLI extensions (requires gh auth first, so these may fail initially) | |
| echo ">>> Installing GitHub CLI extensions (may require 'gh auth login' first)..." | |
| gh extension install github/gh-copilot 2>/dev/null || echo " - gh-copilot: run 'gh auth login' first" | |
| gh extension install meiji163/gh-notify 2>/dev/null || echo " - gh-notify: run 'gh auth login' first" | |
| gh extension install rnorth/gh-combine-prs 2>/dev/null || echo " - gh-combine-prs: run 'gh auth login' first" | |
| gh extension install hectcastro/gh-metrics 2>/dev/null || echo " - gh-metrics: run 'gh auth login' first" | |
| gh extension install valeriobelli/gh-milestone 2>/dev/null || echo " - gh-milestone: run 'gh auth login' first" | |
| gh extension install lucasmelin/gh-hook 2>/dev/null || echo " - gh-hook: run 'gh auth login' first" | |
| gh extension install sarumaj/gh-gr 2>/dev/null || echo " - gh-gr: run 'gh auth login' first" | |
| gh extension install k1LoW/gh-grep 2>/dev/null || echo " - gh-grep: run 'gh auth login' first" | |
| gh extension install yahsan2/gh-sub-issue 2>/dev/null || echo " - gh-sub-issue: run 'gh auth login' first" | |
| # Verify agent generation works | |
| echo ">>> Verifying agent generation..." | |
| cd ~/ai-agents | |
| pwsh build/Generate-Agents.ps1 -Validate || echo "Warning: Agent generation validation failed (may need repo ownership fix)" | |
| echo "" | |
| echo "==============================================" | |
| echo " Installation Complete!" | |
| echo "==============================================" | |
| echo "" | |
| echo "--- Core Tools ---" | |
| echo "Git: $(git --version 2>/dev/null | cut -d' ' -f3)" | |
| echo "PowerShell: $(pwsh --version 2>/dev/null)" | |
| echo "Node.js: $(node --version 2>/dev/null)" | |
| echo "npm: $(npm --version 2>/dev/null)" | |
| echo "Python: $(python3 --version 2>/dev/null | cut -d' ' -f2)" | |
| echo "GitHub CLI: $(gh --version 2>/dev/null | head -1 | cut -d' ' -f3)" | |
| echo "VS Code: $(code --version 2>/dev/null | head -1)" | |
| echo "Claude Code: $(claude --version 2>/dev/null || echo 'installed')" | |
| echo "uv: $($HOME/.local/bin/uv --version 2>/dev/null || echo 'installed')" | |
| echo "jq: $(jq --version 2>/dev/null)" | |
| echo "markdownlint: $(npx markdownlint-cli2 --version 2>/dev/null || echo 'installed')" | |
| echo "" | |
| echo "--- MCP Servers (from .mcp.json) ---" | |
| echo "Serena: uvx --from git+https://github.com/oraios/serena serena (stdio)" | |
| echo "DeepWiki: https://mcp.deepwiki.com/mcp (http)" | |
| echo "" | |
| echo "--- VS Code Extensions ---" | |
| code --list-extensions 2>/dev/null | grep -iE "powershell|copilot|pull-request|markdownlint|python|gitlens|editorconfig" | sed 's/^/ /' | |
| echo "" | |
| echo "==============================================" | |
| echo " IMPORTANT NEXT STEPS" | |
| echo "==============================================" | |
| echo "" | |
| echo "1. RESTART YOUR TERMINAL or run: source ~/.bashrc" | |
| echo " (Required for 'uv' and 'uvx' commands to work)" | |
| echo "" | |
| echo "2. Authenticate with GitHub:" | |
| echo " gh auth login" | |
| echo "" | |
| echo "3. After GitHub auth, install remaining CLI extensions:" | |
| echo " gh extension install github/gh-copilot" | |
| echo "" | |
| echo "4. Start developing:" | |
| echo " cd ~/ai-agents" | |
| echo " code . # Open in VS Code" | |
| echo " claude # Start Claude Code CLI" | |
| echo "" | |
| echo "5. Test MCP servers:" | |
| echo " # Serena MCP server (in ai-agents directory):" | |
| echo " uvx --from git+https://github.com/oraios/serena serena start-mcp-server --project . --context claude-code --port 24282" | |
| echo "" | |
| echo "See CONTRIBUTING.md for development workflow." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment