Add installer script and repository integration guide.

Made-with: Cursor
This commit is contained in:
Andrey Lutsenko
2026-04-20 22:57:39 +10:00
parent 5f20b0eae6
commit 4c652c7431
4 changed files with 238 additions and 0 deletions
+15
View File
@@ -6,6 +6,7 @@
- `index.py` - индексация документов в Qdrant
- `mcp_server.py` - MCP инструменты `search_docs` и `answer_with_citations`
- `requirements.txt` - Python зависимости
- `install.sh` - one-command bootstrap для Ubuntu
## Быстрый запуск
@@ -21,6 +22,20 @@ python index.py
python mcp_server.py
```
## Автоматический bootstrap
```bash
chmod +x install.sh
./install.sh
```
Опции:
```bash
./install.sh --skip-model-pull
./install.sh --docs-dir /path/to/my/docs
```
## Переменные окружения
- `QDRANT_URL` (default `http://127.0.0.1:6333`)
+108
View File
@@ -0,0 +1,108 @@
#!/usr/bin/env bash
set -euo pipefail
# One-command bootstrap for OpenClaude local RAG starter on Ubuntu.
#
# Usage:
# ./install.sh
# ./install.sh --skip-model-pull
# ./install.sh --docs-dir /path/to/docs
SKIP_MODEL_PULL=0
DOCS_DIR="${PWD}/docs"
WORKDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
while [[ $# -gt 0 ]]; do
case "$1" in
--skip-model-pull)
SKIP_MODEL_PULL=1
shift
;;
--docs-dir)
DOCS_DIR="$2"
shift 2
;;
*)
echo "Unknown argument: $1"
exit 2
;;
esac
done
need_cmd() {
command -v "$1" >/dev/null 2>&1 || {
echo "Missing command: $1"
exit 1
}
}
echo "==> Installing system packages"
sudo apt update
sudo apt install -y curl git docker.io docker-compose-plugin python3 python3-venv python3-pip
echo "==> Enabling Docker"
sudo systemctl enable docker
sudo systemctl start docker
echo "==> Installing Ollama if needed"
if ! command -v ollama >/dev/null 2>&1; then
curl -fsSL https://ollama.com/install.sh | sh
fi
sudo systemctl enable ollama
sudo systemctl start ollama
echo "==> Verifying local services"
curl -fsS "http://127.0.0.1:11434/api/tags" >/dev/null || true
echo "==> Installing OpenClaude CLI"
if ! command -v openclaude >/dev/null 2>&1; then
need_cmd npm
npm install -g @gitlawb/openclaude
fi
echo "==> Starting Qdrant"
cd "$WORKDIR"
docker compose up -d
echo "==> Creating Python venv"
python3 -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -r requirements.txt
echo "==> Preparing docs directory"
mkdir -p "$DOCS_DIR"
if [[ "$DOCS_DIR" != "${WORKDIR}/docs" ]]; then
echo "Using custom docs directory: $DOCS_DIR"
fi
if [[ "$SKIP_MODEL_PULL" -eq 0 ]]; then
echo "==> Pulling models (qwen2.5-coder:7b + nomic-embed-text)"
ollama pull qwen2.5-coder:7b
ollama pull nomic-embed-text
else
echo "==> Skipping model pull (--skip-model-pull)"
fi
cat <<EOF
Bootstrap complete.
Next steps:
1) Put your files into: $DOCS_DIR
2) Index docs:
cd "$WORKDIR"
source .venv/bin/activate
RAG_DOCS_DIR="$DOCS_DIR" python index.py
3) Run MCP server:
cd "$WORKDIR"
source .venv/bin/activate
python mcp_server.py
4) Run OpenClaude against local Ollama:
export CLAUDE_CODE_USE_OPENAI=1
export OPENAI_BASE_URL=http://127.0.0.1:11434/v1
export OPENAI_MODEL=qwen2.5-coder:7b
openclaude
EOF