Add Aider as local Claude Code-equivalent coding assistant
- Add aider Docker service (paulgauthier/aider) with GUI on port 8080 pointing at local ollama code model (auto-detected by VRAM tier) - Add aider.sh CLI wrapper: cd into any git repo and run files through aider terminal mode against the same local model - Add port 8080 to UFW firewall rules - Surface Aider UI URL in start.sh output and final install summary https://claude.ai/code/session_012gDnantBmFTWZGCiKyjazx
This commit is contained in:
+61
-2
@@ -513,7 +513,7 @@ cat > "$BASE/docker-compose.yml" << COMPOSE
|
|||||||
# Pull latest images: docker compose pull && docker compose up -d
|
# Pull latest images: docker compose pull && docker compose up -d
|
||||||
# Show status: docker compose ps
|
# Show status: docker compose ps
|
||||||
#
|
#
|
||||||
# Services: ollama open-webui chromadb rag-server mcp-server
|
# Services: ollama open-webui chromadb rag-server mcp-server aider
|
||||||
# kiwix gitea invokeai portainer
|
# kiwix gitea invokeai portainer
|
||||||
# ───────────────────────────────────────────────────────────────────────────────
|
# ───────────────────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
@@ -619,6 +619,27 @@ services:
|
|||||||
python mcp_server.py"
|
python mcp_server.py"
|
||||||
depends_on: [rag-server, kiwix]
|
depends_on: [rag-server, kiwix]
|
||||||
|
|
||||||
|
aider:
|
||||||
|
image: paulgauthier/aider:latest
|
||||||
|
container_name: aider
|
||||||
|
restart: unless-stopped
|
||||||
|
ports: ["0.0.0.0:8080:8501"]
|
||||||
|
volumes:
|
||||||
|
- $BASE/workspace:/workspace
|
||||||
|
- $BASE/repos:/repos
|
||||||
|
working_dir: /workspace
|
||||||
|
environment:
|
||||||
|
- OLLAMA_API_BASE=http://ollama:11434
|
||||||
|
- GIT_AUTHOR_NAME=aider
|
||||||
|
- GIT_AUTHOR_EMAIL=aider@local
|
||||||
|
- GIT_COMMITTER_NAME=aider
|
||||||
|
- GIT_COMMITTER_EMAIL=aider@local
|
||||||
|
command: >
|
||||||
|
--gui --no-auto-commits --no-check-update
|
||||||
|
--model ollama/$CODE_MODEL
|
||||||
|
depends_on:
|
||||||
|
ollama: {condition: service_healthy}
|
||||||
|
|
||||||
kiwix:
|
kiwix:
|
||||||
image: ghcr.io/kiwix/kiwix-serve:latest
|
image: ghcr.io/kiwix/kiwix-serve:latest
|
||||||
container_name: kiwix
|
container_name: kiwix
|
||||||
@@ -688,7 +709,7 @@ if command -v ufw &>/dev/null && [[ ! -f "$BASE/.ufw-done" ]] || $FORCE; then
|
|||||||
read -rp " LAN subnet [192.168.1.0/24]: " LAN; LAN="${LAN:-192.168.1.0/24}"
|
read -rp " LAN subnet [192.168.1.0/24]: " LAN; LAN="${LAN:-192.168.1.0/24}"
|
||||||
[[ "$LAN" =~ /[0-9]+$ ]] || LAN="${LAN}/24"
|
[[ "$LAN" =~ /[0-9]+$ ]] || LAN="${LAN}/24"
|
||||||
for pc in "3000:Open WebUI" "11434:Ollama" "8001:RAG" "8002:MCP" \
|
for pc in "3000:Open WebUI" "11434:Ollama" "8001:RAG" "8002:MCP" \
|
||||||
"8000:ChromaDB" "8181:Kiwix" \
|
"8000:ChromaDB" "8080:Aider" "8181:Kiwix" \
|
||||||
"3001:Gitea" "2222:Gitea SSH" "9090:InvokeAI" \
|
"3001:Gitea" "2222:Gitea SSH" "9090:InvokeAI" \
|
||||||
"9000:Portainer" "9443:Portainer S"; do
|
"9000:Portainer" "9443:Portainer S"; do
|
||||||
sudo ufw allow from "$LAN" to any port "${pc%%:*}" proto tcp comment "${pc##*:}" >/dev/null
|
sudo ufw allow from "$LAN" to any port "${pc%%:*}" proto tcp comment "${pc##*:}" >/dev/null
|
||||||
@@ -706,6 +727,7 @@ docker compose pull --quiet 2>/dev/null
|
|||||||
docker compose up -d
|
docker compose up -d
|
||||||
echo ""
|
echo ""
|
||||||
echo " Open WebUI → http://$LOCAL_IP:3000"
|
echo " Open WebUI → http://$LOCAL_IP:3000"
|
||||||
|
echo " Aider UI → http://$LOCAL_IP:8080 (Claude Code-like editor)"
|
||||||
echo " InvokeAI → http://$LOCAL_IP:9090"
|
echo " InvokeAI → http://$LOCAL_IP:9090"
|
||||||
echo " Kiwix → http://$LOCAL_IP:8181 (run kiwix_download.sh first)"
|
echo " Kiwix → http://$LOCAL_IP:8181 (run kiwix_download.sh first)"
|
||||||
echo " Gitea → http://$LOCAL_IP:3001"
|
echo " Gitea → http://$LOCAL_IP:3001"
|
||||||
@@ -759,6 +781,39 @@ PULLSH
|
|||||||
chmod +x "$BASE/pull-models.sh"
|
chmod +x "$BASE/pull-models.sh"
|
||||||
ok "start.sh stop.sh status.sh pull-models.sh"
|
ok "start.sh stop.sh status.sh pull-models.sh"
|
||||||
|
|
||||||
|
cat > "$BASE/aider.sh" << AIDSH
|
||||||
|
#!/bin/bash
|
||||||
|
# Aider CLI — Claude Code-like terminal experience against any local git repo.
|
||||||
|
# Usage:
|
||||||
|
# ./aider.sh # interactive, files from stdin
|
||||||
|
# ./aider.sh src/main.py # open specific files
|
||||||
|
# ./aider.sh --model ollama/qwen2.5-coder:7b src/foo.py # override model
|
||||||
|
#
|
||||||
|
# Tip: clone Gitea repos into $BASE/repos/, then:
|
||||||
|
# cd $BASE/repos/my-project && $BASE/aider.sh <files>
|
||||||
|
|
||||||
|
MODEL="\${AIDER_MODEL:-ollama/$CODE_MODEL}"
|
||||||
|
REPO_ROOT="\$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
|
||||||
|
|
||||||
|
docker run --rm -it \\
|
||||||
|
--network local-ai_default \\
|
||||||
|
-v "\$REPO_ROOT:\$REPO_ROOT" \\
|
||||||
|
-v "$BASE/repos:/repos" \\
|
||||||
|
-w "\$REPO_ROOT" \\
|
||||||
|
-e OLLAMA_API_BASE=http://ollama:11434 \\
|
||||||
|
-e GIT_AUTHOR_NAME=aider \\
|
||||||
|
-e GIT_AUTHOR_EMAIL=aider@local \\
|
||||||
|
-e GIT_COMMITTER_NAME=aider \\
|
||||||
|
-e GIT_COMMITTER_EMAIL=aider@local \\
|
||||||
|
paulgauthier/aider:latest \\
|
||||||
|
--no-auto-commits \\
|
||||||
|
--no-check-update \\
|
||||||
|
--model "\$MODEL" \\
|
||||||
|
"\$@"
|
||||||
|
AIDSH
|
||||||
|
chmod +x "$BASE/aider.sh"
|
||||||
|
ok "aider.sh"
|
||||||
|
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
section "Systemd"
|
section "Systemd"
|
||||||
# =============================================================================
|
# =============================================================================
|
||||||
@@ -805,6 +860,7 @@ echo -e "${GREEN}${BOLD} Done! GPU: ${VRAM_GB}GB → $TIER${NC}"
|
|||||||
echo -e "${GREEN}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
echo -e "${GREEN}${BOLD}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
echo -e " ${CYAN}Open WebUI${NC} → http://$LOCAL_IP:3000"
|
echo -e " ${CYAN}Open WebUI${NC} → http://$LOCAL_IP:3000"
|
||||||
|
echo -e " ${CYAN}Aider UI${NC} → http://$LOCAL_IP:8080 (browser coding assistant)"
|
||||||
echo -e " ${CYAN}InvokeAI${NC} → http://$LOCAL_IP:9090"
|
echo -e " ${CYAN}InvokeAI${NC} → http://$LOCAL_IP:9090"
|
||||||
echo -e " ${CYAN}Kiwix${NC} → http://$LOCAL_IP:8181"
|
echo -e " ${CYAN}Kiwix${NC} → http://$LOCAL_IP:8181"
|
||||||
echo -e " ${CYAN}Gitea${NC} → http://$LOCAL_IP:3001"
|
echo -e " ${CYAN}Gitea${NC} → http://$LOCAL_IP:3001"
|
||||||
@@ -820,6 +876,9 @@ echo -e " ${YELLOW}PDFs:${NC} $BASE/papers/"
|
|||||||
echo -e " ${YELLOW}Workspace:${NC} $BASE/workspace/"
|
echo -e " ${YELLOW}Workspace:${NC} $BASE/workspace/"
|
||||||
echo -e " ${YELLOW}ZIMs:${NC} ./kiwix_download.sh"
|
echo -e " ${YELLOW}ZIMs:${NC} ./kiwix_download.sh"
|
||||||
echo ""
|
echo ""
|
||||||
|
echo -e " ${YELLOW}Aider CLI:${NC} cd your-repo && $BASE/aider.sh <files>"
|
||||||
|
echo " (or open browser UI above — both use your local code model)"
|
||||||
|
echo ""
|
||||||
echo -e " ${YELLOW}Save Claude usage:${NC} use local 14B for boilerplate, docs,"
|
echo -e " ${YELLOW}Save Claude usage:${NC} use local 14B for boilerplate, docs,"
|
||||||
echo " simple fixes. Use Claude Sonnet 4.6 for hard bugs,"
|
echo " simple fixes. Use Claude Sonnet 4.6 for hard bugs,"
|
||||||
echo " multi-file refactoring, architecture decisions."
|
echo " multi-file refactoring, architecture decisions."
|
||||||
|
|||||||
Reference in New Issue
Block a user