-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (38 loc) · 1.49 KB
/
Copy pathMakefile
File metadata and controls
53 lines (38 loc) · 1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
.PHONY: help setup install dev run notebook build up down logs clean restart
.DEFAULT_GOAL := help
BLUE := \033[0;34m
GREEN := \033[0;32m
YELLOW := \033[0;33m
NC := \033[0m
VENV := .venv
UV := uv
help: ## Show this help
@echo "$(BLUE)Search-Augmented Generation with Web Scraping (mini-perplexity)$(NC)"
@echo ""
@echo "$(GREEN)Usage:$(NC)"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " $(YELLOW)%-15s$(NC) %s\n", $$1, $$2}'
setup: ## Initial setup (create .env, install deps)
@if [ ! -f .env ]; then cp .env.example .env && echo "$(GREEN)✓ .env created, edit it and add OPENAI_API_KEY$(NC)"; fi
@if ! command -v uv >/dev/null 2>&1; then curl -LsSf https://astral.sh/uv/install.sh | sh; fi
@$(UV) sync
@echo "$(GREEN)✓ Environment ready$(NC)"
install: ## Install dependencies
@$(UV) sync
dev: setup notebook ## Setup and launch notebook (one command!)
notebook: ## Launch Jupyter notebook
@$(UV) run jupyter notebook mini-perplexity.ipynb
run: notebook ## Alias for notebook
build: ## Build Docker image
docker compose build
up: ## Start container
docker compose up -d
@echo "$(GREEN)✓ Jupyter running at http://localhost:8888$(NC)"
down: ## Stop container
docker compose down
logs: ## View container logs
docker compose logs -f
restart: down up ## Restart container
clean: ## Remove venv and caches
rm -rf $(VENV) .ipynb_checkpoints
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
@echo "$(GREEN)✓ Cleaned$(NC)"