Add dev container configuration with docker-compose, Dockerfile, and entrypoint script - Create .devcontainer/devcontainer.json for VS Code dev container - Create .devcontainer/docker-compose.yml for container setup - Add Dockerfile with Python, Go, Rust, R, and jj tools - Add docker-entrypoint.sh to initialize .ai_index and start mcp-server - Add Makefile for container management and MCP operations - Add .gitignore entries for AI index - Add OpenCode global instructions - Add basic MCP server and tool for listing Go imports - Add Zed integration configuration - Update README with project vision and structure
67 lines
1.9 KiB
Makefile
67 lines
1.9 KiB
Makefile
# Makefile pour dev container AI + MCP bootstrap
|
|
|
|
# Variables
|
|
PROJECT_DIR := $(shell pwd)
|
|
CONTAINER_NAME := ai-dev-container
|
|
WORKSPACE := /workspace
|
|
MCP_LOG := $(WORKSPACE)/.ai_index/mcp.log
|
|
|
|
# --- Dev Container Management ---
|
|
|
|
# Build the container
|
|
build:
|
|
docker build -t $(CONTAINER_NAME) .
|
|
|
|
# Run interactive container with mounted project
|
|
run:
|
|
docker run -v $(PROJECT_DIR):$(WORKSPACE) -it --rm $(CONTAINER_NAME)
|
|
|
|
# Run container with MCP server in background
|
|
run-mcp:
|
|
docker run -v $(PROJECT_DIR):$(WORKSPACE) -it --rm $(CONTAINER_NAME) bash
|
|
|
|
# --- MCP / Index Management ---
|
|
|
|
# Initialize .ai_index
|
|
init-index:
|
|
@echo "[MAKE] Initializing .ai_index..."
|
|
mkdir -p $(PROJECT_DIR)/.ai_index/ast
|
|
mkdir -p $(PROJECT_DIR)/.ai_index/embeddings
|
|
@if [ ! -f $(PROJECT_DIR)/.ai_index/graph.db ]; then \
|
|
sqlite3 $(PROJECT_DIR)/.ai_index/graph.db "VACUUM;"; \
|
|
fi
|
|
|
|
# Run MCP tool (list imports)
|
|
mcp-list:
|
|
@echo "[MAKE] Running MCP list_imports.py..."
|
|
python3 $(PROJECT_DIR)/opt/dev-tools/list_imports.py --project $(WORKSPACE)
|
|
|
|
# Update embeddings (example)
|
|
embeddings:
|
|
@echo "[MAKE] Generating embeddings..."
|
|
python3 $(PROJECT_DIR)/opt/dev-tools/generate_embeddings.py --project $(WORKSPACE)
|
|
|
|
# Update graph (example)
|
|
update-graph:
|
|
@echo "[MAKE] Updating dependency graph..."
|
|
python3 $(PROJECT_DIR)/opt/dev-tools/update_graph.py --project $(WORKSPACE)
|
|
|
|
# Clean logs and temporary files
|
|
clean:
|
|
@echo "[MAKE] Cleaning .ai_index..."
|
|
rm -f $(PROJECT_DIR)/.ai_index/*.log
|
|
rm -rf $(PROJECT_DIR)/.ai_index/ast/*
|
|
rm -rf $(PROJECT_DIR)/.ai_index/embeddings/*
|
|
|
|
# Restart MCP server inside container
|
|
restart-mcp:
|
|
docker exec -it $(CONTAINER_NAME) bash -c "\
|
|
pkill -f mcp-server; \
|
|
/opt/bin/mcp-server --project $(WORKSPACE) > $(MCP_LOG) 2>&1 & \
|
|
"
|
|
|
|
# --- Bootstrap for new project ---
|
|
# Build container, init index
|
|
bootstrap: build init-index
|
|
@echo "[MAKE] Bootstrap complete. Run 'make run' to start the container."
|