CoolFace
Apppublic

Falln87/computer-use-agent

sourceHugging Faceupdated 10mo agoView on Hugging Face
0likes
Makefile80 linesDownload Raw Back to root
1.PHONY: sync setup install dev-backend dev-frontend dev clean docker-build docker-run docker-stop docker-clean docker-logs2 3# Sync all dependencies (Python + Node.js)4sync:5	@echo "Syncing Python dependencies..."6	uv sync --all-extras7	@echo "Installing frontend dependencies..."8	cd cua2-front && npm install9	@echo "✓ All dependencies synced!"10 11setup: sync12 13install-frontend:14	cd cua2-front && npm install15 16# Start backend development server17dev-backend:18	cd cua2-core && uv run uvicorn cua2_core.main:app --reload --host 0.0.0.0 --port 800019 20# Start frontend development server21dev-frontend:22	cd cua2-front && npm run dev23 24pre-commit:25	uv run pre-commit run --all-files --show-diff-on-failure26	make test27 28# Run tests29test:30	cd cua2-core && uv run pytest tests/ -v31 32test-coverage:33	cd cua2-core && uv run pytest tests/ -v --cov=cua2_core --cov-report=html --cov-report=term34 35clean:36	find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true37	find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true38	find . -type d -name ".pytest_cache" -exec rm -rf {} + 2>/dev/null || true39	cd cua2-front && rm -rf node_modules dist 2>/dev/null || true40	@echo "✓ Cleaned!"41 42# Docker commands43docker-build:44	@echo "Building Docker image..."45	make docker-stop46	docker build -t cua2:latest .47	@echo "✓ Docker image built successfully!"48 49docker-run:50	@echo "Starting CUA2 container..."51	@if [ -z "$$E2B_API_KEY" ]; then \52		echo "Error: E2B_API_KEY environment variable is not set"; \53		echo "Please set it with: export E2B_API_KEY=your-key"; \54		exit 1; \55	fi56	@if [ -z "$$HF_TOKEN" ]; then \57		echo "Error: HF_TOKEN environment variable is not set"; \58		echo "Please set it with: export HF_TOKEN=your-token"; \59		exit 1; \60	fi61	docker run -d --name cua2-app -p 7860:7860 \62		-e E2B_API_KEY="$$E2B_API_KEY" \63		-e HF_TOKEN="$$HF_TOKEN" \64		cua2:latest65	@echo "✓ Container started! Access at http://localhost:7860"66 67docker-stop:68	@echo "Stopping CUA2 container..."69	docker stop cua2-app || true70	docker rm cua2-app || true71	@echo "✓ Container stopped!"72 73docker-clean:74	@echo "Removing CUA2 Docker images..."75	docker rmi cua2:latest || true76	@echo "✓ Docker images removed!"77 78docker-logs:79	docker logs -f cua2-app80